<?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 Samarthya</title><link>https://samarthya.me/tags/python/</link><description>Recent content in Python on Samarthya</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© Samarthya 2018-2026. All rights reserved.</copyright><lastBuildDate>Mon, 26 Oct 2026 18:40:00 -0400</lastBuildDate><atom:link href="https://samarthya.me/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>AI in practice, part 5: MCP, the Model Context Protocol</title><link>https://samarthya.me/posts/ai-in-practice-5-mcp/</link><pubDate>Mon, 26 Oct 2026 18:40:00 -0400</pubDate><guid>https://samarthya.me/posts/ai-in-practice-5-mcp/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; Before USB, every device needed its own port. Before MCP, every AI application needed its own connector for&#10;every data source. The Model Context Protocol is the common plug.&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;h2 class="relative group"&gt;The problem it solves&#10; &lt;div id="the-problem-it-solves" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-problem-it-solves" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://samarthya.me/posts/ai-in-practice-4-tools-and-agents/" &gt;Part 4&lt;/a&gt; showed how a model uses tools. The catch: each AI&#10;application (a chat app, an IDE assistant, an agent framework) described tools its own way. Connecting M&#10;applications to N data sources meant up to &lt;strong&gt;M × N&lt;/strong&gt; custom integrations.&lt;/p&gt;</description></item><item><title>AI in practice, part 2: ML pipelines on Google Vertex AI</title><link>https://samarthya.me/posts/ai-in-practice-2-vertex-ai-pipelines/</link><pubDate>Mon, 26 Oct 2026 18:10:00 -0400</pubDate><guid>https://samarthya.me/posts/ai-in-practice-2-vertex-ai-pipelines/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; A notebook that trains a good model once is an experiment. A pipeline that trains it again next week, on new&#10;data, and tells you whether it got better: that&amp;rsquo;s a system. Here&amp;rsquo;s how Google&amp;rsquo;s Vertex AI turns one into the other.&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;h2 class="relative group"&gt;Why pipelines&#10; &lt;div id="why-pipelines" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#why-pipelines" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Training a model is never one step. Data is extracted, cleaned and split; a model is trained, evaluated and&#10;compared with the current one; if it&amp;rsquo;s better, it&amp;rsquo;s registered and deployed. Done by hand in a notebook, that&#10;sequence is easy to get subtly wrong and impossible to audit.&lt;/p&gt;</description></item><item><title>AI in practice, part 1: Choosing the right framework</title><link>https://samarthya.me/posts/ai-in-practice-1-choosing-a-framework/</link><pubDate>Mon, 26 Oct 2026 18:00:00 -0400</pubDate><guid>https://samarthya.me/posts/ai-in-practice-1-choosing-a-framework/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; &amp;ldquo;Which AI framework should I use?&amp;rdquo; has no single answer, because the names people throw around do&#10;completely different jobs. Put them on a map first, and the choice usually makes itself.&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;This series picks up where my earlier posts left off. Those covered the ideas: &lt;a href="https://samarthya.me/posts/genai/" &gt;what generative AI&#10;is&lt;/a&gt;, &lt;a href="https://samarthya.me/posts/language-model/" &gt;how transformers pay attention&lt;/a&gt;, &lt;a href="https://samarthya.me/posts/matrix-multiplication-to-gpus/" &gt;why GPUs matter&lt;/a&gt;,&#10;and two hands-on builds (&lt;a href="https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/" &gt;LangChain with Ollama&lt;/a&gt; and a&#10;&lt;a href="https://samarthya.me/posts/building-a-practical-retrieval-augmented-personal-assistant-rag/" &gt;RAG assistant&lt;/a&gt;). This part is the map&#10;that connects them.&lt;/p&gt;</description></item><item><title>Moving to Hugo, part 2: The migration playbook</title><link>https://samarthya.me/posts/moving-to-hugo-2-the-migration-playbook/</link><pubDate>Mon, 26 Oct 2026 07:10:00 -0400</pubDate><guid>https://samarthya.me/posts/moving-to-hugo-2-the-migration-playbook/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; Ten phases, in the order that kept my risk low. Each one ends with something you can check, so you always&#10;know whether it&amp;rsquo;s safe to move on.&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;The numbers come from my own move: &lt;strong&gt;137 WordPress posts&lt;/strong&gt; from six years, a few hundred images, and a domain&#10;that also carried email. Your numbers will differ; the order shouldn&amp;rsquo;t.&lt;/p&gt;</description></item><item><title>Rebuilding samarthya.me, part 2: Salvaging the content</title><link>https://samarthya.me/posts/rebuilding-2-salvaging-the-content/</link><pubDate>Sun, 25 Oct 2026 12:10:00 -0400</pubDate><guid>https://samarthya.me/posts/rebuilding-2-salvaging-the-content/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; Text is easy to save. Dates, images, code blocks and six years of links are where a migration quietly loses&#10;things. Here&amp;rsquo;s what it took to bring them across.&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;h2 class="relative group"&gt;The raw material&#10; &lt;div id="the-raw-material" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-raw-material" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;WordPress can export everything as one XML file (WXR). Together with a database dump and a copy of the&#10;uploads folder, that&amp;rsquo;s the whole site. The export held &lt;strong&gt;139 published posts&lt;/strong&gt;. Two were the attacker&amp;rsquo;s, so&#10;they were excluded permanently: &lt;strong&gt;137 posts&lt;/strong&gt; to convert.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://samarthya.me/posts/rebuilding-2-salvaging-the-content/feature.jpg"/></item><item><title>Building a Minimal LangChain + Ollama Demo</title><link>https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/</link><pubDate>Tue, 21 Oct 2025 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/llm-1.png"&#10; srcset="https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/llm-1.png 800w, https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/llm-1.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/building-a-minimal-langchain-ollama-demo/llm-1.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;This post walks through a tiny, practical example that uses &lt;code&gt;LangChain&lt;/code&gt; primitives and a local &lt;code&gt;Ollama&lt;/code&gt; server to run a prompt-based summarization. The project is intentionally small so you can learn the core ideas quickly: extracting prompts, initializing an LLM client, composing a chain, and running it locally.&lt;/p&gt;</description></item><item><title>Beyond the `DataFrame`: How Parquet and Arrow Turbocharge PySpark 🚀</title><link>https://samarthya.me/posts/beyond-the-dataframe-how-parquet-and-arrow-turbocharge-pyspark/</link><pubDate>Thu, 09 Oct 2025 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/beyond-the-dataframe-how-parquet-and-arrow-turbocharge-pyspark/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/beyond-the-dataframe-how-parquet-and-arrow-turbocharge-pyspark/arrow-2.png"&#10; srcset="https://samarthya.me/posts/beyond-the-dataframe-how-parquet-and-arrow-turbocharge-pyspark/arrow-2.png 800w, https://samarthya.me/posts/beyond-the-dataframe-how-parquet-and-arrow-turbocharge-pyspark/arrow-2.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/beyond-the-dataframe-how-parquet-and-arrow-turbocharge-pyspark/arrow-2.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;In my &lt;a href="https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/" &gt;last post&lt;/a&gt;, we explored the divide between &lt;strong&gt;Pandas&lt;/strong&gt; (single machine) and &lt;strong&gt;PySpark&lt;/strong&gt; (distributed computing).&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;p&gt;The conclusion: for massive datasets, PySpark is the clear winner.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>PySpark vs Pandas: Choosing Right! 🐍</title><link>https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/</link><pubDate>Thu, 09 Oct 2025 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/pysp-1.png"&#10; srcset="https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/pysp-1.png 800w, https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/pysp-1.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/pyspark-vs-pandas-choosing-right/pysp-1.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;As another project wraps up, bringing with it the bittersweet relief of an almost-closed chapter (and, yes, a few too many late-night coding sessions), I found myself reflecting on the tools that got us through.&lt;/p&gt;</description></item><item><title>Quarto: A new way!</title><link>https://samarthya.me/posts/quarto-a-new-way/</link><pubDate>Thu, 11 Sep 2025 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/quarto-a-new-way/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/quarto-a-new-way/quarto-blog.png"&#10; srcset="https://samarthya.me/posts/quarto-a-new-way/quarto-blog.png 800w, https://samarthya.me/posts/quarto-a-new-way/quarto-blog.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/quarto-a-new-way/quarto-blog.png"&gt;&lt;/figure&gt;&#10;&#10;&lt;h1 class="relative group"&gt;Quarto: The Future of Scientific Publishing&#10; &lt;div id="quarto-the-future-of-scientific-publishing" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#quarto-the-future-of-scientific-publishing" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h1&gt;&#10;&lt;p&gt;In the rapidly evolving landscape of data science and scientific publishing, tools that bridge the gap between analysis and communication are invaluable. Enter Quarto – a next-generation publishing system that’s revolutionizing how researchers, data scientists, and content creators share their work. Whether you’re writing academic papers, creating interactive dashboards, or building websites, Quarto offers a unified approach to scientific and technical publishing.&lt;/p&gt;</description></item><item><title>From Speech to Text: A Python Deep Dive</title><link>https://samarthya.me/posts/from-speech-to-text-a-python-deep-dive/</link><pubDate>Tue, 03 Sep 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/from-speech-to-text-a-python-deep-dive/</guid><description>&lt;p&gt;Ever wished you could effortlessly convert your spoken words into written text? Look no further! This blog post will guide you through building a simple yet powerful speech-to-text application using Python. We’ll break down the code step-by-step, explaining the logic behind each stage, and even show you how to run the application yourself.&lt;/p&gt;</description></item><item><title>Python &amp; DB</title><link>https://samarthya.me/posts/python-db/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-db/</guid><description>&lt;p&gt;&lt;code&gt;SQLite3&lt;/code&gt; is a lightweight and easy-to-use database engine that is included with Python. It’s perfect for smaller-scale applications, prototyping, or standalone systems. Python’s &lt;code&gt;sqlite3&lt;/code&gt; module allows seamless integration with SQLite databases.&lt;/p&gt;</description></item><item><title>Python Virtual Enviroments</title><link>https://samarthya.me/posts/venvansible/</link><pubDate>Tue, 28 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/venvansible/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Python virtual environment steps: create, activate, install, freeze to requirements.txt, and recreate"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/venvansible/an-lint-1_hu_c5d8a3d7cb9aaa30.png"&#10; srcset="https://samarthya.me/posts/venvansible/an-lint-1_hu_c5d8a3d7cb9aaa30.png 800w, https://samarthya.me/posts/venvansible/an-lint-1.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/venvansible/an-lint-1.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Using a virtual environment like venv is a best practice when working with Python-based projects like Ansible, Molecule, and Playbooks.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;Continuing from the &lt;a href="https://samarthya.me/posts/venv-ansible/" &gt;blog&lt;/a&gt;, &lt;code&gt;Virtual environments&lt;/code&gt; are isolated Python environments that allow you to manage dependencies separately for each project, providing a controlled and reproducible environment for development, testing, and production.&lt;/p&gt;</description></item><item><title>VENV: Ansible</title><link>https://samarthya.me/posts/venv-ansible/</link><pubDate>Mon, 27 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/venv-ansible/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Steps to run Ansible and Molecule in a Python virtual environment on CentOS 7"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/venv-ansible/an-venv_hu_2084f4df6bf85296.png"&#10; srcset="https://samarthya.me/posts/venv-ansible/an-venv_hu_2084f4df6bf85296.png 800w, https://samarthya.me/posts/venv-ansible/an-venv.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/venv-ansible/an-venv.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Ansible and Molecule are popular tools for configuration management and testing in the world of DevOps. To avoid conflicts between different projects and their dependencies, it is recommended to use a virtual environment for each project. In this blog post, we’ll show you how to set up and use a virtual environment using Python’s built-in &lt;code&gt;venv&lt;/code&gt; module on &lt;code&gt;macOS&lt;/code&gt; and &lt;code&gt;CentOS 7&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Testinfra</title><link>https://samarthya.me/posts/testinfra/</link><pubDate>Tue, 14 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/testinfra/</guid><description>&lt;p&gt;Testinfra is a Python-based framework for infrastructure testing. It allows you to write tests for your infrastructure and verify that everything is working as expected. Testinfra is particularly useful for infrastructure-as-code and continuous integration and continuous delivery (CI/CD) scenarios.&lt;/p&gt;</description></item><item><title>Python: Using flask</title><link>https://samarthya.me/posts/python-using-flask/</link><pubDate>Tue, 07 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-using-flask/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="226"&#10; src="https://samarthya.me/posts/python-using-flask/hello-world.png"&#10; srcset="https://samarthya.me/posts/python-using-flask/hello-world.png 800w, https://samarthya.me/posts/python-using-flask/hello-world.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/python-using-flask/hello-world.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;Building a simple hello world using &lt;code&gt;Flask&lt;/code&gt;. (The code is available &lt;a href="https://github.com/samarthya/pysample-three" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;)&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What is Flask and why use it?&#10; &lt;div id="what-is-flask-and-why-use-it" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-is-flask-and-why-use-it" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Flask is a lightweight web framework for Python, but there are certain cases when you may want to consider using an alternative. Here are some of the cases when you might not want to use Flask:&lt;/p&gt;</description></item><item><title>Python vs Bash</title><link>https://samarthya.me/posts/python-vs-bash/</link><pubDate>Thu, 02 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-vs-bash/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Python compared with Bash: kind of language, what each is best for, libraries, and when to choose each"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/python-vs-bash/pycomp_hu_9aa880e447e5b1c6.png"&#10; srcset="https://samarthya.me/posts/python-vs-bash/pycomp_hu_9aa880e447e5b1c6.png 800w, https://samarthya.me/posts/python-vs-bash/pycomp.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/python-vs-bash/pycomp.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Python and bash are both programming languages, but they have different purposes and use cases.&lt;/p&gt;</description></item><item><title>Python: `argparse`</title><link>https://samarthya.me/posts/python-argparse/</link><pubDate>Thu, 02 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-argparse/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Five steps with argparse: import argparse, create an ArgumentParser, add_argument, parse_args, then use args"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/python-argparse/pyarg_hu_ddd1be7c2c44493c.png"&#10; srcset="https://samarthya.me/posts/python-argparse/pyarg_hu_ddd1be7c2c44493c.png 800w, https://samarthya.me/posts/python-argparse/pyarg.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/python-argparse/pyarg.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;The &lt;code&gt;argparse&lt;/code&gt; module is a powerful tool for parsing command line arguments in Python. It provides an easy way to define the arguments required by your script and handle the input data passed to your script by the user.&lt;/p&gt;</description></item><item><title>Python: Polymorphism</title><link>https://samarthya.me/posts/python-polymorphism/</link><pubDate>Thu, 02 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-polymorphism/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Animal base class with make_sound, and Dog and Cat subclasses returning Bark and Meow"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/python-polymorphism/pypoly_hu_80a53db7deb7e932.png"&#10; srcset="https://samarthya.me/posts/python-polymorphism/pypoly_hu_80a53db7deb7e932.png 800w, https://samarthya.me/posts/python-polymorphism/pypoly.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/python-polymorphism/pypoly.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Polymorphism is a key feature of Object Oriented Programming that allows objects of different classes to be treated as objects of a common class. It is done by implementing the same methods across all classes and making use of inheritance, interfaces and overloading.&lt;/p&gt;</description></item><item><title>Python: When not to use it?</title><link>https://samarthya.me/posts/python-when-not-to-use-it/</link><pubDate>Thu, 02 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-when-not-to-use-it/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Five cases where Python is not the best choice: performance-critical code, mobile apps, low-level systems, strict real-time, and tiny one-off scripts"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/python-when-not-to-use-it/nopy_hu_f610f1f1a8811213.png"&#10; srcset="https://samarthya.me/posts/python-when-not-to-use-it/nopy_hu_f610f1f1a8811213.png 800w, https://samarthya.me/posts/python-when-not-to-use-it/nopy.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/python-when-not-to-use-it/nopy.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Python is a versatile and widely-used programming language, but there are certain scenarios when it may not be the best choice. Here are some examples of when not to use Python:&lt;/p&gt;</description></item><item><title>Python: Sample Project</title><link>https://samarthya.me/posts/python-sample-project/</link><pubDate>Wed, 01 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-sample-project/</guid><description>&lt;p&gt;Python is a high-level programming language that is widely used for web development, machine learning, scientific computing and more. In this blog post, we will be identify (and build) how to develop a simple python project with unit testing, publishing it finally as a binary and distribute it as source.&lt;/p&gt;</description></item><item><title>Python: Class</title><link>https://samarthya.me/posts/python-class/</link><pubDate>Tue, 31 Jan 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-class/</guid><description>&lt;p&gt;Learning to write Python code? A Python class is a blueprint for creating objects.&lt;/p&gt;&#10;&lt;p&gt;It defines a set of attributes and methods that can be used to manipulate those attributes. Here’s an example of a simple Python class:&lt;/p&gt;</description></item><item><title>Python: Decorators</title><link>https://samarthya.me/posts/python-decorators/</link><pubDate>Tue, 31 Jan 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-decorators/</guid><description>&lt;p&gt;Let’s learn about decorators &lt;code&gt;@iamdecorator&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Decorators are used to modify or extend the behavior of functions and classes. They are useful for wrapping a function or class with additional functionality, such as logging, access control, performance measurement, or adding attributes. This can reduce code duplication, increase readability and maintainability.&lt;/p&gt;</description></item><item><title>Python: Inheritance</title><link>https://samarthya.me/posts/python-inheritance/</link><pubDate>Tue, 31 Jan 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-inheritance/</guid><description>&lt;p&gt;Inheritance is a mechanism in object-oriented programming (OOP) that allows you to create new classes that are derived from existing classes. The derived class inherits attributes and behaviors from the base class, and can also have additional attributes and behaviors of its own.&lt;/p&gt;</description></item><item><title>Python: Interface</title><link>https://samarthya.me/posts/python-interface/</link><pubDate>Tue, 31 Jan 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-interface/</guid><description>&lt;p&gt;n Python, unlike some other programming languages, there is no explicit syntax for defining interfaces. However, you can create a similar concept by defining an abstract base class (ABC) that contains abstract methods. An abstract method is a method that is declared in a base class, but has no implementation. Subclasses of the abstract base class must implement these abstract methods.&lt;/p&gt;</description></item><item><title>Python: Multi-Args</title><link>https://samarthya.me/posts/python-multi-args/</link><pubDate>Tue, 31 Jan 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-multi-args/</guid><description>&lt;p&gt;In Python, you can define a function with a variable number of arguments using the &lt;code&gt;*&lt;/code&gt; and &lt;code&gt;**&lt;/code&gt; syntax in the function definition.&lt;/p&gt;&#10;&lt;p&gt;A single asterisk &lt;code&gt;*&lt;/code&gt; in the function definition is used to capture positional arguments passed to the function as a tuple.&lt;/p&gt;</description></item><item><title>Python: Pointers &amp; Reference</title><link>https://samarthya.me/posts/python-pointers-reference/</link><pubDate>Tue, 31 Jan 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-pointers-reference/</guid><description>&lt;p&gt;In Python, there are no explicit pointers like in some other programming languages. In python everything is an object and references to objects are stored in variables.&lt;/p&gt;&#10;&lt;p&gt;When you assign an object to a variable, the variable stores a reference to the object in memory. This means that changes to the object will be reflected in all variables that reference that object.&lt;/p&gt;</description></item></channel></rss>