Why Python and Setting It Up
Why Python and Setting It Up
Why Python Is a Great First Language
Python is one of the most popular programming languages in the world, and for good reason. It reads almost like plain English, so beginners can focus on problem solving instead of fighting with symbols. It also works everywhere: Windows, macOS, and Linux. The same script you write on a laptop runs on a server, a data pipeline, or even a small embedded device.
Python has a massive standard library plus thousands of free third-party packages for web development, data science, machine learning, and automation. Chances are, whatever you want to build, someone has already published a library that moves you forward.
Installing Python
Go to the official Python website and download the installer for your operating system. On Windows, tick the checkbox that says Add Python to PATH during installation. That step lets you run the python command from any terminal. On macOS you can use the official installer or Homebrew with brew install python.
After installation, open a terminal (Command Prompt on Windows) and type:
python --version
pip --version
The first command shows the Python version, and the second confirms the package installer is ready. If both print a version number, your environment is working.
Running Code Two Ways
You can run Python in two ways. The first is the interactive REPL, where code executes line by line as soon as you type it. Start it by typing python with no arguments.
The second way is to write a file. Create a file named hello.py with any text editor, then run it from the terminal with python hello.py.
print("Hello, GroovyGrails!")
The print function writes text to the screen. Notice we used double quotes around the string, which Python treats as a sequence of characters.
Choosing a Text Editor
Any text editor works, but a proper editor makes learning easier. VS Code with the Python extension offers syntax highlighting, autocompletion, and a built-in terminal. Alternatives include PyCharm, Sublime Text, and the simple editor that ships with Python's installer (IDLE). Start with whatever feels comfortable; the language matters more than the tool.
Key Points
- Python is beginner-friendly, cross-platform, and backed by a huge ecosystem.
- Install Python and make sure python and pip are available in your terminal.
- Test your setup with python --version and pip --version.
- Run code interactively in the REPL or from a .py file with python file.py.
- Pick a code editor with highlighting and autocomplete, but do not obsess over it.