Python Forum
problem with python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with python
#12
Looks like you have misunderstood this.
Python3 comes already installed in Mint 20.1 so no need to install python.

Was it telling you you needed to do
pip install Tkinter
Quote:
#--------------
#Imports
#--------------
from Tkinter import *
#--------------
# Main Window
#--------------
mainWindow = Tk()
mainWindowTitle = Label(mainWindow, text="Our New GUI")
mainWindowTitle.pack()
mainWindow.mainloop()
Tkinter is the name for python 2.x and you didn't have it installed originally.
For python3 it is called tkinter.
You need to install Python3-tk using the software manager.
Then maybe if you just edit your code so it says
from tkinter import *
instead it won't complain anymore.
Also if you are running it from the command line and your program is called first.py
you do it this way from the directory the file is in:
python3 ./first.py
There are some small syntax differences between python 2.x and python 3.x and I don't think python 2.x is being developed any more. It would be best to just write code in the 3.x version of python.
raarkil likes this post
Reply


Messages In This Thread
problem with python - by raarkil - Apr-27-2021, 08:29 PM
RE: problem with python - by Barrowman - Apr-27-2021, 08:50 PM
RE: problem with python - by raarkil - Apr-28-2021, 09:04 AM
RE: problem with python - by BashBedlam - Apr-28-2021, 01:01 AM
RE: problem with python - by Barrowman - Apr-28-2021, 08:22 AM
RE: problem with python - by raarkil - Apr-28-2021, 09:08 AM
RE: problem with python - by raarkil - Apr-28-2021, 09:14 AM
RE: problem with python - by raarkil - Apr-28-2021, 09:14 AM
RE: problem with python - by perfringo - Apr-28-2021, 09:15 AM
RE: problem with python - by raarkil - Apr-28-2021, 09:23 AM
RE: problem with python - by perfringo - Apr-29-2021, 10:08 AM
RE: problem with python - by raarkil - Apr-30-2021, 01:05 PM
RE: problem with python - by raarkil - Apr-28-2021, 12:46 PM
RE: problem with python - by Barrowman - Apr-28-2021, 01:37 PM
RE: problem with python - by raarkil - Apr-28-2021, 04:50 PM
RE: problem with python - by raarkil - Apr-28-2021, 05:06 PM
RE: problem with python - by Barrowman - Apr-28-2021, 05:20 PM
RE: problem with python - by raarkil - Apr-28-2021, 05:42 PM
RE: problem with python - by Barrowman - Apr-28-2021, 07:17 PM
RE: problem with python - by raarkil - Apr-28-2021, 09:17 PM
RE: problem with python - by Barrowman - Apr-28-2021, 09:31 PM
RE: problem with python - by raarkil - Apr-28-2021, 09:48 PM
RE: problem with python - by raarkil - Apr-29-2021, 11:46 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020