एक मानक टिंकर एप्लिकेशन को विंडो निष्पादन योग्य फ़ाइल में बदलने के लिए, हम आम तौर पर Pyintsaller पैकेज का उपयोग करते हैं। यह एप्लिकेशन फ़ाइल को एक निष्पादन योग्य एप्लिकेशन में परिवर्तित करता है। हालाँकि, हम देखते हैं कि जब हम निष्पादन योग्य (या .exe) फ़ाइल खोलते हैं, तो यह एप्लिकेशन विंडो खोलने से पहले एक कमांड शेल प्रदर्शित करता है। हम pyinstaller --oneline filename --windowed निर्दिष्ट करके कंसोल को छुपा या टाल सकते हैं आदेश।
उदाहरण
इस उदाहरण में, हम PyInstaller का उपयोग करके निम्न प्रोग्राम की एक .exe फ़ाइल बनाएंगे।
app.py
#Import the required libraries
from tkinter import *
#Create an instance of Tkinter Frame
win = Tk()
#Set the geometry
win.geometry("700x350")
#Set the default color of the window
win.config(bg= '#aad5df')
def display_text():
Label(win, text= "Hello World!", background= 'white', foreground='purple1').pack()
Button(win, text= "Click Me", background= "white", foreground= "black", font= ('Helvetica 13 bold'), command= display_text).pack(pady= 50)
win.mainloop() अब, टर्मिनल को उसी स्थान पर खोलें जहां आपने app.py सहेजा है और निम्न कमांड चलाएँ -
> pyinstaller –onefile app.py –windowed
यह डिस्ट फोल्डर में एक app.exe फाइल बनाएगा।
आउटपुट
जब हम Dist फ़ोल्डर में स्थित निष्पादन योग्य फ़ाइल चलाते हैं, तो यह एक बटन और एक लेबल विजेट के साथ एक विंडो प्रदर्शित करेगा।

ध्यान दें कि .exe फ़ाइल ने एप्लिकेशन विंडो खोलने से पहले कमांड शेल प्रदर्शित नहीं किया।