python程序运行4种方法

(1)  python script_name.py

最简单的运行方式,完毕后返回终端

(2)   python -i script_name.py 

运行完毕后保持interpreter仍然开启

(3)   execfile('script_name.py')

(4)   import script_name

不需要.py,将script_name看成是模块

原文地址:https://www.cnblogs.com/tmmuyb/p/4171022.html