I am using pygame to make an easy game and just want to import tkinter for pop-up window.
Here’s my code:
import tkinter as tk
from tkinter import messagebox
def message_box(subject, content):
root = tk.Tk()
root.withdraw()
messagebox.showinfo(subject, content)
And in the game loop:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_n:
message_box('Stone', 'Return')
When I run the game, it shows:
By the way, I am using pycharm.
If I delete the lines mentioned tk, it works properly.
I’ve tried to solved this problem with ActivateTcl:
Well, I downloaded but nothing happened. How can I fix this? Should I uninstall ActivateTcl?
4