By Kevin Hou
2 minute read
First download Python from the Python website. After installing, you can install other helpful tools including Pip. Save the file as a Python file (extension: ".py") and navigate to the file in your terminal. Run the Python script using your terminal to install:
1$ python get-pip.py 2
In order to install globally you may to run a "sudo" install:
1$ sudo python get-pip.py 2
1$ sudo pip install requests 2
The entire Python setup was surprisingly easy. I had never programmed in Python before and only knew that it was good for backend scripts. I really wanted to expand my coding knowledge so I decided to take up Python. Here are some useful "projects" that got me going:
This project helped me gain a better understanding of how Python can communicate with the user via the Terminal interface. Reference: http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console
1for i in range(100): 2 time.sleep(1) 3 sys.stdout.write("\r%d%%" % i) 4 sys.stdout.flush() 5
This was great way for me to learn how Python data structures worked. It helped me gain a good foundation in simple variable types as well as how to communicate between different programming languages. For example, Javascript often sends data in the form of a JSON object. By doing this project I was able to pass data from my Javascript into my Python script and vice versa. Reference