python运行一个.py文件

  1. 编写文件cal.py
print(100+200+300)

执行:
D:\File\python>python cal.py
600
这边需要注意,需要进入到.py文件的目录下。

  1. 在看一个helloworld.py
print('hello world')

执行:
D:\File\python>python helloworld.py
hello world

  1. 如果要编写python的相关代码可以采用:
    Notepad++,免费使用,中英文界面都有。

猜你喜欢

转载自blog.csdn.net/haidao1101/article/details/84952675