Python学习第一课(2) 第一个python程序
2013-03-18 23:20
429 查看
1.hello world 程序(直接在控制台打印字符串“hello world”)
#python
>>> print 'hello world'
>>>hello world (输出)
2.编辑一个python脚本文件(加入存放到/home目录)
#cd /home
#vi hello.py
#python hello.py
输出为 hello world! This is Python!
若要执行该脚本 则需要首先更改其权限
#chmod 755 hello.py
#./hello.py
#python
>>> print 'hello world'
>>>hello world (输出)
2.编辑一个python脚本文件(加入存放到/home目录)
#cd /home
#vi hello.py
#!/usr/bin/python print 'hello world! This is Python!':wq保存退出后 编译运行
#python hello.py
输出为 hello world! This is Python!
若要执行该脚本 则需要首先更改其权限
#chmod 755 hello.py
#./hello.py
相关文章推荐
- python学习(2)———第一个python程序
- Dive in Python学习笔记二:第一个Python程序
- python语言学习3 ——第一个python程序
- Python学习第1节(win7编译环境搭建和第一个程序)
- Python学习一:万年不变的第一个程序Hello World!
- Python Web 开发学习 - 第一个Python程序
- python学习笔记6(第一个python程序)
- Python学习第一个程序:python第一个程序hello.py提示出现File "<stdin>",line 1错误
- python学习:第一个程序猜数字小游戏~包含次数限制、用户输入类型限制。内容学习源于【小甲鱼python入门学习】
- 【python学习笔记】第一个python程序
- python学习笔记一:python的配置和第一个程序
- 002 Django学习之第一个Django程序(Python2.7)
- 第一个python程序--学习笔记
- 深入python3学习-我的第一个python程序
- 开始学习python了,第一个程序是一个逆波兰式的表达式分析器
- Python与selenium环境安装以及第一个python和selenium程序,可作为入门第一课
- Python学习笔记(1)-Python介绍、解释器、第一个python程序、注释
- OpenGL入门学习——第一课 编写第一个OpenGL程序
- 廖雪峰官方网站python学习笔记:第一个Pyhon程序
- 【Python】学习笔记——-5、第一个Python程序