0 added
0 removed
Original
2026-01-01
Modified
2026-02-21
1
<p>We'll start this course by setting up Python. It can be downloaded and installed from the [official Python website] (<a>https://www.python.org/downloads/</a>), but it is better to do this using a package manager.</p>
1
<p>We'll start this course by setting up Python. It can be downloaded and installed from the [official Python website] (<a>https://www.python.org/downloads/</a>), but it is better to do this using a package manager.</p>
2
<p>To begin, open a terminal and run the command appropriate for your operating system:</p>
2
<p>To begin, open a terminal and run the command appropriate for your operating system:</p>
3
<ul><li><p>The command for Ubuntu or Ubuntu on Windows (WSL) is:</p>
3
<ul><li><p>The command for Ubuntu or Ubuntu on Windows (WSL) is:</p>
4
</li>
4
</li>
5
<li><p>Command for MacOS is:</p>
5
<li><p>Command for MacOS is:</p>
6
</li>
6
</li>
7
</ul><p>Now is a time to make sure Python is installed and properly working. To do this, type python3 --version in a terminal. The output should look like this:</p>
7
</ul><p>Now is a time to make sure Python is installed and properly working. To do this, type python3 --version in a terminal. The output should look like this:</p>
8
<p>Make sure you have at least 3.8 installed.</p>
8
<p>Make sure you have at least 3.8 installed.</p>
9
<p>To learn successfully, you need to practice. Type out all the code from the tutorial and run it locally. It is the only way to understand what is going on.</p>
9
<p>To learn successfully, you need to practice. Type out all the code from the tutorial and run it locally. It is the only way to understand what is going on.</p>
10
<p>In cases where an interactive interpreter isn't enough, we should run code as files. To do this, create a file with any name and a .py extension, and then run it:</p>
10
<p>In cases where an interactive interpreter isn't enough, we should run code as files. To do this, create a file with any name and a .py extension, and then run it:</p>
11
<p>We should run the code from the same directory as the main.py file. If you don't start from the same directory, you need to specify the path to the file.</p>
11
<p>We should run the code from the same directory as the main.py file. If you don't start from the same directory, you need to specify the path to the file.</p>
12
<h2>The pyenv utility</h2>
12
<h2>The pyenv utility</h2>
13
<p>A completely different way to install Python is to use the<a>pyenv</a>utility (for Windows users, you will need a specific version of the utility -<a>pyenv-win</a>).</p>
13
<p>A completely different way to install Python is to use the<a>pyenv</a>utility (for Windows users, you will need a specific version of the utility -<a>pyenv-win</a>).</p>
14
<p>In addition to installing any version of Python, this utility allows you to switch between versions easily. It may be convenient if you're working on several projects that require you to use different versions of Python at the same time.</p>
14
<p>In addition to installing any version of Python, this utility allows you to switch between versions easily. It may be convenient if you're working on several projects that require you to use different versions of Python at the same time.</p>