Python is a high level programing language. As it is simple and easy to learn it is an ideal language for learning how to program. As python is powerful and comes with many utilities it is also used by many professional programers.
Python is a high level programing language. As it is simple and easy to learn it is an ideal language for learning how to program. As python is powerful and comes with many utilities it is also used by many professional programers.
Once you install python and PIP you can install most other packages with this installer. If you install multiple versions of python make sure you know how to run it and add packages to it.
One of the easiest options is to install AnaConda, a python package manager.
You can download the latest version of python from the Python Website and manually install the SciPy, NumPy and the other packages.
An alternative is to install Enthought Canopy which includes NumPy, SciPy, iPython and Matplotlib.
The installation is quite large (400MB) and you also have to install PyFits and PyGame (see links below)
Make sure you download the academic (free) license.
The easiest is to install AnaConda, a full python installation independent of the python you already have on your system.
If you are using a different package manager such as HomeBrew, MacPorts or the Fink Installer, use it to install python, SciPy, matplotlib, ipython, astropy, darepype, pygame and jupyter packages.
Another option is to install Enthought Canopy which includes NumPy, SciPy, iPython and Matplotlib.
The installation is quite large (400MB) and you also have to install PyFits and PyGame (see links below)
Make sure you download the academic (free) license.
For various versions of Linux (Ubuntu, Debian, . . . ) use the included package manager or get the packages from the sites below.
For Ubuntu, you will need to get the following packages: python-matplotlib, python-pygame, python-scipy, ipython and python-pyfits.
Another option is to install AnaConda, a different full python installation, but make sure this doesn't conflict with your current python installation.
You can also install python in a container or a virtual machine to make sure it is portable and doesn't affect the rest of your system.
Docker: An introduction to install python in Docker is at the Jupyter Notebook Tutorial.
If you have problems installing it - first search the website of the package you are trying to install or just enter the error message into your favorite search engine.
The official Python documentation can be found at http://docs.python.org. This page is very comprehensive but not for beginners as it can get a little technical.
A basic good and short python tutorial is under http://www.sthurlow.com/python/.
The Hitchhiker's Guide to Python under docs.python-guide.org has extensive but good tutorials how to use the language.
The REALPYTHON page at realpython.com has excellent tutorial for basic python and most python libraries for beginners and advanced programmers.
See links below for tutorials for jupyter and colab.
Libraries are add-ons to the python language that provide additional functionality. There are libraries for making plots and images, to do efficient calculations, to create sounds and games, even to access websites like facebook.
To install the packages use your package manager (conda, apt, dpg, port . . . ) or the pip command.
Numpy / Scipy: These libraries will greatly simplify working with data and images. The homepages are at http://www.numpy.scipy.org/ and http://www.numpy.scipy.org/. On that page you can find documentation as well as tutorials.
A good tutorial for data analysis with Numpy and Scipy (also matplotlib and pyfits) can be found under http://scipy.org/Additional_Documentation/Astronomy_Tutorial. This tutorial is primarily written for astronomers but is also useful for general programers.
Matplotlib / Pylab: This is THE library for making plots of curves and images. The documentation and many useful examples can be found at http://matplotlib.sourceforge.net/.
Jupyter Matplotlib Tutorial: Will teach you all about making plots in matplotlib (even if you're not using jupyter).
Tkinter: To program a GUI (Graphical User Interface) in python you want to use this library. The website http://infohost.nmt.edu/tcc/help/pubs/tkinter/index.html is invaluable when it comes to Tkinter. A good Tkinter tutorial is at http://www.pythonware.com/library/tkinter/introduction/.
PyFITS: To read and write FITS files pyfits is the library to use. The homepage for this library is at http://www.stsci.edu/resources/software_hardware/pyfits. You can learn pyfits by going through the Numpy and Scipy tutorial for data analysis mentioned above.
PyGame: Do you want to program a computer game? Pygame is the library for you. The pygame home page at http://pygame.org/news.html contains documentation, tutorials and examples.
Speechd: http://www.sethanil.com/python-for-friends/11: This webpage has a great tutorial on using the Python text-to-speech module speechd
The old Yerkes Python Tutorials are on bussard under http://bussard.yerkes.uchicago.edu/Outreach/ActivityPython you can login using your own credentials or use the login name YaaysVisitor and the key yaays2008.
Installation: Jupyter notebook comes installed with Anaconda by default. On unix systems (Mac or Linux) you can use your package installer or use pip. More information on installing jupyter is at jupyter.readthedocs.io/en/latest/install.
For Colab no installation is required. Use your google account to log into colab.research.google.com and start programming. If you have never used colab before
Warning: If you have never used colab before, you will have select "Connect to more Apps" on your google drive and search for "Colab" to set it up for you.
Tip: To find your colabs make a new colab from your google drive.
Startup: You can start jupyter notebook for most systems you go to a terminal and type
jupyter-notebook-3.8
(or whichever version you have installed, use <tab> completion if you're unsure)
For Anaconda go to the Anaconda main page and run jupyter notebook from the menu.
Jupyter / Colab Tutorials: There are several good colabs / jupyter notebooks to learn from:
LENSS Tutorials Folder: has the BasicColabIntro. Go through this to get an overview of python and Colab.
Jupyter Notebook Tutorial: Definitive Guide: A good introduction to Jupyter Notebook and the user interface for Jupyter and Colab.
Jupyter Notebooks for Beginners: A tutorial with a good introduction of the interface and few data analysis examples.
Getting Started With Google Colab: A high level introduction for data analysis.
A-gallery-of-interesting-Jupyter-Notebooks: has several notebooks for every field including good tutorials.
Conda is a package manager which is mostly used to install the Anaconda python distribution.
Getting started with Conda: conda.io/projects/conda/en/latest/user-guide/getting-started.html
Conda cheat sheet: conda.io/projects/conda/en/latest/user-guide/cheatsheet.html
Conda user guide: conda.io/projects/conda/en/latest/user-guide/index.html
These versions of python run on microcontrollers such as advanced Arduinos with the M0, M4, ESP32 or ESP8266 processors. We have several circtuitpython devices at GLAS and in the MIELab, see the Electronics page for details.
Adafruit Circuitpython Introduction Page tells you about circuitpython and as a good list of tutorials.
Circuitpython Essentials: Has information on how to get things done with circuitpython; how to read / write to a digit
Circuitpython Documentation: Comprehensive information on circuitpython.
MicroPython Documentation: Best reference on MicroPython
Print Formatting: use enscript to make a printable (.ps) file from your code:
enscript -2rjEpython -o myfile.ps myfile.py
then you can print the .ps file or use ps2pdf to change it into a pdf.