<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blind Not Dumb (Posts about python)</title><link>https://www.feoh.org/</link><description></description><atom:link href="https://www.feoh.org/categories/cat_python.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:feoh@feoh.org"&gt;Chris Patti&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Mon, 02 Mar 2026 00:41:16 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Getting Started With Python On Windows 2021 Edition: Push The Easy Button!</title><link>https://www.feoh.org/posts/getting_started_with_python_on_windows_2021_edition_push_the_easy_button.html</link><dc:creator>Chris Patti</dc:creator><description>&lt;h2&gt;Don't Despair! This Is Gonna Be Easy! :)&lt;/h2&gt;
&lt;p&gt;Over the last few months I've seen a &lt;strong&gt;&lt;em&gt;ton&lt;/em&gt;&lt;/strong&gt; of confusion swirling around social media about how to help people who are new to Python development and software development in general get up and running on Windows quickly.&lt;/p&gt;
&lt;p&gt;GOOD NEWS! You can ignore all that. Many of these suggestions are well meaning but come from people who don't actually do Python development on Windows regularly.&lt;/p&gt;
&lt;p&gt;Note that I'm not going to tell you the 5 different ways to do a thing, I'm going to tell you the ONE easy way :)&lt;/p&gt;
&lt;p&gt;So let's get started!&lt;/p&gt;
&lt;h3&gt;Side Note: Everyone Will Tell You To Use WSL - You Probably Don't Want That!&lt;/h3&gt;
&lt;p&gt;I hear a lot of incredibly talented and experienced well meaning UNIX/Mac enthusiasts tell newcomers looking to get going on
Windows "Oh well you just use WSL! It's easy! Then you install python with apt get yada yada, and then you install pyenv,
and then you configure your shell's environment to use the right shims... and..."&lt;/p&gt;
&lt;p&gt;The truth is that if you want to learn Linux - you SHOULD! It's an incredible platform and a virtually bottomless font of
power waiting for you to tap.&lt;/p&gt;
&lt;p&gt;But if there's one thing I've learned in 30 years in the tech trenches, it's that trying to learn a million things all at
once is the surest way to learn nothing. Why not focus on teaching yourself Python programming first and then exploring Linux
as a separate effort?&lt;/p&gt;
&lt;h2&gt;Install Python&lt;/h2&gt;
&lt;p&gt;If you're on Windows 11 (And I recommend it if your hardware is new enough!) this is as simple as bringing up a Powershell in your swank Windows Terminal. If you want a look at my setup please go read &lt;a href="https://www.feoh.org/2021-the-year-windows-became-a-first-class-python-development-environment.html"&gt;my article on that&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Anyway, all you have to do is type:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;winget install python
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That's it! This will install the latest stable version of Python from &lt;a href="https://www.python.org"&gt;The official Python website&lt;/a&gt;. If you're not lucky enough to be running Windows 11, just download the latest stable version from &lt;a href="https://www.python.org/downloads/"&gt;the website's Downloads page&lt;/a&gt; and double click on the executable file in your Downloads folder. If you're not sure just keep clicking Next on the dialogs and in a few minutes you'll have Python installed!&lt;/p&gt;
&lt;h2&gt;Embracing The Power of Py! (Psst. This Is The Easy Button!)&lt;/h2&gt;
&lt;p&gt;The 'py' Python launcher used to be a super power that only Windows versions of Python shipped with, but now thanks to &lt;a href="https://github.com/brettcannon/python-launcher"&gt;Brett Cannon, an amazingly prolific Python core developer's hard work&lt;/a&gt; our UNIX friends can enjoy the easy button as well!&lt;/p&gt;
&lt;p&gt;So let's get this party started and see how easy it is these days to get into the Python prompt:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Windows Python Prompt With Py" src="https://www.feoh.org/images/WindowsPyPrompt.png"&gt;&lt;/p&gt;
&lt;p&gt;Pretty easy, right?&lt;/p&gt;
&lt;p&gt;Note that py has other superpowers as well. It can list all the python versions you have installed, and also let you choose which version to run with the arguments you choose. Run:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;py --help
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to see an exhaustive description of all the magic tricks py can do :)&lt;/p&gt;
&lt;h4&gt;Set The Stage&lt;/h4&gt;
&lt;p&gt;Again, from your Powershell, create a project directory for yourself. Programmers often create a 'src' directory wherever it's convenient (Maybe in your home directory?) and then put their projects underneath.&lt;/p&gt;
&lt;p&gt;So let's go ahead and do that:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;CD $HOME
mkdir src\starwars_characters

&lt;span class="gh"&gt;#&lt;/span&gt; Yes i'm a big nerd. Our project will pull down a list of characters in the movies from the Star Wars API :)

cd src\starwars_characters
&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Building A Sandbox&lt;/h4&gt;
&lt;p&gt;Now let's create a safe space for our project so we don't unintentionally install libraries or other experiments in public. This can lead to situations where you go to create another project but a library you installed previously either causes undesirable behavior or perhaps is even in a broken state, getting in the way of you getting your work done.&lt;/p&gt;
&lt;p&gt;We're going to create a thing called 'virtual environment'. Don't worry too much about the details, just think about this as a nice tidy sandbox for us to play in where we don't have to worry about breaking anything outside.&lt;/p&gt;
&lt;p&gt;Again from our Powershell prompt:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;# Actually create our virtual environment. Put the bits in a folder called 'venv'.
# Most Pythonistas use this folder name, but you can use any name you want :)
py -m venv venv

# Actually activate our new virtual environment in our Powershell
.\venv\Scripts\Activate.ps1
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Let's see what happens when we do that (Assuming you're running Oh My Posh, and you should be if you followed my setup article):&lt;/p&gt;
&lt;p&gt;&lt;img alt="Create/Activate Virtual Environment" src="https://www.feoh.org/images/virtualenvps.png"&gt;&lt;/p&gt;
&lt;p&gt;See what happens there? We create the virtual environment, and our shell notices which Python version it uses, and tells us that in our Powershell prompt!&lt;/p&gt;
&lt;p&gt;Then, we activate our virtual environment, and now our prompt adds a (venv) at the beginning. With this visual indicator in plce, we know we're safely ensconced in our sandbox and can start playing with no worries!&lt;/p&gt;
&lt;h4&gt;Install Necessary Libraries&lt;/h4&gt;
&lt;p&gt;You'll need an editor or an IDE. I use &lt;a href="https://code.visualstudio.com/"&gt;Visual Studio Code&lt;/a&gt;. It's free, it runs on any modern computer, and it offers an incredibly rich set of tools to help you with your development. Bonus points? It's also free, and even largely open source.&lt;/p&gt;
&lt;p&gt;Let's get started, and tell Python which libraries we'll need for our project:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;code requirements.txt
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this file, add a single line:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;requests
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you want to add a truly superlative interactive Python environment with which to prototype and 
explore, you could also add IPython:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;IPython
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(Note IPython here is case sensitive so be careful!)&lt;/p&gt;
&lt;p&gt;Now, still in our Powershell prompt, type this command to actually install these required libraries into our virtual environment:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;py -m pip install -r requirements.txt
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You should see some messages about libraries being installed. Note that you invoke IPython this exact same way:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;py -m IPython
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Write The Code&lt;/h3&gt;
&lt;p&gt;Create a file in your project directory called starwars_characters.py with your editor that includes the following code:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;STARWARS_API_URL_BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://swapi.dev/api"&lt;/span&gt;
&lt;span class="n"&gt;GET_CHARACTERS_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;STARWARS_API_URL_BASE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/people"&lt;/span&gt;

&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;GET_CHARACTERS_URL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;response_json&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response_json&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'results'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;character&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;characters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Character Name: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;character&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here's what my Visual Studio Code session looks like with this code loaded and the output shown in the run window:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Starwars Project VSCode Screenshot" src="https://www.feoh.org/images/vscode.png"&gt;&lt;/p&gt;
&lt;p&gt;Notice that bit at the bottom that says 3.10? That shows us that Visual Studio Code automatically detected the Python we have installed in our virtualenv. You can click on that to see a list of installed Python interpreters to choose from.&lt;/p&gt;
&lt;p&gt;We can run our new project either by using the Run menu inside Visual Studio Code or on the command line with that very same &lt;code&gt;py&lt;/code&gt; syntax we used before:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;py starwars_characters.py
&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;The End Is Just The Beginning&lt;/h2&gt;
&lt;p&gt;Well there we have it! You have Python installed and running, and you've built a small but interesting Python project right here on your Windows machine!&lt;/p&gt;
&lt;p&gt;The truth is, a large number of people have put in innumerable hours making Python drive smooth like a Cadillac on Windows,
so if you find yourself using and enjoying it, the next time someone tells you to abandon all hope and install Linux/WSL,
be sure to point them at this article! Maybe if we change some minds we can help bring more Pythonistas into the incredibly
awesome Python community!&lt;/p&gt;
&lt;p&gt;Please feel free to leave comments with any questions, or hit me up on 
&lt;a href="https://cybre.space/@feoh"&gt;Mastodon&lt;/a&gt; or &lt;a href="https://twitter.com/feoh"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'd love to hear from you!&lt;/p&gt;</description><category>development</category><category>geekery</category><category>newbie</category><category>python</category><category>setup</category><category>windows</category><category>winget</category><guid>https://www.feoh.org/posts/getting_started_with_python_on_windows_2021_edition_push_the_easy_button.html</guid><pubDate>Sat, 06 Nov 2021 05:45:00 GMT</pubDate></item></channel></rss>