Pass variable between python scripts

前端 未结 5 1133
北恋
北恋 2020-12-02 18:37

I\'m sure this is very simple but I\'ve been unable to get it working correctly. I need to have my main python script call another python script and pass variables from the

5条回答
  •  盖世英雄少女心
    2020-12-02 19:31

    To avoid namespace pollution, import the variables you want individually: from __main__ import x, and so on. Otherwise you'll end up with naming conflicts you weren't aware of.

提交回复
热议问题