Browse Source

Pathlib

pull/27/head
Jure Šorn 6 years ago
parent
commit
26d28ad475
1 changed files with 2 additions and 7 deletions
  1. 9
      README.md

9
README.md

@ -1006,11 +1006,7 @@ from os import path, listdir
['1.gif', 'card.gif'] ['1.gif', 'card.gif']
``` ```
### Pathlib
Pathlib
-------
**This module offers classes representing filesystem paths with semantics appropriate for different operating systems.**
```python ```python
from pathlib import Path from pathlib import Path
cwd = Path() cwd = Path()
@ -1042,7 +1038,6 @@ cwd = Path()
Command Line Arguments Command Line Arguments
---------------------- ----------------------
### Basic
```python ```python
import sys import sys
script_name = sys.argv[0] script_name = sys.argv[0]
@ -1072,7 +1067,7 @@ import os
<str> = os.popen(<command>).read() <str> = os.popen(<command>).read()
``` ```
#### Or: ### Subprocess
```python ```python
>>> import subprocess >>> import subprocess
>>> a = subprocess.run(['ls', '-a'], stdout=subprocess.PIPE) >>> a = subprocess.run(['ls', '-a'], stdout=subprocess.PIPE)

|||||||
100:0
Loading…
Cancel
Save