<?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 oorkan</title>
    <link>https://www.oorkan.dev/blog/tags/python/</link>
    <description>Recent content in Python on oorkan</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 21 Mar 2021 10:30:00 +0400</lastBuildDate>
    <atom:link href="https://www.oorkan.dev/blog/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A Simple Python HTTP Server</title>
      <link>https://www.oorkan.dev/blog/a-simple-python-http-server/</link>
      <pubDate>Sun, 21 Mar 2021 10:30:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/a-simple-python-http-server/</guid>
      <description>&lt;p&gt;Although, we aren&amp;rsquo;t gonna need it in this article but it&amp;rsquo;s always good to setup a virtual environment when working with Python. Check out my article on how to create a virtual environment for Python:&#xA;&lt;a href=&#34;https://www.oorkan.dev/blog/python/how-to-create-a-python-virtual-environment/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;/blog/python/how-to-create-a-python-virtual-environment/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To create a simple Python HTTP Server, we are going to use two modules called &lt;code&gt;http.server&lt;/code&gt; and &lt;code&gt;socketserver&lt;/code&gt;. They both are part of &lt;a href=&#34;https://docs.python.org/3/library/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Python&amp;rsquo;s Standard Library&lt;/a&gt;, we don&amp;rsquo;t need to install them.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Important!&lt;/strong&gt; This material is made for learning purposes. &lt;strong&gt;DO NOT&lt;/strong&gt; use it in production. &lt;code&gt;http.server&lt;/code&gt; is not recommended for production. It only implements basic security checks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Python Virtual Environment</title>
      <link>https://www.oorkan.dev/blog/how-to-create-a-python-virtual-environment/</link>
      <pubDate>Fri, 19 Mar 2021 13:10:00 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/how-to-create-a-python-virtual-environment/</guid>
      <description>&lt;p&gt;When working with Python, often we need to use different packages and modules. Some of them are part of &lt;a href=&#34;https://docs.python.org/3/library/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Python&amp;rsquo;s Standard Library&lt;/a&gt; but many of them are not. On the other hand, we may need a specific version of a custom module for our app. Upgrading or downgrading to that version for a whole system is a risky idea because it can break other applications that are dependant on a specific version of a module.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Zen of Python</title>
      <link>https://www.oorkan.dev/blog/the-zen-of-python/</link>
      <pubDate>Wed, 27 May 2020 01:34:41 +0400</pubDate>
      <guid>https://www.oorkan.dev/blog/the-zen-of-python/</guid>
      <description>&lt;p&gt;Run &lt;code&gt;python -c &amp;quot;import this&amp;quot;&lt;/code&gt; in terminal.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;The Zen of Python, by Tim Peters&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Beautiful is better than ugly.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Explicit is better than implicit.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Simple is better than complex.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Complex is better than complicated.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Flat is better than nested.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Sparse is better than dense.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Readability counts.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Special cases aren&amp;#39;t special enough to break the rules.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Although practicality beats purity.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Errors should never pass silently.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Unless explicitly silenced.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;In the face of ambiguity, refuse the temptation to guess.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;There should be one-- and preferably only one --obvious way to do it.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Although that way may not be obvious at first unless you&amp;#39;re Dutch.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Now is better than never.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Although never is often better than *right* now.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;If the implementation is hard to explain, it&amp;#39;s a bad idea.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;If the implementation is easy to explain, it may be a good idea.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Namespaces are one honking great idea -- let&amp;#39;s do more of those!&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;&lt;strong&gt;Who&amp;rsquo;s Tim Peters?&lt;/strong&gt; &lt;a href=&#34;https://en.wikipedia.org/wiki/Tim_Peters_%28software_engineer%29&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Wiki&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
