Python Forum

Full Version: Problem with tkinter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
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
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
https://www.lifewire.com/list-of-command...ds-4092302

as to your python error - check the indentation
@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.
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...
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.
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.
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 ?
(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
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
Pages: 1 2 3