From 23c6c4143268c5edc0180fc84062be0c9723d3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 19 Jul 2019 18:24:40 +0200 Subject: [PATCH] Command execution --- README.md | 24 ++++++++++++------------ index.html | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d7fbc89..a81a15c 100644 --- a/README.md +++ b/README.md @@ -1597,31 +1597,31 @@ Command Execution ```python import os -os.chdir() # Changes the current working directory. - = os.getcwd() # Returns current working directory. + = os.getcwd() # Returns the current working directory. +os.chdir() # Changes the current working directory. ``` ```python -os.remove() # Deletes the file. -os.rmdir() # Deletes empty directory. -shutil.rmtree() # Deletes an entire directory tree. +os.remove() # Deletes the file. +os.rmdir() # Deletes empty directory. +shutil.rmtree() # Deletes the entire directory tree. ``` ```python -os.rename(from, to) # Renames the file or directory. -os.replace(from, to) # Same, but overwrites 'to' if it exists. +os.rename(from, to) # Renames the file or directory. +os.replace(from, to) # Same, but overwrites 'to' if it exists. ``` ```python -os.mkdir(, mode=0o777) # Creates a directory. - = os.scandir(path='.') # Returns os.DirEntry objects located at path. +os.mkdir(, mode=0o777) # Creates a directory. + = os.scandir(path='.') # Returns os.DirEntry objects located at path. ``` #### DirEntry: ```python - = .name # Final component of the path. - = .path # Path with final component. - = Path() # Path object. + = .name # Final component of the path. + = .path # Path with final component. + = Path() # Path object. ``` ```python diff --git a/index.html b/index.html index bea28aa..8798eb9 100644 --- a/index.html +++ b/index.html @@ -1437,23 +1437,23 @@ value = args.<name>
  • All exceptions are either 'OSError' or its subclasses.
  • import os
    -os.chdir(<path>)                  # Changes the current working directory.
    -<str> = os.getcwd()               # Returns current working directory.
    +<str> = os.getcwd()                # Returns the current working directory.
    +os.chdir(<path>)                   # Changes the current working directory.
     
    -
    os.remove(<path>)                 # Deletes the file.
    -os.rmdir(<path>)                  # Deletes empty directory.
    -shutil.rmtree(<path>)             # Deletes an entire directory tree.
    +
    os.remove(<path>)                  # Deletes the file.
    +os.rmdir(<path>)                   # Deletes empty directory.
    +shutil.rmtree(<path>)              # Deletes the entire directory tree.
     
    -
    os.rename(from, to)               # Renames the file or directory.
    -os.replace(from, to)              # Same, but overwrites 'to' if it exists.
    +
    os.rename(from, to)                # Renames the file or directory.
    +os.replace(from, to)               # Same, but overwrites 'to' if it exists.
     
    -
    os.mkdir(<path>, mode=0o777)      # Creates a directory.
    -<iter> = os.scandir(path='.')     # Returns os.DirEntry objects located at path.
    +
    os.mkdir(<path>, mode=0o777)       # Creates a directory.
    +<iter> = os.scandir(path='.')      # Returns os.DirEntry objects located at path.
     

    DirEntry:

    -
    <str>  = <DirEntry>.name          # Final component of the path.
    -<str>  = <DirEntry>.path          # Path with final component.
    -<Path> = Path(<DirEntry>)         # Path object.
    +
    <str>  = <DirEntry>.name           # Final component of the path.
    +<str>  = <DirEntry>.path           # Path with final component.
    +<Path> = Path(<DirEntry>)          # Path object.
     
    <bool> = <DirEntry>.is_file()
     <bool> = <DirEntry>.is_dir()