Let's create a Windows GUI application using the standard Python library "Tkinter".
This time, I will use Eclipse as the IDE and PyDev as the execution environment for Python.
First, download the Python Full Edition of "Pleiades All in One Eclipse" from the following URL.
https://mergedoc.osdn.jp/index.html#/pleiades_distros2020.html
Unzip the downloaded zip file and move the pleiades
folder inside to directly under the C drive.
Change Eclipse's default interpreter to Python 3.
Eclipse (C:\pleiades\eclipse\ Start eclipse.exe
) and open [Window]-> [Settings] from the menu.
Open [PyDev]-> [Interpreter]-> [Python Interpreter] in the left menu. Select "Python3" and click the [Up] button to move "Python3" to the top, and click the [Apply and Close] button.
Create an Eclipse project.
Right-click in the blank area of "Pydev Package Explorer" on the left side and open [New]-> [Project].
Select [Pydev Project] under [PyDev] and click the [Next] button.
Enter an appropriate project name (testproj1
this time) and click the [Finish] button.
Add a Python program to the created project.
Right-click the project you just created in "Pydev Package Explorer" on the left, and click [New]-> [File].
Enter an appropriate file name (test1.py
this time) and click the [Finish] button.
Enter the following code in test1.py
and save it.
import tkinter as tk
if __name__ == '__main__':
root = tk.Tk()
root.title('test')
root.geometry('300x200')
label01 = tk.Label(text='Hello, World!')
label01.pack()
root.mainloop()
Click the ▼ mark to the right of the play button at the top of Eclipse and select Run-> Run Python.
The execution result of the program is displayed.
Now you are ready to develop your Windows app.
Next time, I'll try using various Tkinter UI components.
Recommended Posts