<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Nerdsid.com</title><link>https://nerdsid.com/tags/python/</link><description>Recent content in Python on Nerdsid.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 05 Jun 2023 07:32:28 +0530</lastBuildDate><atom:link href="https://nerdsid.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Managing Multiple Python Installations on Windows</title><link>https://nerdsid.com/posts/managing-multiple-python-installations-on-windows/</link><pubDate>Mon, 05 Jun 2023 07:32:28 +0530</pubDate><guid>https://nerdsid.com/posts/managing-multiple-python-installations-on-windows/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>Managing multiple Python installations on Windows can be a challenging task. With the help of pyenv, it becomes much easier and efficient. In this article, we will explore how to set up and use pyenv to effectively manage multiple Python versions on your Windows system.&lt;/p>
&lt;h2 id="why-have-multiple-python-installations">Why have multiple Python installations?&lt;/h2>
&lt;p>Here is a non-exhaustive list of reasons why you might want to have multiple Python installations on your system:&lt;/p></description></item><item><title>Command to Get a Count of Python Dependencies</title><link>https://nerdsid.com/posts/single-command-to-get-count-of-python-dependencies/</link><pubDate>Sat, 22 Apr 2023 00:00:00 +0530</pubDate><guid>https://nerdsid.com/posts/single-command-to-get-count-of-python-dependencies/</guid><description>&lt;p>From the root of your project run:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">pip freeze --all &lt;span class="p">|&lt;/span> wc -l&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>This will return a number which indicates the total no. of dependencies of your Python project.&lt;/p></description></item><item><title>The Role of __init__.py File in Python</title><link>https://nerdsid.com/posts/the-role-of-the-init-py-file-in-python/</link><pubDate>Fri, 25 Nov 2022 00:00:00 +0530</pubDate><guid>https://nerdsid.com/posts/the-role-of-the-init-py-file-in-python/</guid><description>&lt;p>If you are a Python developer, chances are high that you may have come across the &lt;code>__init__.py&lt;/code> file. It has several roles in a Python project.&lt;/p>
&lt;ol>
&lt;li>To show that a directory is a Python package. This allows importing modules contained in that directory as top-level modules.&lt;/li>
&lt;li>To define variables and functions that should be available when the package is imported.&lt;/li>
&lt;li>To specify any initialization code that should be run when the package is imported.&lt;/li>
&lt;li>Organize code and make it easier to import modules&lt;/li>
&lt;/ol>
&lt;p>Let&amp;rsquo;s see all these use cases in detail now.&lt;/p></description></item><item><title>Detecting OS and Platform Using Python</title><link>https://nerdsid.com/posts/detecting-os-and-platform-using-python/</link><pubDate>Fri, 28 Oct 2022 23:33:25 +0530</pubDate><guid>https://nerdsid.com/posts/detecting-os-and-platform-using-python/</guid><description>&lt;p>There are some circumstances where developing platform-specific code is simply unavoidable, either because a high-level library is not available or because the actions that must be taken are fundamentally different.&lt;/p>
&lt;p>In this situation, it is essential to detect the platform.&lt;/p>
&lt;p>There are a few ways of doing this in Python, including &lt;code>os.system()&lt;/code> and &lt;code>sys.platform&lt;/code>, but the &lt;code>platform&lt;/code> module contains the best set of functionality for determining the OS details most useful in making decisions.&lt;/p></description></item></channel></rss>