美文网首页
Run a Python script

Run a Python script

作者: 成江 | 来源:发表于2018-01-08 07:51 被阅读11次

如果需要类似 shell 脚步一样执行 Python 脚本,如:./hello.py
需要在文件头部指定解释器,如下:

#! /usr/bin/env python

print("Hello world!")

PS: 执行前,需要给予 hello.py 执行权限,chmod 755 hello.py

相关文章

网友评论

      本文标题:Run a Python script

      本文链接:https://www.haomeiwen.com/subject/jjyvnxtx.html