Python Forum
Problem with tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with tkinter
#11
terminal is linux, in windows it's Command Prompt
CWD - current working directory.
When you open command prompt, the prompt looks something like
C:\Users\Sylas>
So CWD is c:\user\Sylas. Let's say you saved your hello.py at c:\Users\Sylas\my_python_files\
then on the prompt write cd my_python_files and the prompt will look like C:\Users\Sylas\my_python_files>
write python hello.py
i.e.
C:\Users\Sylas\my_python_files>python hello.py
Reply
#12
Microsoft Windows [Version 10.0.16299.192]
© 2017 Microsoft Corporation. All rights reserved.

C:\Users\Sylvain>cd my_python_files

C:\Users\Sylvain\my_python_files>python helo.py

C:\Users\Sylvain\my_python_files>
At last I had to create :mkdir my_python_files. I did that as you see above.In Notepad I saved helo.py, because there are so many hello.py.
No success. Can you tell me how to see my files that are present in the folder my_python_files, since with windows "ls" is impossible.

There is a progress, now your file is named rep.py
Microsoft Windows [Version 10.0.16299.192]
© 2017 Microsoft Corporation. All rights reserved.

C:\Users\Sylvain>cd my_python_files

C:\Users\Sylvain\my_python_files>python rep.py
File "rep.py", line 2
class Application(tk.Frame):
^
IndentationError: unexpected indent

C:\Users\Sylvain\my_python_files>
Where can I look for repairing ? Thanks
Reply
#13
https://www.lifewire.com/list-of-command...ds-4092302

as to your python error - check the indentation
Reply
#14
@buran. I did learn many things with you, but I don't know how to modify lines in my file, without the help of Pycharm. In the command prompt if I type "type NameFile", I see all the file, but I can touch nothing in it.
Reply
#15
well, you created the file with Notepad... Use Notepad to edit it
Also there is no problem to open the file with PyCharm and edit it with it. However, based on your experience with PyCharm so far, I doubt it will be easier for you...
Reply
#16
My Pycharm version:2017.3.3 My python version: 3.6. My PC HP windows 10(64 bits) I have two files: one with import tkinter and another with import pygame. These two files work well if I don't use Pycharm. They work well with Notepad and command prompt.
On Pycharm I find tkinter on two places 1. Library>Typesheed Stubs>3 libraryroot>tkinter......2. File>Open >ProgramFiles>python36>Lib>tkinter
I find pygame only with File>Open>ProjectFiles>python36>include>pygame
Have you an idea why Pycharm does not find neither tkinter nor pygame. I tried also : from . import xxx and also from . . import xxx without success.
Reply
#17
I think all my troubles are due to the fact my files are outside the Project. I have to move them, as I did with Linux, but with windows it is much more hard.
Reply
#18
I am dispared. I created a new project, where I am sure the files are inside the project, always import impossible. Without Pycharm python imports easily. Why ?
Reply
#19
(Feb-15-2018, 09:48 PM)sylas Wrote: These two files work well if I don't use Pycharm. They work well with Notepad and command prompt.
I strongly suggest to take some/all of these tutorials
https://confluence.jetbrains.com/display...+Tutorials
or choose different IDE if PyCharm is too complicated for you
Reply
#20
Why nobody told me look at "Configure import settings" of Pycharm. I went there. It will take some hours for me, to understand what to do.

Pycharm told me that my file "t_kinter.py" is an "invalid file". First time I hear that. How to do to make the file valid ? Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python3 tkinter radiobutton problem Nick_tkinter 14 6,086 Feb-15-2021, 11:01 PM
Last Post: Nick_tkinter
  tkinter python button position problem Nick_tkinter 3 3,582 Jan-31-2021, 05:15 AM
Last Post: deanhystad
  [Tkinter] ClockIn/Out tkinter problem Maryan 2 2,229 Oct-12-2020, 03:42 AM
Last Post: joe_momma
  tkinter| listbox.insert problem Maryan 3 3,540 Sep-29-2020, 05:34 PM
Last Post: Yoriz
  Tkinter problem DPaul 6 4,173 May-28-2020, 03:40 PM
Last Post: DPaul
  [Tkinter] Tkinter - I have problem after import varaible or function from aGUI to script johnjh 2 2,609 Apr-17-2020, 08:12 PM
Last Post: johnjh
  [Tkinter] Problem with tkinter when creating .exe file Jan_97 2 4,624 Feb-27-2020, 05:17 PM
Last Post: Jan_97
  [Tkinter] Tkinter problem catlessness 1 2,069 Jan-15-2020, 05:17 AM
Last Post: Larz60+
  Problem with Submit button Tkinter Reldaing 2 3,679 Jan-05-2020, 01:58 AM
Last Post: balenaucigasa
  tkinter GUI, problem running seperate files fishglue 17 6,428 Oct-15-2019, 02:56 PM
Last Post: Denni

Forum Jump:

User Panel Messages

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