variables.py進口變量在python的功能
path="c:/something"
path2="c:/somethng2"
path3="c:/something3"
....
main.py
def run():
from variables import *
...
我有這樣的錯誤:
SyntaxError: import * is not allowed in function 'run' because it contains a nested function with free variables
'import variables'比使用'variables.path,variables.path2,....' –