如出现在前两行,是为可执行文件标识interperter用的,为posix系统中的执行标准。
如出现在后面,则是简单的注释,#后的内容不予执行。
#!内容为shebang,直接在shell中运行该程序,默认是调用python的所在路径。
参考问题,来源知乎:https://www.zhihu.com/question/24383457?sort=created
代码如下:
#a comment,this is so you can read program later
#anything after the # is ignored by python
print "I could have code like this."#and the comment after is ignored
# you can also use a comment to "disable" or comment out a piece of code:
#print "this won't run."
print "This will run"