You've already forked www.colben.cn
update
This commit is contained in:
@@ -6,7 +6,7 @@ tags: ["python", "shell"]
|
||||
categories: ["python"]
|
||||
---
|
||||
|
||||
# os
|
||||
## os
|
||||
- 阻塞,返回shell执行参数命令的状态,即成功返回0
|
||||
```python
|
||||
os.system('cat /proc/cpuinfo')
|
||||
@@ -16,7 +16,7 @@ categories: ["python"]
|
||||
os.popen('cat /proc/cpuinfo')
|
||||
```
|
||||
|
||||
# commands
|
||||
## commands
|
||||
- 阻塞,返回参数指定的系统文件的详细属性
|
||||
```python
|
||||
commands.getstatus('/proc/cputinfo')
|
||||
@@ -30,7 +30,7 @@ categories: ["python"]
|
||||
commands.getstatusoutput('cat /proc/cpuinfo')
|
||||
```
|
||||
|
||||
# subprocess
|
||||
## subprocess
|
||||
- 阻塞,返回shell状态,禁用 PIPE 参数
|
||||
```python
|
||||
subprocess.call(args, *, stdin=None, stdout=None, stderr=None, shell=False)
|
||||
@@ -44,7 +44,7 @@ categories: ["python"]
|
||||
subprocess.check_output(args, *, stdin=None, stderr=None, shell=False, universal_newlines=False)
|
||||
```
|
||||
|
||||
# Pope
|
||||
## Pope
|
||||
- 不阻塞,返回Popen对象
|
||||
```python
|
||||
subprocess.Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0)
|
||||
|
Reference in New Issue
Block a user