将它们用作模块并将其导入包含main的脚本中。
import one
import two
import three
if __name__ == '__main__':
one.foo()
two.bar()
three.baz()
使用单个main执行多个python文件
将它们用作模块并将其导入包含main的脚本中。
import one
import two
import three
if __name__ == '__main__':
one.foo()
two.bar()
three.baz()