From d6eb83685c3de06000c0b3945da224545a96099f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 22 Jul 2019 21:25:20 +0200 Subject: [PATCH] Path --- README.md | 5 +++++ index.html | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cb3cc9..f60ecff 100644 --- a/README.md +++ b/README.md @@ -1586,6 +1586,7 @@ cwd = Path() ```python = .resolve() # Returns absolute path without symlinks. = .parent # Returns path without final component. + = open() # Opens a file and returns file object. ``` @@ -1626,7 +1627,11 @@ os.mkdir(, mode=0o777) # Creates a directory. ```python = .path # Path as a string. = .name # Final component. +``` + +```python = Path() # Path object. + = open() # File object. ``` ### Shell Commands diff --git a/index.html b/index.html index 3884908..dce5113 100644 --- a/index.html +++ b/index.html @@ -1441,6 +1441,7 @@ value = args.<name>
<Path> = <Path>.resolve()          # Returns absolute path without symlinks.
 <Path> = <Path>.parent             # Returns path without final component.
+<file> = open(<Path>)              # Opens a file and returns file object.
 

#Command Execution

Files and Directories

  • Paths can be either strings or Path objects.
  • @@ -1468,7 +1469,9 @@ os.replace(from, to) # Same, but overwr
    <str>  = <DirEntry>.path           # Path as a string.
     <str>  = <DirEntry>.name           # Final component.
    -<Path> = Path(<DirEntry>)          # Path object.
    +
    +
    <Path> = Path(<DirEntry>)          # Path object.
    +<file> = open(<DirEntry>)          # File object.
     

    Shell Commands

    import os
     <str> = os.popen('<shell_command>').read()