File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1590,7 +1590,7 @@ from glob import glob
1590
1590
```
1591
1591
1592
1592
``` python
1593
- < str > = getcwd() # Returns current working directory.
1593
+ < str > = getcwd() # Returns the current working directory.
1594
1594
< str > = path.join(< path> , ... ) # Joins two or more pathname components.
1595
1595
< str > = path.abspath(< path> ) # Returns absolute path.
1596
1596
```
@@ -1664,15 +1664,15 @@ from pathlib import Path
1664
1664
OS Commands
1665
1665
-----------
1666
1666
### Files and Directories
1667
- * ** Paths can be either strings, Paths, or DirEntry objects.**
1667
+ * ** Paths can be either strings, Paths or DirEntry objects.**
1668
1668
* ** Functions report OS related errors by raising either OSError or one of its [ subclasses] ( #exceptions-1 ) .**
1669
1669
1670
1670
``` python
1671
1671
import os, shutil
1672
1672
```
1673
1673
1674
1674
``` python
1675
- os.chdir(< path> ) # Changes current working directory.
1675
+ os.chdir(< path> ) # Changes the current working directory.
1676
1676
os.mkdir(< path> , mode = 0o 777 ) # Creates a directory. Mode is in octal.
1677
1677
```
1678
1678
Original file line number Diff line number Diff line change 1470
1470
< span class ="hljs-keyword "> from</ span > glob < span class ="hljs-keyword "> import</ span > glob
1471
1471
</ code > </ pre > </ div >
1472
1472
1473
- < pre > < code class ="python language-python hljs "> <str> = getcwd() < span class ="hljs-comment "> # Returns current working directory.</ span >
1473
+ < pre > < code class ="python language-python hljs "> <str> = getcwd() < span class ="hljs-comment "> # Returns the current working directory.</ span >
1474
1474
<str> = path.join(<path>, ...) < span class ="hljs-comment "> # Joins two or more pathname components.</ span >
1475
1475
<str> = path.abspath(<path>) < span class ="hljs-comment "> # Returns absolute path.</ span >
1476
1476
</ code > </ pre >
1517
1517
<file> = open(<Path>) < span class ="hljs-comment "> # Opens the file and returns file object.</ span >
1518
1518
</ code > </ pre >
1519
1519
< div > < h2 id ="oscommands "> < a href ="#oscommands " name ="oscommands "> #</ a > OS Commands</ h2 > < div > < h3 id ="filesanddirectories "> Files and Directories</ h3 > < ul >
1520
- < li > < strong > Paths can be either strings, Paths, or DirEntry objects.</ strong > </ li >
1520
+ < li > < strong > Paths can be either strings, Paths or DirEntry objects.</ strong > </ li >
1521
1521
< li > < strong > Functions report OS related errors by raising either OSError or one of its < a href ="#exceptions-1 "> subclasses</ a > .</ strong > </ li >
1522
1522
</ ul > < pre > < code class ="python language-python hljs "> < span class ="hljs-keyword "> import</ span > os, shutil
1523
1523
</ code > </ pre > </ div > </ div >
1524
1524
1525
1525
1526
1526
1527
- < pre > < code class ="python language-python hljs "> os.chdir(<path>) < span class ="hljs-comment "> # Changes current working directory.</ span >
1527
+ < pre > < code class ="python language-python hljs "> os.chdir(<path>) < span class ="hljs-comment "> # Changes the current working directory.</ span >
1528
1528
os.mkdir(<path>, mode=< span class ="hljs-number "> 0o777</ span > ) < span class ="hljs-comment "> # Creates a directory. Mode is in octal.</ span >
1529
1529
</ code > </ pre >
1530
1530
< pre > < code class ="python language-python hljs "> shutil.copy(from, to) < span class ="hljs-comment "> # Copies the file. 'to' can be a directory.</ span >
You can’t perform that action at this time.
0 commit comments