Anyone can Code

Python is one of the most beautiful and productive programming languages out there. It is free for everyone to use, extremely powerful, and is in extremely high demand!

This is an easy guide for learning Python. In my opinion, you don’t need more than this guide to get started with Python. Once you get familiar with the syntax you can dig deeper on your own.

In fact, my attitude towards programming consists of the following two steps:

Articulate what you want to accomplish (e.g. I need to sort this array)
google it! (e.g. how to sort an array in Python?)
As an engineer, programming languages are fundamental tools in my arsenal to tackle research problems. But they are only a means to an end. Therefore, I am happy to learn programming by mimicking what other professional programmers and software developers do. That’s why google is your best friend.

Why Python?

Python is a modern programming language that is very easy to use. Python promotes productivity and a clear focus on accomplishing the tasks at hand.

In an age of extreme technology and unsurpassed information exchange, it is unacceptable for a modern engineer to NOT know a programming language. Python stands among the easiest and most enjoyable programming languages out there.

If there’s ever an example of why someone needs to learn programming, here it is:

First: Obtaining Python

My favorite way of obtaining python is to download the Anaconda distribution: http://www.anaconda.com. Once you install it, Python mysteriously resides on your computer.

Executing Python Code

There are a few ways you can run Python:

  1. Write your code in a text file with the extension py. Then from the terminal type python myPythonCode.py
  2. Use one of the editors that ship with python. Anaconda ships with Spyder. Another famous editor is calledPyCharm. Using these editors (actually Integrated Development Environments, IDEs), you can write code and execute it on the spot.
  3. Use Jupyter Notebook. This my favorite approach as it allows you to write Python code from within your browser and mix it with text and equation. Simply open up a terminal (command prompt on windows) and type jupyter notebook. Or open up the anaconda navigator that was installed on your system and look for Jupyter Notebook

For more information on jupyter notebooks, please see this guide by Prof. James Sutherland.

Next Article: Core Python