diff --git a/README.md b/README.md index 73cb8a2..bcc7603 100644 --- a/README.md +++ b/README.md @@ -658,7 +658,7 @@ from dateutil.tz import UTC, tzlocal, gettz, datetime_exists, resolve_imaginary = - # Returns the difference, ignoring time jumps. = - # Ignores time jumps if they share tzinfo object. = * # Also: = abs() and = ±% . - = / # How many weeks/years there are in TD. Also '//'. + = / # How many weeks/years there are in TD. Also //. ``` @@ -1637,6 +1637,11 @@ from glob import glob = path.isdir() # Or: .is_dir() ``` +```python + = os.stat() # Or: .stat() + = .st_mtime/st_size/… # Modification time, size in bytes, … +``` + ### DirEntry **Using scandir() instead of listdir() can significantly increase the performance of code that also needs file type information.** @@ -1803,6 +1808,7 @@ import csv = next() # Returns next row as a list of strings. = list() # Returns a list of remaining rows. ``` +* **For XML and binary Excel files (xlsx, xlsm and xlsb) use [Pandas](#dataframe-plot-encode-decode) library.** * **File must be opened with a `'newline=""'` argument, or newlines embedded inside quoted fields will not be interpreted correctly!** ### Write diff --git a/index.html b/index.html index 26ffda6..1eb7ca1 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -585,7 +585,7 @@ to_exclusive = <range>.stop <TD> = <D/DTn> - <D/DTn> # Returns the difference, ignoring time jumps. <TD> = <DTa> - <DTa> # Ignores time jumps if they share tzinfo object. <TD> = <TD> * <real> # Also: <TD> = abs(<TD>) and <TD> = <TD> ±% <TD>. -<float> = <TD> / <TD> # How many weeks/years there are in TD. Also '//'. +<float> = <TD> / <TD> # How many weeks/years there are in TD. Also //.

#Arguments

Inside Function Call

<function>(<positional_args>)                  # f(0, 0)
@@ -1392,6 +1392,9 @@ value = args.<name>
 <bool> = path.isfile(<path>)        # Or: <DirEntry/Path>.is_file()
 <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, …
+

DirEntry

Using scandir() instead of listdir() can significantly increase the performance of code that also needs file type information.

<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.
@@ -1503,6 +1506,7 @@ CompletedProcess(args=['bc', Pandas library.
 
  • File must be opened with a 'newline=""' argument, or newlines embedded inside quoted fields will not be interpreted correctly!
  • Write

    <writer> = csv.writer(<file>)       # Also: `dialect='excel', delimiter=','`.
    @@ -1879,7 +1883,7 @@ ValueError: malformed node or string
     
  • Coroutine definition starts with 'async' and its call with 'await'.
  • 'asyncio.run(<coroutine>)' is the main entry point for asynchronous programs.
  • Functions wait(), gather() and as_completed() can be used when multiple coroutines need to be started at the same time.
  • -
  • Asyncio module also provides its own Queue, Event, Lock and Semaphore classes.
  • +
  • Asyncio module also provides its own Queue, Event, Lock and Semaphore classes.
  • Runs a terminal game where you control an asterisk that must avoid numbers:

    import asyncio, collections, curses, curses.textpad, enum, random
     
     P = collections.namedtuple('P', 'x y')         # Position
    @@ -2887,7 +2891,7 @@ $ pyinstaller script.py --add-data '<path>:.'  
      
     
       
     
    diff --git a/parse.js b/parse.js
    index f182b9e..16a1fbe 100755
    --- a/parse.js
    +++ b/parse.js
    @@ -461,6 +461,8 @@ function main() {
     function getMd() {
       var readme = readFile('README.md');
       var readme = readme.replace("#semaphore-event-barrier", "#semaphoreeventbarrier");
    +  var readme = readme.replace("#semaphore-event-barrier", "#semaphoreeventbarrier");
    +  var readme = readme.replace("#dataframe-plot-encode-decode", "#dataframeplotencodedecode");
       const converter = new showdown.Converter();
       return converter.makeHtml(readme);
     }