This page is here to help you get set up on your local machine. These are very important tools we use at Umuzi and eventually at the workplace.
Setting up your environment needs you to to install a bunch of stuff. A good programmer knows their stuff, knows what they are installing and doesn’t just jump into code. You will need the following:
The terminal is an interface in which you can type and execute text based commands. It can be much faster to complete some tasks using a Terminal than with graphical applications and menus. Another benefit is allowing access to many more commands and scripts. A common terminal task of installing an application can be achieved within a single command, compared to navigating through the Software Centre or Synaptic Manager. Press Ctrl + Alt + T to open the terminal when using Ubuntu/Linux-mint
There are 2 ways of running python that you should care about right now. The first way is pretty easy. Just open up a terminal end enter the command python3
. This will open up a thing called a REPL. Basically it lets you just type in python commands and then it executes things. This is really useful if you just want to quickly calculate something or try out a piece of code.
Of course if you’ve written some awesome code you would want to save it somewhere so you can run it whenever you want. For now let’s assume you don’t know your way around linux (if you do, that’s cool. But for now we’ll keep it simple). Try this out:
print("Welcome to Umuzi!")
hellp.py
in your home directory (directory means folder). Now open up a terminal and type in python3.7 hello.py
code
. code is an alias created by the terminal as a short cut for the program.code hello.py
. This opens your file in VScode.You can also open up a whole directory in vscode (this is really useful when you start working on real stuff). Try this out in a terminal:
mkdir python_practice
# this command makes a new directorymv hello.py python_practice/hello.py
# this moves the file you made beforeYou could achieve the stuff above ^^ by using the graphical user interface (the file browser) but where’s the fun in that?
Now execute this: code python_practice