python学习(一)运行第一个python脚本


当然这里指的是在linux或者unix下,像写bash脚本那样


#!/usr/bin/python

print('The Bright Side ' + 'of Life...')


反正我建议就算一开始也不要用解释器,脚本这个玩具要比解释器那个玩具好太多,解释器敲的命令留不下来。


#! 是一个标识吧,后面接的路径指明了执行脚本的解释器


[tuhooo@localhost python_programming]$ ls
first_scripts.py
[tuhooo@localhost python_programming]$ chmod u+x first_scripts.py
[tuhooo@localhost python_programming]$ ./first_scripts.py
The Bright Side of Life...
原文地址:https://www.cnblogs.com/tuhooo/p/7697621.html