First a note on the programs we will be using:
Python is programming language. It is:
Miniconda includes Spyder a user interface for programming with Python. Python allows you to see the programs you have created, the results of those programs, and variables lists and graphs - all at the same time.
So: Python is the programming language we will use, Spyder is the interface that will allow us to interact with Python, and Miniconda is the management system that will make it easier to install and work with any additional packages we may need to use.
While I suggest most of you install Miniconda, if you think you might go deeper into Python programming after the class is over and you have the space on your computer to install 3 GB of programs, you may want to install the full Anaconda package.
More information is below. (From the documentation)
Choose Anaconda if you:
- Are new to conda or Python
- Like the convenience of having Python and over 150 scientific packages automatically installed at once
- Have the time and disk space (a few minutes and 3 GB), and/or
- Don’t want to install each of the packages you want to use individually.
Choose Miniconda if you:
- Do not mind installing each of the packages you want to use individually.
- Do not have time or disk space to install over 150 packages at once, and/or
- Just want fast access to Python and the conda commands, and wish to sort out the other programs later.
if not installed, Follow directions for installing Miniconda here (Mac) and here (all - Mac/Windows/Linux)..
Open Spyder (type “which spyder” in the Mac terminal or “where spyder” in the Windows terminal to find out where it is).
Place Spyder in your start menu or taskbar so that you can easily find it next time.
In the editor window, type in the following: (link: os package)
# hashtags represent comments. These are for human eyes only. The computer will not read these.
## first import the package "os," which will allow us to move between different folders on our computers.
import os
## set the "working directory": the folder you will be using.
os.chdir([path where your folder is located]) ##i.e. "C:/Users/yourName/498/Python" (include quotes)
print("Hello World!")
Save)
Congrats, you have written your first program!