From a9b6ec00e7db7c3aceede8ec838a6c7bbebcea9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 25 Dec 2022 13:18:06 +0100 Subject: [PATCH] Paths --- README.md | 8 ++++---- index.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fa1f46e..4b35563 100644 --- a/README.md +++ b/README.md @@ -1636,7 +1636,7 @@ from glob import glob ``` ```python - = listdir(path='.') # Returns filenames located at path. + = listdir(path='.') # Returns filenames located at the path. = glob('') # Returns paths matching the wildcard pattern. ``` @@ -1648,15 +1648,15 @@ from glob import glob ```python = os.stat() # Or: .stat() - = .st_mtime/st_size/… # Modification time, size in bytes, … + = .st_mtime/st_size/… # Modification time, size in bytes, ... ``` ### DirEntry **Unlike listdir(), scandir() returns DirEntry objects that cache isfile, isdir and on Windows also stat information, thus significantly increasing the performance of code that requires it.** ```python - = scandir(path='.') # Returns DirEntry objects located at path. - = .path # Returns whole path as a string. + = scandir(path='.') # Returns DirEntry objects located at the path. + = .path # Returns the whole path as a string. = .name # Returns final component as a string. = open() # Opens the file and returns a file object. ``` diff --git a/index.html b/index.html index 7ef1d34..e77589b 100644 --- a/index.html +++ b/index.html @@ -1392,7 +1392,7 @@ value = args.<name> <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> = listdir(path='.')          # Returns filenames located at the path.
 <list> = glob('<pattern>')          # Returns paths matching the wildcard pattern.
 
<bool> = path.exists(<path>)        # Or: <Path>.exists()
@@ -1400,10 +1400,10 @@ value = args.<name>
 <bool> = path.isdir(<path>)         # Or: <DirEntry/Path>.is_dir()
 
<stat> = os.stat(<path>)            # Or: <DirEntry/Path>.stat()
-<real> = <stat>.st_mtime/st_size/…  # Modification time, size in bytes, …
+<real> = <stat>.st_mtime/st_size/…  # Modification time, size in bytes, ...
 
-

DirEntry

Unlike listdir(), scandir() returns DirEntry objects that cache isfile, isdir and on Windows also stat information, thus significantly increasing the performance of code that requires it.

<iter> = scandir(path='.')          # Returns DirEntry objects located at path.
-<str>  = <DirEntry>.path            # Returns whole path as a string.
+

DirEntry

Unlike listdir(), scandir() returns DirEntry objects that cache isfile, isdir and on Windows also stat information, thus significantly increasing the performance of code that requires it.

<iter> = scandir(path='.')          # Returns DirEntry objects located at the path.
+<str>  = <DirEntry>.path            # Returns the whole path as a string.
 <str>  = <DirEntry>.name            # Returns final component as a string.
 <file> = open(<DirEntry>)           # Opens the file and returns a file object.