<real> = <stat>.st_mtime/st_size/… <spanclass="hljs-comment"># Modification time, size in bytes, …</span>
</code></pre>
<div><h3id="direntry">DirEntry</h3><p><strong>Using scandir() instead of listdir() can significantly increase the performance of code that also needs file type information.</strong></p><pre><codeclass="python language-python hljs"><iter> = scandir(path=<spanclass="hljs-string">'.'</span>) <spanclass="hljs-comment"># Returns DirEntry objects located at path.</span>
<str> = <DirEntry>.path <spanclass="hljs-comment"># Returns whole path as a string.</span>
<str> = <DirEntry>.name <spanclass="hljs-comment"># Returns final component as a string.</span>
<li><strong>For XML and binary Excel files (xlsx, xlsm and xlsb) use <ahref="#dataframeplotencodedecode">Pandas</a> library.</strong></li>
<li><strong>File must be opened with a <codeclass="python hljs"><spanclass="hljs-string">'newline=""'</span></code> argument, or newlines embedded inside quoted fields will not be interpreted correctly!</strong></li>
@ -1879,7 +1883,7 @@ ValueError: malformed node or string
<li><strong>Coroutine definition starts with <codeclass="python hljs"><spanclass="hljs-string">'async'</span></code> and its call with <codeclass="python hljs"><spanclass="hljs-string">'await'</span></code>.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'asyncio.run(<coroutine>)'</span></code> is the main entry point for asynchronous programs.</strong></li>
<li><strong>Functions wait(), gather() and as_completed() can be used when multiple coroutines need to be started at the same time.</strong></li>
<li><strong>Asyncio module also provides its own <ahref="#queue">Queue</a>, <ahref="#semaphoreeventbarrier">Event</a>, <ahref="#lock">Lock</a> and <ahref="#semaphore-event-barrier">Semaphore</a> classes.</strong></li>
<li><strong>Asyncio module also provides its own <ahref="#queue">Queue</a>, <ahref="#semaphoreeventbarrier">Event</a>, <ahref="#lock">Lock</a> and <ahref="#semaphoreeventbarrier">Semaphore</a> classes.</strong></li>
</ul><div><h4id="runsaterminalgamewhereyoucontrolanasteriskthatmustavoidnumbers">Runs a terminal game where you control an asterisk that must avoid numbers:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> asyncio, collections, curses, curses.textpad, enum, random
P = collections.namedtuple(<spanclass="hljs-string">'P'</span>, <spanclass="hljs-string">'x y'</span>) <spanclass="hljs-comment"># Position</span>