Atom + tkinter + canvas /beginner question/


#1

Hi there.
I am a student, who is learning python. I am currently using IDLE where i am using mostly this code :
import tkinter
canvas = tkinter.Canvas()
canvas.pack()

and from there i am creating lines , rectangles whatever. I downloaded atom just because i heard it’s good for coding python. But when i started my code with Atom Runner package, there doesnt appear any window with the thing i created like in IDLE on image here: https://prnt.sc/fdy85w

Again sorry for maybe very stupid question, but I’m new to this.


#2

I’m not sure why the window doesn’t appear with Atom Runner. Does it appear when you run the script from the command prompt with python "3x rectangle.py"?


#3

Ehm I guess im doing something bad here :smiley: it says cant open the file : no such file or directory


#4

You need to navigate to the directory where the file is before you use that command. Or you can invoke it with the full path, "C:\Users\Simon\Desktop\Python\saves\3x rectangles.py". You need the quotes because of the space.


#5

I still need to open it with IDLE to see what it does … so I guess I’ll stick with IDLE for now … maybe in future i will start using something different :slight_smile: Thank you for your time sir!


#6

So you’ve executed the script from the command line and it doesn’t open the tkinter window?


#7

No it doesn’t. Should it ?


#8

I don’t know. But since it doesn’t, that explains why an Atom package wasn’t sufficient.