Introduction to Python Programming - #1 Setup + Basics 01-21-2015, 03:38 PM
#1
This is a series I'll be doing as requested by @phyrrus9, and following pretty much the same pattern as his C Programming Tutorial.
Python is a general-purpose and simple, high-level programming language. It's easy to read and write, and is suitable for many small and large scale implementations. I'm not going to go into extreme detail, but enough to get you onto your own feet. After that, it's up to you to learn the language further.
In this series I will be using Python3, but there's not much difference between the two. Once you know the basics of one, it'll be trivial to switch between them. I will be doing this in Debian, but the instructions are pretty much the same for Windows.
Let's get started.
First of all, you'll need to install Python3. This shouldn't be difficult so I'll leave you to it. You can either download it from here, or use your package manager.
We'll also need a text editor. I'll be using nano:
Here's how to use nano: [link] Once you've done, open your terminal as root:
Now here's how to work with Python in Debian. First, create the file that you'll be using. The file format is '.py'.
It'll create and open the file, and let you edit the contents.
Enter the above line and then ^O. This'll write to the file. To close the file, ^X.
Then enter:
Done. Now you should understand how to work with Python in a GNU/Linux environment. The next part of this series will teach you Python from the ground up. *tips cap*
Python is a general-purpose and simple, high-level programming language. It's easy to read and write, and is suitable for many small and large scale implementations. I'm not going to go into extreme detail, but enough to get you onto your own feet. After that, it's up to you to learn the language further.
In this series I will be using Python3, but there's not much difference between the two. Once you know the basics of one, it'll be trivial to switch between them. I will be doing this in Debian, but the instructions are pretty much the same for Windows.
Let's get started.
First of all, you'll need to install Python3. This shouldn't be difficult so I'll leave you to it. You can either download it from here, or use your package manager.
We'll also need a text editor. I'll be using nano:
Code:
sudo apt-get install nanoHere's how to use nano: [link] Once you've done, open your terminal as root:
Code:
suNow here's how to work with Python in Debian. First, create the file that you'll be using. The file format is '.py'.
Code:
nano first_script.pyIt'll create and open the file, and let you edit the contents.
Code:
print("Hello, World!!!")Enter the above line and then ^O. This'll write to the file. To close the file, ^X.
Then enter:
Code:
python first_script.py
>>>Hello, World!!!Done. Now you should understand how to work with Python in a GNU/Linux environment. The next part of this series will teach you Python from the ground up. *tips cap*
















![[+]](https://sinister.li/images/modern/collapse_collapsed.png)



