0

I am making a simple snake type game, I'm using the tkinter module to create a login page and a settings page, I'm writing the actual game in another file using pygame, I want to have two shared variables width and height that are the dimensions of the window. To change the login/settings page I'm using radio buttons and the .geometry method to change window size, I'm storing the results in a width and a height variable, but I don't know how to use these variables to set the dimensions of my pygame window in my other file.

I made the function the radiobuttons had as a command to return, width and height and imported it to my other file but it didn't work, other than that I don't know what else to try.

  • 3
    Does this answer your question? [Using global variables between files?](https://stackoverflow.com/questions/13034496/using-global-variables-between-files) – mkrieger1 Feb 05 '23 at 21:21
  • You can put the variables you want to share in a third file and import it – Emrah Diril Feb 05 '23 at 21:28

0 Answers0