Linux下如何执行python文件,如何在终端打开关闭Python

Linux下如何执行python文件

方法一:
文件第一行包含#!/usr/bin/python2.7,在终端直接使用./hello.py执行即可,如果执行不了,可以试试chmod +x hello.py
(表示增加权限)
方法二:
直接使用python hello.py执行。
[1]python 脚本在linux环境下运行 - 梨璐2012 - 博客园 https://www.cnblogs.com/luying--lulu/p/5283806.html
[2]linux 权限 chmod u+x - 卓力的博客 - CSDN博客 https://blog.csdn.net/zengsange/article/details/77447409

如何在终端打开关闭Python

打开:python
关闭:exit()
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43981221/article/details/88707013
今日推荐