Updates di-yi-ge-python-cheng-xu.md

Auto commit by GitBook Editor
pull/1/head
两点水 2017-06-07 21:05:25 +08:00
parent 39659c7768
commit ef552b17d9
3 changed files with 23 additions and 18 deletions

View File

@ -4,4 +4,5 @@
* [第一个Python程序](di-yi-ge-python-cheng-xu.md) * [第一个Python程序](di-yi-ge-python-cheng-xu.md)
* [一、Python 简介](yi-3001-python-jian-jie.md) * [一、Python 简介](yi-3001-python-jian-jie.md)
* [二、Python 的安装 ](er-3001-python-de-an-zhuang.md) * [二、Python 的安装 ](er-3001-python-de-an-zhuang.md)
* [三、第一个 Python 程序 Hello Python](san-3001-di-yi-ge-python-cheng-xu-hello-python.md)

View File

@ -6,24 +6,6 @@
# 三、第一个 Python 程序 Hello Python #
Python 的代码使用文本编辑器就可以写了,本草根使用 [Sublime Text](http://www.sublimetext.com/),第一个 Python 程序当然是 Hello Python 啦,把这句话打印出来。
注意 print 前面不要有任何空格最后保存下来可以看到Python 保存后是一个以 .py 为后缀的文件。
![HelloPython.png](http://upload-images.jianshu.io/upload_images/2136918-f0ec1b2c06d1ab18.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
最后就可以打开命令行窗口,把当前目录切换到 HelloPython.py 所在目录,就可以运行这个程序了,下面就是运行的结果。
![运行第一个Python程序.png](http://upload-images.jianshu.io/upload_images/2136918-b7eb043853df29bd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
当然,如果你是使用 [Sublime Text](http://www.sublimetext.com/) ,并且在安装 Python 的时候配置好了环境变量,直接按 Ctrl + B 就可以运行了,运行结果如下:
![Sublime运行Python.png](http://upload-images.jianshu.io/upload_images/2136918-a771a2fa1e4c03bd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

View File

@ -0,0 +1,22 @@
# 三、第一个 Python 程序 Hello Python #
Python 的代码使用文本编辑器就可以写了,本草根使用 [Sublime Text](http://www.sublimetext.com/),第一个 Python 程序当然是 Hello Python 啦,把这句话打印出来。
注意 print 前面不要有任何空格最后保存下来可以看到Python 保存后是一个以 .py 为后缀的文件。
![HelloPython.png](http://upload-images.jianshu.io/upload_images/2136918-f0ec1b2c06d1ab18.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
最后就可以打开命令行窗口,把当前目录切换到 HelloPython.py 所在目录,就可以运行这个程序了,下面就是运行的结果。
![运行第一个Python程序.png](http://upload-images.jianshu.io/upload_images/2136918-b7eb043853df29bd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
当然,如果你是使用 [Sublime Text](http://www.sublimetext.com/) ,并且在安装 Python 的时候配置好了环境变量,直接按 Ctrl + B 就可以运行了,运行结果如下:
![Sublime运行Python.png](http://upload-images.jianshu.io/upload_images/2136918-a771a2fa1e4c03bd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)