Python学习笔记(二)——HelloWorld

一、交互式化环境下书写代码

image

 

二、使用文本编辑器编辑.py文件

1、建议,使用Nodepad++,好看,免费,度娘直接搜素即可。

2、编写代码

image

3、保存为.py结尾的文件

4、使用cmd,打开到文件所在目录(cd),然后运行

image

5、直接运行py文件

    在Windows上是不行的,但是,在Mac和Linux上是可以的,方法是在.py文件的第一行加上一个特殊的注释:

#!/usr/bin/env python3

print('hello, world')
posted @ 2016-12-09 10:54  Blue Mountain  阅读(437)  评论(0编辑  收藏  举报