[root@qiansw tmp]# cat test.py #這是1個python示例程序
1
2
3
|
#!/usr/bin/python for i in range ( 0 , 5 ): print i |
[root@qiansw tmp]# ll
total 48
-rw-r--r-- 1 root root 48 Oct 30 11:04 test.py
[root@qiansw tmp]# chmod +x test.py #為腳本增加履行權限
[root@qiansw tmp]# ./test.py #這是第1種方法
0
1
2
3
4
[root@qiansw tmp]# python test.py #這是第2種方法,不用增加履行權限
0
1
2
3
4