导入的变量不会覆盖现有变量

我正在尝试使程序重复多次。为此,我需要覆盖一些导入的变量,因为它们在程序过程中会被更改。

The code in main.py:

while True:
    ...
    from vars import field, game, screen, ai
    ...

In vars.py the variables field, game, screen and ai get defined. The first time the program runs it works fine, however the next time the variables don't change and the program breaks. How do I fix this?

评论