diff --git a/README.md b/README.md index 0deef34..335b3e6 100644 --- a/README.md +++ b/README.md @@ -1577,15 +1577,15 @@ from glob import glob ``` ```python - = getcwd() # Returns the current working directory. + = getcwd() # Returns current working directory. = path.join(, ...) # Joins two or more pathname components. - = path.abspath() # Returns an absolute path. + = path.abspath() # Returns absolute path. ``` ```python - = path.basename() # Returns final component. - = path.dirname() # Returns path without final component. - = path.splitext() # Splits on last period of final component. + = path.basename() # Returns final component of the path. + = path.dirname() # Returns path without the final component. + = path.splitext() # Splits on last period of the final component. ``` ```python @@ -1610,7 +1610,7 @@ from os import scandir = scandir(path='.') # Returns DirEntry objects located at path. = .path # Returns path as a string. = .name # Returns final component as a string. - = open() # Opens the file and returns a file object. + = open() # Opens the file and returns file object. ``` ### Path Object @@ -1644,7 +1644,7 @@ from pathlib import Path ```python = str() # Returns path as a string. - = open() # Opens the file and returns a file object. + = open() # Opens the file and returns file object. ``` @@ -1659,7 +1659,7 @@ import os, shutil ``` ```python -os.chdir() # Changes the current working directory. +os.chdir() # Changes current working directory. os.mkdir(, mode=0o777) # Creates a directory. Mode is in octal. ``` diff --git a/index.html b/index.html index 2ed75a4..31c3aa8 100644 --- a/index.html +++ b/index.html @@ -1457,13 +1457,13 @@ value = args.<name> from glob import glob -
<str>  = getcwd()                   # Returns the current working directory.
+
<str>  = getcwd()                   # Returns current working directory.
 <str>  = path.join(<path>, ...)     # Joins two or more pathname components.
-<str>  = path.abspath(<path>)       # Returns an absolute path.
+<str>  = path.abspath(<path>)       # Returns absolute path.
 
-
<str>  = path.basename(<path>)      # Returns final component.
-<str>  = path.dirname(<path>)       # Returns path without final component.
-<tup.> = path.splitext(<path>)      # Splits on last period of final component.
+
<str>  = path.basename(<path>)      # Returns final component of the path.
+<str>  = path.dirname(<path>)       # Returns path without the final component.
+<tup.> = path.splitext(<path>)      # Splits on last period of the final component.
 
<list> = listdir(path='.')          # Returns filenames located at path.
 <list> = glob('<pattern>')          # Returns paths matching the wildcard pattern.
@@ -1479,7 +1479,7 @@ value = args.<name>
 
<iter> = scandir(path='.')          # Returns DirEntry objects located at path.
 <str>  = <DirEntry>.path            # Returns path as a string.
 <str>  = <DirEntry>.name            # Returns final component as a string.
-<file> = open(<DirEntry>)           # Opens the file and returns a file object.
+<file> = open(<DirEntry>)           # Opens the file and returns file object.
 

Path Object

from pathlib import Path
 
@@ -1501,7 +1501,7 @@ value = args.<name> <iter> = <Path>.glob('<pattern>') # Returns Paths matching the wildcard pattern.
<str>  = str(<Path>)                # Returns path as a string.
-<file> = open(<Path>)               # Opens the file and returns a file object.
+<file> = open(<Path>)               # Opens the file and returns file object.
 

#OS Commands

Files and Directories

  • Paths can be either strings, Paths, or DirEntry objects.
  • @@ -1511,7 +1511,7 @@ value = args.<name> -
    os.chdir(<path>)                    # Changes the current working directory.
    +
    os.chdir(<path>)                    # Changes current working directory.
     os.mkdir(<path>, mode=0o777)        # Creates a directory. Mode is in octal.
     
    shutil.copy(from, to)               # Copies the file.