Advices to start learning Python¶
To start learning Python, I recommend…¶
Wait, what is Python?
A very popular, free and open-source programming language. Python is also multi-platform, simple to learn, write and read.
The Anaconda installer, which basically allow you to install « everything » need to work with Python, in one click (you just have to download one big file, almost 400 Mo, and it’s free), on Windows, Linux or Mac OS. Canopy (by Enthougt) is another excellent one-click installer, see this video:
To write and execute your Python program, the Spyder editor (with IPython) is a truly brilliant software. Especially to use Python for numerical computation or scientific programming. The user interface is really similar to the one offered by MATLAB or Octave (program on the left, output on the right, one big green button to click to execute the program etc), and the entire software is extremely well designed and written. Only the help research tool is (slightly) less efficient than the one provided in MATLAB, but everything else seems (objectively) as good or better in Spyder than in MATLAB. And a simple Internet request (with DuckDuckGo of course, and not Gouuugle) works really fine in general.
I also strongly recommend to try Notebooks Jupyter which gives a very nice web-based (in browser) interface to edit Python (among a hundred other languages). You can try here: https://jupyter.org/try.
A more complete editor for Python is the industry-strong PyCharm by JetBrains, less easy to manipulate and learn but PyCharm is very powerful!
Other good editors include Visual Studio Code (my new favorite!), Sublime Text, GNU Emacs or vi/vim/gvim/neovim etc. Each have excellent support for Python (with all the features you could dream of), after installing a certain package or group of packages (or plugin or extensions, they have different names but the same meaning).
In order to learn Python, the fundamentals are well taught here (and in the next pages). Do not worry, if you already have some programming experience, the syntax and concepts in Python are quite similar to other languages, you will learn easily.
If you are new to programming or not familiar, you can use for free the awesome PythonTutor.com website to visualize your program and its execution.
To use Python for « numerical science », the de facto standard is the combination of NumPy/SciPy and MatPlotLib. All these packages (also called modules) are installed by default with Anaconda, and is fully functional right out-of-the-box after having installed Python. This good tutorial explains how to start using NumPy/SciPy, and another one teach how to use MatPlotLib for scientific plotting (was written by two French professor of the Labri !). The page « NumPy for MATLAB Users » can be extremely useful if you already know MatLab. Finally, this free e-book (« Python Scientific Lecture Notes ») is an excellent reference : https://scipy-lectures.github.io/. This online course gives many details on how to learn using Python as a replacement for MATLAB (on RealPython.com).
A really good website to learn weekly tips about Python is the blog Real Python.
This other article is an excellent presentation about how to learn Python: dataquest.io/blog/learn-python-the-right-way.
MATLAB is a trademark of MathWorks ®. And Python is awesome!