1

I'm trying to create a window that can do multiple things e.g open a calculator, etc. I'm using Pygame to create the original window. The calculator is made with Tkinter and is fully functional. After a certain event:

      t1 = Thread(target=i['function']())
      t1.start()

this happens creating the calculator and the calculator works perfectly. However, the Pygame window won't take any input and won't allow me to open another calculator or even close the window. I would like to know if/how it's possible to make this work. Any help would be greatly appreciated.

6
  • please provide code! Commented Jun 25, 2021 at 23:12
  • @youssefjallouli What code should I provide, I would be happy to provide anything. Commented Jun 25, 2021 at 23:12
  • 1
    You're not actually using a thread here. target=i['function']() immediately calls i['function']() and then sets the return value as the target. Commented Jun 25, 2021 at 23:20
  • @BryanOakley Then how should I do it? Commented Jun 25, 2021 at 23:20
  • Remove the (), assuming i['function'] is actually a function. Commented Jun 25, 2021 at 23:24

1 Answer 1

1

Thanks to Bryan Oakley for helping me with this but I wasn't actually creating threads I was just calling the function I had to write it like this:

t1 = Thread(target=i['function'])
t1.start()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.