When i run basic code in the native python editor, the canvas stays open.
When i do the same python code using visual studio code (press F5 to run), the application runs, but then instantly closes and reverts back to the editor.
Here is an example of code:
import sys
from tkinter import *
def mHello():
mtext = ment.get()
mlabel2 = Label(mGui, text = mtext).pack()
for i in range(0, 10):
Label(mGui, text = "hello " + str(i+1)).pack()
mGui = Tk()
ment = StringVar()
mGui.geometry('450x450+500+300')
mGui.title("my test thing")
mlabel = Label(mGui, text = "press to okay button to run the code").pack()
mbutton = Button(mGui, text = "ok", command = mHello, fg = "white", bg = "blue").pack()
mEntry = Entry(mGui, textvariable = ment).pack()
How can i get VS code to behave the same as the native editor please ?