44 lines
3.4 KiB
Markdown
44 lines
3.4 KiB
Markdown
# Getting Started with Python for DSP
|
|
|
|
In this tutorial set, I will start with a fresh installation of Windows 10. The steps should be similar, if not identical, if you are using Windows 11. If you are running macOS, please follow along as best as possible. Finally, if you are running Linux, please let me know, and I will help you.
|
|
|
|
If you run into any issues, please reach out to Aidan Sharpe via email:
|
|
|
|
[sharpe23@students.rowan.edu](mailto:sharpe23@students.rowan.edu?subject=DSP%20Help%20-%20FULL%20NAME) subject line: **DSP Help - FULL NAME**.
|
|
|
|
## The Python Language
|
|
Recall your Computer Science & Programming and Introduction to Embedded Systems classes. You are familiar with C and C++, where by compiling `.c` or `.cpp` file, you generate an executable `.exe` file. Both C and C++ are considered *compiled languages* for this reason. You can email the `.exe` file to a friend, and without any code (or even a compiler) they can run your file on their machine. When this file is executed, it runs in its own *process* on the operating system, which you can see by opening your task manager while the program is still running.
|
|
|
|
Python is *not* a compiled language. Instead, it is what we call an interpreted language. Rather than creating an executable file, the code is run line-by-line by a program called an interpreter. In the next section, we will install the Python Interpreter. Importantly, since no executable file is created, anyone who wants to run your code will have to run it with their own Python Interpreter. Additionally, unlike a compiled language, the program does not have its own OS process. In the case of Python 3, your program will run in the `python` process.
|
|
|
|
## Installing Python
|
|
Before we begin writing any code, we need to install the Python Interpreter. These installation instructions are, as noted prviously, targetted at Windows 10/11 users. If you happen to be running Linux, you probably already have a Python interpreter installed, especially if you are running a "just works" distribution such as Ubuntu or Fedora. If you happen to be running macOS, please follow the installation instructions on [python.org](https://www.python.org/downloads/macos/).
|
|
|
|
\newpage
|
|
### 1. Open the Microsoft Store
|
|
On you taskbar or "Start" menu, open the "Microsoft Store" application.
|
|
|
|

|
|
|
|
### 2. Search for "python 3.13"
|
|
In the Microsoft Store, search for "python 3.13" and click the result titled "Python 3.13". This is the interpreter and runtime we will be using.
|
|
|
|

|
|
|
|
\newpage
|
|
### 4. Click "Get"
|
|
Click the "Get" button to install the application. Wait for the installation to complete.
|
|
|
|

|
|
|
|
### 5. Verify installation
|
|
Open your "Start" menu and see if Python 3.13 and IDLE are shown.
|
|
|
|

|
|
|
|
\newpage
|
|
## Hello World
|
|
Start by opening "Python 3.13". This is the *Python Interpreter* we mentioned earlier. When run directly as an application, we are met with the *Python Shell*. Here, we can type Python code, and it will be executed as we go. For example, we can write a one-line "Hello, World" style program simply by typing `print("Hello, World!")` and hitting the enter key. The text "Hello, World!" will be printed, and we are prompted again on the following line. We can change the text inside the quotes to whatever we want, and that text will be printed out as well. Congratulations, you have run your first Python code!
|
|
|
|

|