Python Setup on Windows 10
Installing Python on Windows
- Click here to go to Python’s download page.
- Download and launch the latest version of the Python installer.
- Select “Add Python –version– to PATH”.
- Select a customized installation location for easier access to the Python folder.
- Install and let the setup complete.
Checking if Python is Installed Correctly
- Open the file ‘IDLE (Python –version–)’.
- Type in ‘print(“Hello World”)’. If the shell outputs ‘Hello World’, then Python is installed correctly.
- You can also open the Windows Command Prompt and write ‘python - -version’. If the version is displayed, then Python installed correctly.
Setting up the Atom Environment
A good editor for writing Python code is Atom. To download, install and setup Atom as your Python editor, follow these steps below:
- Click here to go to Atom’s download page.
- Download and launch the latest version of Atom.
- Click on File –> Settings –> Install
- Search and install the ‘Script’ package by rbgkrk. This will allow Python code to run on your Atom editor.
- You can also install other packages and themes for QoL improvements.
- Type in your Python code and press ‘CTRL+SHIFT+B’ to run it.
NOTE: While Atom editor can run basic scripts, it can not take input from the user unless you are able to find the correct packages.
Running a Python File
When you’ve written your code in a file such as example.py, you can do the following steps to run it:
- Shift click on the Windows folder where the file exists.
- Select from the drop-down list “Open Powershell window here”.
- Type “**python example.py” to run the file.
Installing ‘pygame’ Package
- After Python has installed successfully, open the Windows Command prompt and type in: pip install pygame
- After it downloads, type python in the Command Window.
- Then type in import pygame. If it successfully shows the version of the pygame package, then it has installed successfully.
NOTE: pip is the Python package manager.