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
15901590```
15911591
15921592``` python
1593- < str > = getcwd() # Returns current working directory.
1593+ < str > = getcwd() # Returns the current working directory.
15941594< str > = path.join(< path> , ... ) # Joins two or more pathname components.
15951595< str > = path.abspath(< path> ) # Returns absolute path.
15961596```
@@ -1664,15 +1664,15 @@ from pathlib import Path
16641664OS Commands
16651665-----------
16661666### Files and Directories
1667- * ** Paths can be either strings, Paths, or DirEntry objects.**
1667+ * ** Paths can be either strings, Paths or DirEntry objects.**
16681668* ** Functions report OS related errors by raising either OSError or one of its [ subclasses] ( #exceptions-1 ) .**
16691669
16701670``` python
16711671import os, shutil
16721672```
16731673
16741674``` python
1675- os.chdir(< path> ) # Changes current working directory.
1675+ os.chdir(< path> ) # Changes the current working directory.
16761676os.mkdir(< path> , mode = 0o 777 ) # Creates a directory. Mode is in octal.
16771677```
16781678
Original file line number Diff line number Diff line change 14701470< span class ="hljs-keyword "> from</ span > glob < span class ="hljs-keyword "> import</ span > glob
14711471</ code > </ pre > </ div >
14721472
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 >
14741474<str> = path.join(<path>, ...) < span class ="hljs-comment "> # Joins two or more pathname components.</ span >
14751475<str> = path.abspath(<path>) < span class ="hljs-comment "> # Returns absolute path.</ span >
14761476</ code > </ pre >
15171517<file> = open(<Path>) < span class ="hljs-comment "> # Opens the file and returns file object.</ span >
15181518</ code > </ pre >
15191519< 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 >
15211521< li > < strong > Functions report OS related errors by raising either OSError or one of its < a href ="#exceptions-1 "> subclasses</ a > .</ strong > </ li >
15221522</ ul > < pre > < code class ="python language-python hljs "> < span class ="hljs-keyword "> import</ span > os, shutil
15231523</ code > </ pre > </ div > </ div >
15241524
15251525
15261526
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 >
15281528os.mkdir(<path>, mode=< span class ="hljs-number "> 0o777</ span > ) < span class ="hljs-comment "> # Creates a directory. Mode is in octal.</ span >
15291529</ code > </ pre >
15301530< 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