<div><h4id="createsaloggerthatwritesallmessagestoafileandsendsthemtotherootloggerthatprintstostdout">Creates a logger that writes all messages to a file and sends them to the root logger that prints to stdout:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>logging.basicConfig(level=<spanclass="hljs-string">'WARNING'</span>)
<div><h4id="createsaloggerthatwritesallmessagestoafileandsendsthemtotherootloggerthatprintstostdout">Creates a logger that writes all messages to a file and sends them to the root logger that prints to stdout:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>logging.basicConfig(level=<spanclass="hljs-string">'WARNING'</span>)
<spanclass="hljs-number">2023</span><spanclass="hljs-number">-02</span><spanclass="hljs-number">-07</span><spanclass="hljs-number">23</span>:<spanclass="hljs-number">21</span>:<spanclass="hljs-number">01</span>,<spanclass="hljs-number">430</span> - CRITICAL:my_module:Running out of disk space.
2023-02-07 23:21:01,430 CRITICAL:my_module:Running out of disk space.
</code></pre></div>
</code></pre></div>
<div><h2id="scraping"><ahref="#scraping"name="scraping">#</a>Scraping</h2><div><h4id="scrapespythonsurlversionnumberandlogofromitswikipediapage">Scrapes Python's URL, version number and logo from its Wikipedia page:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-comment"># $ pip3 install requests beautifulsoup4</span>
<div><h2id="scraping"><ahref="#scraping"name="scraping">#</a>Scraping</h2><div><h4id="scrapespythonsurlversionnumberandlogofromitswikipediapage">Scrapes Python's URL, version number and logo from its Wikipedia page:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-comment"># $ pip3 install requests beautifulsoup4</span>