python基础之使用os.system来执行系统命令
来源:互联网 发布:淘宝网短袖男装 编辑:程序博客网 时间:2024/06/01 10:37
在工作中经常会需要确定使用的py的版本信息,以便适配更多的系统,达到更大的兼容性。
一般关于python的信息和参数都要调用sys模块,关于操作系统的信息和调用都要使用os模块
所以这次我们使用sys模块
import sys
sys.version #获取python版本等信息
PS:dir(sys)可获取sys所有接口
第二种方法是在linux命令行下键入:python,然后就会进入python,并显示相关信息,结果如图:
看到了吧,上面显示了:python版本:2.7.2
操作系统版本:red hat 4.1.2
当然你也可以在这里面键入上述命令,如图:
第二种方法是在linux命令行下键入:python,然后就会进入python,并显示相关信息,结果如图:
看到了吧,上面显示了:python版本:2.7.2
操作系统版本:red hat 4.1.2
当然你也可以在这里面键入上述命令,如图:
原文链接: http://www.pythontab.com/html/2012/pythonjichu_1220/6.html
0 0
- python基础之使用os.system来执行系统命令
- python基础之使用os.system来执行系统命令
- os.system(),subprocess.popen()和commands来执行系统命令
- python执行系统命令的方法os.system()
- python使用os.system执行Linux shell命令
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- python执行系统命令的方法:os.system(), os.popen(), subprocess.Popen()
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Python执行系统命令的方法 os.system(),os.popen(),commands
- Increasing Triplet Subsequence
- 3
- Android学习之 关于内部Handler类引起内存泄露
- iOS 常用的#define合集
- opencv学习(2)滑动条的创建和使用
- python基础之使用os.system来执行系统命令
- android6.0源码分析之Camera2 HAL分析
- ubuntu下编译ffmpeg
- 自己动手写PHP MVC框架
- redis可用性提升(哨兵sentinel)配置示例
- AFNetworking 使用说明
- LeetCode 7 Reverse Integer
- 作业让我批改,尼玛很久没玩mysql了,蛋疼
- 缘