<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yuhesh Pandian P J</title>
    <description>The latest articles on DEV Community by Yuhesh Pandian P J (@yuheshpandian).</description>
    <link>https://dev.to/yuheshpandian</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2267520%2F1c23386d-5060-474d-9230-aac866824995.png</url>
      <title>DEV Community: Yuhesh Pandian P J</title>
      <link>https://dev.to/yuheshpandian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yuheshpandian"/>
    <language>en</language>
    <item>
      <title>🎨 ICONIC — A Curated Gallery of Open Source Skill Icons You Can Contribute To</title>
      <dc:creator>Yuhesh Pandian P J</dc:creator>
      <pubDate>Thu, 29 May 2025 15:21:29 +0000</pubDate>
      <link>https://dev.to/yuheshpandian/iconic-a-curated-gallery-of-open-source-skill-icons-you-can-contribute-to-2co9</link>
      <guid>https://dev.to/yuheshpandian/iconic-a-curated-gallery-of-open-source-skill-icons-you-can-contribute-to-2co9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;🖼️ A beautiful, growing library of themed icons — powered by you.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Project URL: &lt;a href="https://github.com/YuheshPandian/ICONIC" rel="noopener noreferrer"&gt;GitHub Project - ICONIC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey everyone 👋&lt;/p&gt;

&lt;p&gt;I'm building &lt;strong&gt;ICONIC&lt;/strong&gt;, a growing collection of open-source SVG icons — and &lt;strong&gt;you&lt;/strong&gt; can help shape it!&lt;/p&gt;




&lt;h2&gt;
  
  
  🌗 Two Themes, One Goal
&lt;/h2&gt;

&lt;p&gt;ICONIC is all about clean, simple, and theme-ready icons — available in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌙 &lt;strong&gt;Dark Theme Icons&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🌞 &lt;strong&gt;Light Theme Icons&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each icon is handcrafted (or contributor-crafted!) and comes in both themes to fit whatever you're building — from websites and apps to personal projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎁 Icons Preview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkt307kq47nn16wg6zct1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkt307kq47nn16wg6zct1.png" alt="Icon Preview Img" width="800" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 What You Can Do
&lt;/h2&gt;

&lt;p&gt;Want to contribute to open source, but not into heavy coding? ICONIC is the perfect project.&lt;/p&gt;

&lt;p&gt;You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Add SVG icons (just drop them into the right folder)&lt;/li&gt;
&lt;li&gt;🔍 Help maintain naming consistency&lt;/li&gt;
&lt;li&gt;🧠 Suggest new categories or icon types&lt;/li&gt;
&lt;li&gt;🖌️ Create icon sets (software, tech, tools, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No need to touch backend code — we take care of that!&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Wait, Is There an API?
&lt;/h2&gt;

&lt;p&gt;Yes! But don’t worry — it’s as simple, just used for accessing the icons and preview then&lt;/p&gt;

</description>
      <category>icons</category>
      <category>opensource</category>
      <category>svg</category>
      <category>beginners</category>
    </item>
    <item>
      <title>“Everyone Talks About How They’d Learn Python If They Started Over — I Actually Got to Do It”</title>
      <dc:creator>Yuhesh Pandian P J</dc:creator>
      <pubDate>Thu, 10 Apr 2025 09:16:28 +0000</pubDate>
      <link>https://dev.to/yuheshpandian/everyone-talks-about-how-theyd-learn-python-if-they-started-over-i-actually-got-to-do-it-25om</link>
      <guid>https://dev.to/yuheshpandian/everyone-talks-about-how-theyd-learn-python-if-they-started-over-i-actually-got-to-do-it-25om</guid>
      <description>&lt;p&gt;After a &lt;strong&gt;2-year break&lt;/strong&gt; from coding, I decided to refresh my &lt;strong&gt;Python skills&lt;/strong&gt;. I didn’t forget everything ⇾ but I needed to rebuild confidence and get back in the groove.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Helped Me &lt;strong&gt;Bounce Back&lt;/strong&gt;?
&lt;/h2&gt;

&lt;p&gt;To dip myself back again into the realms of Python Basics I first had to craft a well-structured and detailed plan that would help me do the task way faster.&lt;br&gt;
This approach involves some rules and steps to be followed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rules ⚖
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;I should &lt;strong&gt;always learn by doing&lt;/strong&gt;, in the sense that while learning a topic I should practice along by just typing and testing 
the code and the changes it cause.&lt;/li&gt;
&lt;li&gt;I must adhere the pathway suggested by a &lt;strong&gt;roadmap&lt;/strong&gt; throughout the journey of relearning. For this I used the roadmap from &lt;a href="https://roadmap.sh" rel="noopener noreferrer"&gt;roadmap.sh&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Every concept must be learnt in detail in order to &lt;strong&gt;fill the knowledge gaps&lt;/strong&gt; that I had when I first learnt Python.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Tips for you 🥴
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Try learning using additional tools like &lt;strong&gt;Ruff&lt;/strong&gt;(for formatting and linting), and how to create &lt;strong&gt;virtual environments&lt;/strong&gt; and updating the &lt;strong&gt;requirements&lt;/strong&gt; for a project.&lt;/li&gt;
&lt;li&gt;Then practice &lt;strong&gt;version control (Git and GitHub)&lt;/strong&gt; to keep you in touch with them so that you don't need a cheat sheet for Git in future.&lt;/li&gt;
&lt;li&gt;Try learning of optimize code using &lt;strong&gt;DRY (Don't Repeat Yourself) principle&lt;/strong&gt; and performance optimization tricks for Python.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Go-To Resources That Made the Difference 🎁
&lt;/h2&gt;

&lt;p&gt;These are the platforms and tools that made my Python comeback smoother, sharper, and more structured:&lt;/p&gt;

&lt;h3&gt;
  
  
  YouTube Channels 🎥
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Tech With Tim – Project-based learning that helped me solidify concepts with real use cases.
&lt;/li&gt;
&lt;li&gt;Bro Code – Fast and clear tutorials that covered a wide range of Python topics, from beginner to intermediate.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Coding &amp;amp; Practice Platforms 💻
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Replit – Great for testing small scripts instantly with no setup.
&lt;/li&gt;
&lt;li&gt;W3Schools Python– My quick-reference guide for brushing up syntax and simple examples.
&lt;/li&gt;
&lt;li&gt;Codeforces – Helped me sharpen logic and problem-solving skills with competitive-style problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Learning Sites 📖
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Real Python – In-depth explanations and tutorials that helped me understand the “why” behind the code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tools I Used Daily 🛠️
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;VS Code – My primary code editor, enhanced with Python extensions for better formatting and debugging.
&lt;/li&gt;
&lt;li&gt;GitHub – For saving projects, practicing version control, and learning from other developers’ code.
&lt;/li&gt;
&lt;li&gt;ChatGPT – A go-to companion for explaining errors, simplifying concepts, and speeding up debugging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real Projects That Helped Me Reconnect with Python
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A modern content aggregator&lt;/strong&gt; – Using the &lt;code&gt;Feedparser&lt;/code&gt; and &lt;code&gt;Flask&lt;/code&gt; frameworks of Python, I was able to build a blog content aggregator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A command-line interface tool&lt;/strong&gt; – Using the &lt;code&gt;Click&lt;/code&gt; package, I created a CLI tool that helps streamline tasks directly from the terminal with ease and customization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A password generator and management tool&lt;/strong&gt; – I built a simple yet secure tool using Python to generate strong passwords and manage them locally, with encryption support for storing sensitive data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A file organizer for my system&lt;/strong&gt; – I developed a Python script that automatically sorts and organizes files in a directory based on file type, extension, or custom rules. It helped me clean up my programming folder and keep things structured.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common Pitfalls to Avoid When Relearning Python
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Jumping into advanced stuff too quickly: Why? cause I did the same mistake and got no far in my journey.&lt;/li&gt;
&lt;li&gt;Getting trapped into Tutorial hell: Instead of watching tutorials by tutorials, try learning by doing i.e. write code while you learn a new concept of Python&lt;/li&gt;
&lt;li&gt;Ignoring Built-in functions and modules like &lt;code&gt;json&lt;/code&gt;, &lt;code&gt;os&lt;/code&gt;, &lt;code&gt;math&lt;/code&gt;, etc. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Simple Habits That Helped Me Stay Consistent
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Writing code for at least &lt;code&gt;30 mins&lt;/code&gt; a day.&lt;/li&gt;
&lt;li&gt;Maintaining a good &lt;strong&gt;GitHub&lt;/strong&gt; profile and also a &lt;code&gt;code snippets&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Practicing &lt;strong&gt;problem-solving&lt;/strong&gt; in &lt;code&gt;Codeforces&lt;/code&gt; daily&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>roadmap</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Wonders with Click: Streamline your CLI Experience</title>
      <dc:creator>Yuhesh Pandian P J</dc:creator>
      <pubDate>Thu, 24 Oct 2024 18:33:31 +0000</pubDate>
      <link>https://dev.to/yuheshpandian/wonders-with-click-streamline-your-cli-experience-pn4</link>
      <guid>https://dev.to/yuheshpandian/wonders-with-click-streamline-your-cli-experience-pn4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this blog📃we will be delving into the fascinating dimensions of &lt;strong&gt;Click&lt;/strong&gt;, a &lt;strong&gt;Python library&lt;/strong&gt; that can streamline your &lt;strong&gt;CLI&lt;/strong&gt; performance and reach. We will be discussing the concepts necessary to create a basic and compact CLI. This blog would help you to &lt;em&gt;produce&lt;/em&gt; and &lt;em&gt;organize&lt;/em&gt; 📚 better CLI for your clients🤝.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftado362p6jeepkiudo5a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftado362p6jeepkiudo5a.jpg" alt="Terminal Mockup" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Click anyway??
&lt;/h2&gt;

&lt;p&gt;Click is a &lt;strong&gt;Python package&lt;/strong&gt; 📦 that helps one to fasten their CLI utility development. This package acts as an easier option ✅ compared to other Python packages to develop Command Line Interfaces. It is a better option as it requires &lt;em&gt;minimal coding&lt;/em&gt; and comes with many built in features that &lt;em&gt;streamline&lt;/em&gt; the development features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mastering the basics of Click
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation:
&lt;/h3&gt;

&lt;p&gt;To install click run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;click&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  coding:
&lt;/h3&gt;

&lt;p&gt;First create a file named main.py and open the file with your preferred code editor/ide. Now induce the following code snippet to create a basic cli tool🧰 in main.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;click&lt;/span&gt;

&lt;span class="nd"&gt;@click.command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
  &lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello Bob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# runs when the file is run directly and not imported
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
  &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here we use the click.command decorator to give the function some more features to make it suitable for a cli command(eg: commit, merge, init, etc in Git). And click.echo is a customized version of python print function that suits the need of click.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  having multiple commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;click&lt;/span&gt;

&lt;span class="nd"&gt;@click.group&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
  &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="nd"&gt;@click.command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nd"&gt;@click.option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Your name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;The person to greet.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Hello &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@click.command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nd"&gt;@click.option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Your name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;The person to greet.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_bye&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Goodbye &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@click.command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nd"&gt;@click.option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--num&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Enter a number&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;The person to greet.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;give_square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="c1"&gt;# Registering the commands with the CLI
&lt;/span&gt;&lt;span class="n"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;say_bye&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;give_square&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
  &lt;span class="nf"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;em&gt;click.option&lt;/em&gt; decorator converts the function into a command with ability to take an optional value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To use this &lt;strong&gt;snippet&lt;/strong&gt; run the following command in the terminal,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python main.py say_hello --name=Kris&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  working with arguments
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;click&lt;/span&gt;

&lt;span class="nd"&gt;@click.command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nd"&gt;@click.argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# runs when the file is run directly and not imported
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
  &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;em&gt;click.argument&lt;/em&gt; decorator converts the function into a command with ability to take an argument which is to be provided and is required by the cli.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To use this &lt;strong&gt;code snippet&lt;/strong&gt; run the following command in the terminal,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python main.py bob&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Click&lt;/strong&gt; makes building &lt;strong&gt;command-line interfaces&lt;/strong&gt; in &lt;strong&gt;Python&lt;/strong&gt; simple and intuitive. With support for multiple &lt;em&gt;commands, options, and arguments&lt;/em&gt;, it’s a powerful💪tool that can scale from simple to complex use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  In a nutshell:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command Groups&lt;/strong&gt; allow you to organize multiple commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commands&lt;/strong&gt; define the actions your CLI will perform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Options &amp;amp; Arguments&lt;/strong&gt; allow user input to customize command behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Start experimenting with Click for your next Python &lt;br&gt;
project and see how easy it is to build user-friendly CLI tools!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>cli</category>
      <category>python</category>
      <category>terminal</category>
      <category>pythonpackage</category>
    </item>
  </channel>
</rss>
