Python之helloword

运行环境:ubuntu 10.04

编辑文件first_python.py,内容如下:

#! /usr/bin/python
import os
import sys 

str = "Hello, first python"
print str 


命令行中执行

$ python first_python.py

即可看到打印结果

或者将first_python.py的权限修改为可执行,直接按可执行文件执行

$ chmod a+x first_python.py

$ ./first_python.py

也可看到打印结果


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章