I'm using Python 3, and I had a problem.
I made a test project, but it doesn't work.
Here's my code:
import pygame, sys, os
from pygame.locals import *
from tkinter import *
class A(object):
def Start(self):
self.root = Tk()
self.btn1 = Button(self.root, text = '1', command = self.one())
self.btn1.grid(row = 0, column = 0)
self.btn2 = Button(self.root, text = '2', command = self.two())
self.btn2.grid(row = 0, column = 1)
self.root.mainloop()
def one(self):
pygame.quit()
def two(self):
sys.exit()
while True:
a = A()
a.Start()
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
What's the problem?