This repository contains the main resources for the Computer Programming 101 course using Python at ISPA-IU.
The course is based on jupyter notebooks and divided into 2 main modules called:
-
python-intro
Introduction to Python variables, operators, boolean logic, data types, flow control, loops, and functions. With extra notebook containing classes, objects, and OOP basics. -
python-data-science Introduction to basic Python libraries for data science, file IO, numpy, matplotlib and data visualization, pandas and data frames. With extra notebooks include a basic implementation of Conway's game of life, linear algebra and machine learning using scikit-learn, network analysys using networkx lib, regular expressions, signal processing using SciPy, text sentiment analysis and word clouds.
The course is designed to be self-paced and the notebooks are meant to be run in a jupyter environment.
To run the files for this course you need some software installed on your machine.
Make sure you have vscode and both git and miniconda installed on your machine. You can download them from here:
These instructions should work for all (win, mac, linux) operating systems.
Visual Studio Code is a free open source code editor developed by Microsoft.
More info on vscode
Git is a free and open source distributed version control system that allows you to track changes in code, collaborate with others, and maintain different versions of a project.
More info on git
Miniconda is a free minimal installer for conda, a package manager that allows you to easily install, run, and update python, its packages and their dependencies.
More info on miniconda.
- Download vscode and foillow these instructions
- Download git and follow the installer instructions.
- Download miniconda and follow these instructions.
- Download vscode and foillow these instructions
- Download miniconda and follow these instructions.
- Download vscode and foillow these instructions
- Download miniconda and follow these instructions.
Note: Both Linux and MacOS come with git pre-installed.
The requirements.txt file has the necessary python packages for both modules.
After all the necessary software is installed, you can now setup the environment to run the course.
To install the environment you need to:
- Choose an environment name (e.g. aulas)
- Choose where you want to install the files (e.g. C:\Users\username\Documents\aulas\ or ~/home/username/Documents/aulas)
- Open an anaconda terminal (on windows) or a terminal (on mac or linux) and run the following commands:
cd .\Documents\aulas
conda create -n aulas python=3.10
conda activate aulas
git clone https://github.com/nbonacchi/python-programming.git
cd python-programming
pip install -r requirements.txt
Explanation of the commands:
cd .\Documents\aulas
changes the directory to the one where you want to install the course material.conda create -n aulas python=3.10
creates a new conda environment with the name aulas and python version 3.10.conda activate aulas
activates the environment, so all the installed packages are available.git clone https://github.com/nbonacchi/python-programming.git
downloads the repository with the course material.cd python-programming
changes the directory to the one with the course material.pip install -r requirements.txt
installs all the necessary packages specified in the requirements.txt file.
Finally, you need to configure vscode to run python code and the jupyter notebooks. To configure vscode to run python code and the jupyter notebooks you need to install the relevant extensions:
To install the extensions you need to open vscode and click on the extensions menu and then marketplace.
After that you can search for the extensions you want to install and click on install.
Note: vscode has an ever growing number of extensions for all the programming languages.
There are lot of features that can be customized to your liking.
You can find more information about vscode extensions here.
You should now have the necessary extensions installed. We are almost ready to run the notebooks.
The easiest way to launch the notebooks is to use vscode.
- Open vscode and click on the file menu and then open folder.
- Select the folder with the course material (python-programming).
- Click on the view menu and then command palette.
- Type python: select interpreter and select the environment you created (e.g. aulas).
Alternatively you can run the notebooks from the command line. To launch the notebooks, open an anaconda terminal (on windows) or a terminal (on mac or linux) and run:
conda activate aulas
cd ./Documents/aulas/python-programming
jupyter-lab
Explanation of the commands:
conda activate aulas
creates a new conda environment with the name aulas and python version 3.10.cd ./Documents/aulas/python-programming
changes the directory to the one with the course material.jupyter-lab
launches the notebooks from the course material folder.
This course was adapted from the Digital Skills and Training initiative of the University of Edimburgh Information Services. The original files for the course can be found here and here. Minor edits were done to the README.md files