Allenfenqu/script1.py

9 lines
232 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import script2 # 导入脚本2不会执行 script2.py 中的顶层代码
def main():
print("Main function in script1")
if __name__ == '__main__':
print("This code is executed when script1 is run directly.")
main()