<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hello world Python &#8211; cybogeek.com</title>
	<atom:link href="https://cybogeek.com/tag/hello-world-python/feed/" rel="self" type="application/rss+xml" />
	<link>https://cybogeek.com</link>
	<description>Explore, Develop, Safeguard</description>
	<lastBuildDate>Tue, 05 May 2026 06:59:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://cybogeek.com/wp-content/uploads/2025/09/cropped-cybogeek-ico-1x-32x32.png</url>
	<title>hello world Python &#8211; cybogeek.com</title>
	<link>https://cybogeek.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Run Your First Python Script on Windows (Complete Beginner&#8217;s Guide)</title>
		<link>https://cybogeek.com/how-to-run-your-first-python-script-on-windows-complete-beginners-guide/</link>
		
		<dc:creator><![CDATA[Sukanto]]></dc:creator>
		<pubDate>Tue, 05 May 2026 06:57:29 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[coding basics]]></category>
		<category><![CDATA[Command Prompt]]></category>
		<category><![CDATA[first Python program]]></category>
		<category><![CDATA[hello world Python]]></category>
		<category><![CDATA[Python beginner]]></category>
		<category><![CDATA[Python script]]></category>
		<category><![CDATA[Python setup]]></category>
		<category><![CDATA[Python tutorial]]></category>
		<category><![CDATA[run Python]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://cybogeek.com/?p=493</guid>

					<description><![CDATA[Running your first Python script is one of those moments you will remember. It is the point where Python stops being something you read about and starts being something you do. Suddenly, the code in your text editor becomes real output on your screen — and that feeling is genuinely exciting. This guide walks you [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Running your first Python script is one of those moments you will remember. It is the point where Python stops being something you read about and starts being something you <em>do</em>. Suddenly, the code in your text editor becomes real output on your screen — and that feeling is genuinely exciting.</p>
<p>This guide walks you through every step of writing, saving, and running a Python script on Windows, including multiple methods, common mistakes beginners make, and where to go from here. Whether you are a student, a curious hobbyist, or someone switching careers into tech, this tutorial is written with you in mind.</p>
<hr />
<h3>Before You Begin: What You Need</h3>
<p>You will need Python installed on your Windows computer. If you have not done this yet, head over to <a href="https://www.python.org/downloads/" target="_blank" rel="noopener">python.org/downloads</a> and grab the latest stable version. During installation, make sure to check the box that says <strong>&#8220;Add Python to PATH&#8221;</strong> — this is the most common setup mistake beginners make, and skipping it causes problems we will cover in the troubleshooting section below.</p>
<p>If you haven&#8217;t installed Python, follow  our <a href="https://cybogeek.com/how-to-install-python-on-windows-without-confusion-beginner-guide/" target="_blank" rel="noopener"><strong>Complete Python Installation Guide</strong></a></p>
<p>You also need a text editor. Here are your three best options:</p>
<ul>
<li><strong>Notepad</strong> — Already on your PC, no installation required. Fine for a quick start.</li>
<li><strong>VS Code (Visual Studio Code)</strong> — Free, powerful, and what most professional developers use. Recommended for anyone serious about learning Python.</li>
<li><strong>IDLE</strong> — Comes bundled with Python automatically. Simple and beginner-friendly.</li>
</ul>
<p>There is no wrong choice here. Pick whichever one feels most comfortable and get started.</p>
<hr />
<h3>Step 1: Write Your First Python Program</h3>
<p>Open your text editor and type the following two lines exactly as shown:</p>
<pre><code class="language-python">print("Hello, World!")
print("Your first Python script is running!")
</code></pre>
<p>That is your entire first program. Two lines. Simple — but do not underestimate it.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-495" src="https://cybogeek.com/wp-content/uploads/2026/05/first-python-program.png" alt="first-python-program" width="779" height="139" srcset="https://cybogeek.com/wp-content/uploads/2026/05/first-python-program.png 779w, https://cybogeek.com/wp-content/uploads/2026/05/first-python-program-300x54.png 300w, https://cybogeek.com/wp-content/uploads/2026/05/first-python-program-768x137.png 768w" sizes="(max-width: 779px) 100vw, 779px" /></p>
<h4>What is <code>print()</code> and why does it matter?</h4>
<p>The <code>print()</code> function is one of the most used tools in Python. It tells Python to display whatever is inside the parentheses on the screen. The text inside the quotation marks is called a <strong>string</strong> — a sequence of characters Python treats as plain text.</p>
<p>When you run this script, Python reads line 1, prints the first message, then reads line 2, prints the second message, and stops. Python executes code from top to bottom, one line at a time. This is called <strong>sequential execution</strong>, and it is one of the fundamental concepts behind all programming.</p>
<p>If you want, try adding a third line:</p>
<pre><code class="language-python">print("I am learning Python!")
</code></pre>
<p>Python will print all three messages in order. This is your first experience with how programs actually work.</p>
<hr />
<h3>Step 2: Save the File Correctly</h3>
<p>This step trips up more beginners than any other. Pay close attention.</p>
<p>Go to <strong>File &gt; Save As</strong> in your text editor and follow these rules:</p>
<ol>
<li>Name the file <code>hello.py</code> — the <code>.py</code> extension tells Windows (and Python) that this is a Python script.</li>
<li>Save it somewhere you can easily find. A folder called <code>PythonProjects</code> inside your Documents folder is a great habit to start early. You could also save to the Desktop for now.</li>
<li>In Notepad specifically, change <strong>&#8220;Save as type&#8221;</strong> from <code>Text Documents (*.txt)</code> to <code>All Files (*.*)</code> before saving. Otherwise Notepad silently saves it as <code>hello.py.txt</code>, which will not run as a Python script.</li>
</ol>
<h4>How to check your file was saved correctly</h4>
<p>Open File Explorer and navigate to where you saved the file. If you see <code>hello.py</code> with a Python logo icon, you are good. If you see <code>hello.py.txt</code>, you need to rename it.</p>
<p><strong>Quick fix for hidden extensions:</strong> Windows hides file extensions by default. To turn this off, open File Explorer, click the <strong>View</strong> tab at the top, and check the box labeled <strong>&#8220;File name extensions&#8221;</strong>. Now you can see the real name of every file on your computer — a useful habit for any developer.</p>
<hr />
<h3>Step 3: Open Command Prompt or PowerShell</h3>
<p>The command line is where you actually run Python scripts. It looks intimidating at first, but you will be comfortable with it after a few minutes.</p>
<p><strong>How to open Command Prompt:</strong></p>
<ul>
<li>Press the <strong>Windows key</strong>, type <code>cmd</code>, and press Enter.</li>
<li>Or press <strong>Windows key + R</strong>, type <code>cmd</code>, and press Enter.</li>
</ul>
<p><strong>How to open PowerShell:</strong></p>
<ul>
<li>Press the <strong>Windows key</strong>, type <code>PowerShell</code>, and press Enter.</li>
</ul>
<p>Both work fine for running Python scripts. Command Prompt is slightly simpler; PowerShell is more powerful. Either is fine for what we are doing here.</p>
<p>You will see a black window with a blinking cursor. This is the <strong>terminal</strong> — a text-based interface for talking directly to your computer. It is the same kind of tool that developers all over the world use every day.</p>
<hr />
<h3>Step 4: Navigate to Your Script&#8217;s Folder</h3>
<p>The terminal starts in a default location, usually your user folder (something like <code>C:\Users\YourName</code>). You need to navigate to the folder where you saved <code>hello.py</code>.</p>
<p>The command you use is <code>cd</code>, which stands for <strong>change directory</strong>. Here are examples:</p>
<p>If you saved your file on the Desktop:</p>
<pre><code class="language-bash">cd Desktop
</code></pre>
<p>If you saved it in a PythonProjects folder inside Documents:</p>
<pre><code class="language-bash">cd Documents\PythonProjects
</code></pre>
<p>If you ever get lost, you can always type <code>cd %USERPROFILE%</code> to return to your home folder and start again.</p>
<h4>Confirm you are in the right place</h4>
<p>Once you navigate to the folder, type this command and press Enter:</p>
<pre><code class="language-bash">dir
</code></pre>
<p>This lists every file in the current folder. If you see <code>hello.py</code> in the list, you are in exactly the right place. If you do not see it, you are in the wrong folder — use <code>cd</code> again to find it.</p>
<hr />
<h3>Step 5: Run the Script</h3>
<p>This is the moment everything comes together. Type the following command and press Enter:</p>
<pre><code class="language-bash">python hello.py
</code></pre>
<p>Your terminal should display:</p>
<pre><code>Hello, World!
Your first Python script is running!
</code></pre>
<p><img decoding="async" class="aligncenter size-full wp-image-496" src="https://cybogeek.com/wp-content/uploads/2026/05/first-python-program-output.png" alt="first-python-program-output" width="757" height="166" srcset="https://cybogeek.com/wp-content/uploads/2026/05/first-python-program-output.png 757w, https://cybogeek.com/wp-content/uploads/2026/05/first-python-program-output-300x66.png 300w" sizes="(max-width: 757px) 100vw, 757px" /></p>
<p><strong>Congratulations.</strong> You just ran your first Python program. Your setup is working correctly, and you have taken a real step into software development.</p>
<hr />
<h3>Alternative Ways to Run Python Scripts</h3>
<p>The command line is not the only option. Here are three other methods, each with its own advantages.</p>
<h4>Method 1: Using IDLE (Best for Beginners)</h4>
<p>IDLE is Python&#8217;s built-in editor and is perfect if you want a simple, distraction-free environment.</p>
<ol>
<li>Press the Windows key and search for <strong>IDLE</strong>.</li>
<li>Open it. You will see the Python Shell — a place where you can type Python code directly.</li>
<li>Go to <strong>File &gt; Open</strong> and select your <code>hello.py</code> file.</li>
<li>Press <strong>F5</strong> (or go to <strong>Run &gt; Run Module</strong>).</li>
</ol>
<p>The output appears in the Shell window at the bottom. IDLE also highlights your code in different colors (called <strong>syntax highlighting</strong>), making it easier to read and spot mistakes.</p>
<h4>Method 2: Using VS Code (Best for Serious Learning)</h4>
<p>VS Code is the industry-standard editor for Python development. It is more complex than IDLE but far more powerful, and learning it now will pay off later.</p>
<ol>
<li>Download VS Code from <a href="https://code.visualstudio.com/" target="_blank" rel="noopener">code.visualstudio.com</a>.</li>
<li>Install the <strong>Python extension</strong> (you will be prompted on first launch, or search for &#8220;Python&#8221; in the Extensions panel).</li>
<li>Open your project folder: <strong>File &gt; Open Folder</strong> and select your <code>PythonProjects</code> folder.</li>
<li>Click on <code>hello.py</code> in the sidebar to open it.</li>
<li>Press <strong>Ctrl+F5</strong> or click the <strong>Run Python File</strong> button (the play icon in the top-right corner).</li>
</ol>
<p>VS Code runs the script and shows the output in a built-in terminal panel at the bottom. You also get autocomplete suggestions, error highlighting, and a debugger — tools that become invaluable as your programs grow.</p>
<h4>Method 3: Double-Clicking the File</h4>
<p>You can right-click <code>hello.py</code> in File Explorer and choose <strong>Open with &gt; Python</strong>. A terminal window will open, run the script, and then close immediately — often too fast to read.</p>
<p>To keep the window open long enough to see the output, add this line at the very end of your script:</p>
<pre><code class="language-python">input("Press Enter to close...")
</code></pre>
<p>This pauses the program and waits for you to press Enter before the window closes. It is a quick fix, but for most learning purposes, using the terminal or VS Code is a better habit to develop.</p>
<hr />
<h3>Troubleshooting Common Problems</h3>
<h4>&#8220;Python is not recognized as an internal or external command.&#8221;</h4>
<p>This means Python is not in your system&#8217;s PATH — Windows does not know where Python is installed.</p>
<p><strong>Quick fix:</strong> Try using <code>py</code> instead of <code>python</code>:</p>
<pre><code class="language-bash">py hello.py
</code></pre>
<p><strong>Permanent fix:</strong> Reinstall Python from <a href="https://python.org/" target="_blank" rel="noopener">python.org</a> and make sure to check <strong>&#8220;Add Python to PATH&#8221;</strong> during installation. After reinstalling, restart Command Prompt and try again.</p>
<h4>&#8220;No module named&#8230;&#8221;</h4>
<p>This error usually means one of two things. Either you are in the wrong folder (so Python cannot find your file), or you are trying to use an external library that has not been installed yet.</p>
<p>For our simple<code>hello.py</code>, this should not happen. If it does, type <code>dir</code> to list the files in your current folder and confirm <code>hello.py</code> if it&#8217;s there. If not, use <code>cd</code> to navigate to the correct location.</p>
<h4>The terminal window opens and closes instantly</h4>
<p>This happens when you double-click a <code>.py</code> file. The script runs and finishes in a fraction of a second, and Windows closes the terminal. Add <code>input("Press Enter to close...")</code> to the end of your script to pause it, or use the command line method instead — which gives you full control.</p>
<h4>The output shows an error in red text</h4>
<p>Red text means Python found a problem in your code. Read the error message carefully — Python error messages are actually quite informative once you learn to read them. Common causes include:</p>
<ul>
<li>A missing closing quote: <code>print("Hello, World!</code> — notice no closing <code>"</code></li>
<li>Wrong capitalization: <code>Print("Hello")</code> instead of <code>print("Hello")</code> — Python is case-sensitive</li>
<li>Missing parentheses: <code>print "Hello"</code> — valid in older Python 2, but not in Python 3</li>
</ul>
<hr />
<h3>Understanding What Just Happened (The Bigger Picture)</h3>
<p>When you typed <code>python hello.py</code> and pressed Enter, several things happened behind the scenes:</p>
<ol>
<li>Windows found the Python program installed on your computer.</li>
<li>Python opened and read your <code>hello.py</code> file.</li>
<li>Python translated your human-readable code into instructions the computer can execute.</li>
<li>The computer executed those instructions and sent the output to your screen.</li>
</ol>
<p>This process is called <strong>interpretation</strong> — Python reads and runs your code line by line, without first compiling it into a separate file the way some other programming languages do (like C++ or Java). This is one reason Python is so beginner-friendly: the feedback loop between writing code and seeing results is almost instant.</p>
<hr />
<h3>What to Do Next</h3>
<p>Now that your setup is confirmed and you understand how running a script works, here are five things to try immediately:</p>
<p><strong>1. Change the message.</strong> Edit <code>hello.py</code>, change the text inside the quotes, save, and run again. Get comfortable with the edit-save-run loop.</p>
<p><strong>2. Add more print lines.</strong> Try printing your name, your age, your favorite movie — anything. See how each line appears in order.</p>
<p><strong>3. Use the <code>input()</code> function.</strong> Replace your second print line with:</p>
<pre><code class="language-python">name = input("What is your name? ")
print("Hello, " + name + "!")
</code></pre>
<p>This makes your program interactive. The user types a name, and Python greets them by name. You have just written your first program with user input.</p>
<p><strong>4. Experiment with math.</strong> Python is a calculator too. Try:</p>
<pre><code class="language-python">print(2 + 2)
print(10 * 5)
print(100 / 4)
</code></pre>
<p>No quotes needed for numbers — Python handles them differently from text.</p>
<p><img decoding="async" class="aligncenter size-full wp-image-497" src="https://cybogeek.com/wp-content/uploads/2026/05/python-program-test.png" alt="python-program-test" width="756" height="357" srcset="https://cybogeek.com/wp-content/uploads/2026/05/python-program-test.png 756w, https://cybogeek.com/wp-content/uploads/2026/05/python-program-test-300x142.png 300w" sizes="(max-width: 756px) 100vw, 756px" /></p>
<p><strong>5. Make your first mistake on purpose.</strong> Delete a closing quote or misspell <code>print</code>. Run the script. Read the error message. Getting comfortable with Python&#8217;s error messages is one of the fastest ways to become a better programmer.</p>
<hr />
<h4>Final Thoughts</h4>
<p>Writing and running your first Python script is a simple act with a significant meaning. It proves your environment is set up correctly, teaches you how the terminal works, and gives you a concrete foundation to build on.</p>
<p>From here, every Python concept you learn — variables, loops, functions, libraries, web scraping, data analysis, automation — will be built on top of this exact workflow: write code, save the file, run the script, see the result.</p>
<p>The gap between a beginner and a confident Python developer is just practice. And practice starts with <code>python hello.py</code>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: cybogeek.com @ 2026-05-05 14:56:26 by W3 Total Cache
-->