यदि आपने कभी सोचा है कि Python एप्लिकेशन में डायलॉग बॉक्स कैसे काम करते हैं, तो आप शायद Tkinter में filedialog मॉड्यूल के बारे में सुनेंगे। filedialog मॉड्यूल में कई बिल्ट-इन फ़ंक्शन होते हैं जिनका उपयोग सिस्टम में फ़ाइलों से निपटने के लिए विभिन्न प्रकार के डायलॉग प्रदर्शित करने के लिए किया जा सकता है।
अधिकांश मामलों में, हम उपयोगकर्ता को सिस्टम से फ़ाइल ब्राउज़ करने और खोलने के लिए कहने के लिए filedialog.askopenfilename() फ़ंक्शन का उपयोग करते हैं। फ़ाइल प्रकार के चयन के आधार पर, स्क्रिप्ट को राइट या रीड ऑपरेशन करने के लिए प्रोग्राम किया जाता है।
एक बार फ़ाइल खुल जाने पर, आप किसी भी मोड में खोलने और ऑपरेशन करने के लिए open(file, 'mode') फ़ंक्शन का उपयोग कर सकते हैं। इसे प्रदर्शित करने के लिए, आइए एक उदाहरण लेते हैं जहां हम एक एप्लिकेशन बनाएंगे जो उपयोगकर्ता को टेक्स्ट फ़ाइल खोलने के लिए कहेगा। एक बार फ़ाइल चुनी और खोली जाने पर, हम ऑपरेशन के "रीड" मोड का उपयोग करके इस फ़ाइल को पढ़ सकते हैं।
उदाहरण
# लाइब्रेरी इम्पोर्ट करें
from tkinter import *
from tkinter import filedialog
# विंडो का इंस्टेंस बनाएं
win = Tk()
# विंडो की ज्यामिति सेट करें
win.geometry("700x300")
# एक लेबल बनाएं
Label(win, text="Click the button to open a dialog", font='Arial 16 bold').pack(pady=15)
# सिस्टम में फ़ाइल खोलने के लिए फ़ंक्शन
def open_file():
filepath = filedialog.askopenfilename(title="Open a Text File", filetypes=(("text files", "*.txt"), ("all files", "*.*")))
file = open(filepath, 'r')
print(file.read())
file.close()
# डायलॉग ट्रिगर करने के लिए एक बटन बनाएं
button = Button(win, text="Open", command=open_file)
button.pack()
win.mainloop()
आउटपुट
उपरोक्त कोड चलाने से डायलॉग खोलने के लिए एक बटन वाली विंडो प्रदर्शित होगी।

एक टेक्स्ट फ़ाइल चुनें और खोलें और कंसोल फ़ाइल की सभी सामग्री प्रदर्शित करेगा।
Centralized Database Vs Blockchain A blockchain can be both permissionless (like Bitcoin or Ethereum) or permissioned (like the different Hyperledger blockchain frameworks). A permissionless blockchain is also known as a public blockchain, because anyone can join the network. A permissioned blockchain, or private blockchain, requires pre-verification of the participating parties within the network, and these parties are usually known to each other. Types of Blockchains The choice between permissionless versus permissioned blockchains should be driven by the particular application at hand (or use case). Most enterprise use cases involve extensive vetting before parties agree to do business with each other. An example where a number of businesses exchange information is supply chain management. The supply chain management is an ideal use case for permissioned blockchains. You would only want trusted parties participating in the network. Each participant that is involved in the supply chain would require permissions to execute transactions on the blockchain. These transactions would allow other companies to understand where in the supply chain a particular item is.