Python Forum

Full Version: How do i run the code?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hello,
first, i'm total newbie in programming. Started yesterday. I have trouble to understand how to open the coded python files. I have Tkinter import (with GUI) but when i try to open that .py file it opens cmd and then immediately closes. I know that i don't have any errors because I tried the same code in IDLE and everything worked perfectly. (I'm using Visual studio code program by the way).
Hope You understand
thanks!
python filename.py
for more info here
https://python-forum.io/Thread-Basic-How...ython-code
Sorry but i didn't understand that well
Please show your code with tkinter.
It's hard to help without seeing what you are trying to do.
tkinter requires a minimum amount of code, like:
import tkinter as tk

root = tk.Tk()
root.title('My first app')
root.mainloop()