From 9af8d0b2cba76f7c5dc427d6c0f8074aa111e0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 27 Feb 2022 07:29:42 +0100 Subject: [PATCH] Paths --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3f4d7b2..33873a2 100644 --- a/README.md +++ b/README.md @@ -1645,7 +1645,7 @@ from os import scandir = scandir(path='.') # Returns DirEntry objects located at path. = .path # Returns whole path as a string. = .name # Returns final component as a string. - = open() # Opens the file and returns file object. + = open() # Opens the file and returns a file object. ``` ### Path Object @@ -1680,7 +1680,7 @@ from pathlib import Path ```python = str() # Returns path as a string. - = open() # Opens the file and returns file object. + = open() # Opens the file and returns a file object. ``` diff --git a/index.html b/index.html index 1987bb7..a1fb8f9 100644 --- a/index.html +++ b/index.html @@ -1394,7 +1394,7 @@ value = args.<name>
<iter> = scandir(path='.')          # Returns DirEntry objects located at path.
 <str>  = <DirEntry>.path            # Returns whole path as a string.
 <str>  = <DirEntry>.name            # Returns final component as a string.
-<file> = open(<DirEntry>)           # Opens the file and returns file object.
+<file> = open(<DirEntry>)           # Opens the file and returns a file object.
 

Path Object

from pathlib import Path
 
@@ -1417,7 +1417,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 file object.
+<file> = open(<Path>)               # Opens the file and returns a file object.
 

#OS Commands

Files and Directories

  • Paths can be either strings, Paths or DirEntry objects.