• Stars
    star
    396
  • Rank 108,801 (Top 3 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A set of IPython notebooks and learning resources for an Introduction to Programming class, focusing on Python.

A collection of IPython Notebooks for teaching Python.

This project is the basis of introtopython.org, an open resource for teaching and learning Python. The site teaches the basics of Python, and then teaches people to build projects in Python. If you know how to work with IPython notebooks, you can contribute to the project.

You can also view the raw notebooks using the IPython Notebook Viewer (home page. The content is almost identical on both sites, but the introtopython.org version is easier to navigate, and has some dynamic js features such as collapsible output.

Contents

Goals:

  • Introduce students as quickly as possible to the basics of programming, and then help them choose an interesting project that they're capable of completing.
  • Introduce best practice as early as possible, while remaining accessible to students with no background in programming at all.
  • Help teachers who know little about programming start teaching Python to their students.
  • Make it easy for experienced Python programmers to conduct a code review of the project.

Contributing - Brief:

Contributing to this project requires IPython version 3.0 or higher. These instructions are written based on setting up a development environment on Ubuntu 14.04, but they should be adaptable to any modern system with a Python environment already set up. If you have any questions about getting your development environment set up for contributing to this project, please drop a note in Issue 11, or get in touch with me directly. I can be reached by email, ehmatthes at gmail, or on twitter @ehmatthes.

If you would like to start contributing and aren't sure what to do, there is a list of places to start in Issue 17.

These notebooks are written primarily in Python 3. If the default Python on your system is Python 3, then you'll have a simpler time contributing to the project. If you only have Python 2, you might want to consider adding Python 3 to your system. You can contribute to the project using Python 2, since there is so much overlap between the two versions of Python, especially when working on the more basic notebooks. To fully contribute to the project, you will need to have both Python 2 and Python 3 available.

Using Miniconda to set up a development environment

The first visualization project (Mapping Global Earthquake Activity) uses packages that are most conveniently installed using Conda.

The easiest way to do this is using Miniconda. Go to the Miniconda home page. Download and run the appropriate installer for your system. The following commands will get conda set up on a 32-bit Linux system:

~$ wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86.sh
~$ bash Miniconda3-latest-Linux-x86.sh
~$   # Say yes to the prompt for prepending Miniconda3 install location to PATH
~$ exec bash

Create a conda environment

Once you've got conda installed, use it to make an environment for this project. Make a directory for this project, and start a conda environment that includes ipython and ipython notebook:

$ mkdir introprogramming && cd introprogramming
intro_programming$ conda create -n ip_env python=3 ipython ipython-notebook
intro_programming$ source activate ip_env
(ip_env)intro_programming$ 

From this point, the project works the same as using virtualenv. Skip ahead to Open the notebooks

Using virtualenv to set up a development environment

You can also use virtualenv to set up a development environment.

Install pandoc

Pandoc is used by IPython Notebook to convert from the .ipynb format to .html.

$ sudo apt-get install pandoc

Now we'll set up the virtualenv:

$ mkdir intro_programming && cd intro_programming
intro_programming$ virtualenv -p python3 venv
intro_programming$ source venv/bin/activate
(venv)intro_programming$ git clone https://github.com/ehmatthes/intro_programming

# Required to access the notebooks:
(venv)intro_programming$ pip install ipython[all]==3 jsonschema

# Required for testing links within the project:
(venv)intro_programming$ pip install requests==2.0.0

Open the notebooks:

(venv)intro_programming$ cd intro_programming/notebooks
(venv)intro_programming/intro_programming/notebooks$ ipython notebook

This will open a browser, and you can click on the notebook you'd like to edit.

Creating html versions of the notebooks:

(venv)intro_programming$ cd intro_programming/scripts
(venv)intro_programming/intro_programming/scripts$ ./build_html_pages

After this, you should see an .html file for each .ipynb file in the notebooks directory. The html files are ignored by git for this project. If you want to build your own custom site based off this project, look at the source for /scripts/build_html_pages.sh. If you're not sure how to modify the script for your own purposes, I'm happy to help clarify how the conversion process works.

View your html pages

To view your html pages, start a server in the intro_programming/notebooks directory, and then access the pages locally:

(venv)intro_programming$ cd intro_programming/notebooks
(venv)intro_programming/intro_programming/notebooks$ python -m http.server

Then go to http://localhost:8000, and you should see the index page. (By the way, if you're using an index page with social plugins, you can see all the people who have accidentally tweeted or shared a local development version of their project. :)

Editing Python 2.7 examples

To edit the Python 2 examples in some of the notebooks, it's helpful to have a separate virtualenv that is built using Python 2.7. The steps to set up this virtualenv are identical to the steps above, except

$ mkdir intro_programming && cd intro_programming
intro_programming$ virtualenv -p python3 venv

becomes

$ mkdir intro_programming2.7 && cd intro_programming2.7
intro_programming2.7$ virtualenv -p python2.7 venv

There may be a bit more involved in a full setup, depending on which versions of Python you have on your system, but that should get you up and running.

Questions

If you have any questions about getting the project running locally, drop a note in Issue 11, or get in touch with me directly. I can be reached by email, ehmatthes at gmail, or on twitter @ehmatthes.

Thanks for looking!

More Repositories

1

pcc

Resources for Python Crash Course, from No Starch Press.
Python
2,947
star
2

pcc_2e

Online resources for Python Crash Course (Second Edition), from No Starch Press
HTML
2,403
star
3

pcc_3e

Online resources for Python Crash Course, 3rd edition, from No Starch Press.
Python
1,051
star
4

django-simple-deploy

A reusable Django app that configures your project for deployment
Python
305
star
5

django-first-principles

A Django project, developed from a single file.
CSS
29
star
6

mostly_python

Code files and other resources related to the Mostly Python newsletter.
Python
24
star
7

python_teaching_fall_2018

Notebooks for teaching Python this fall.
Jupyter Notebook
20
star
8

pcc_2e_ai_solutions

Solutions to the exercises for Chapters 12-14 in Python Crash Course (2nd ed)
Python
16
star
9

pyeducators

9
star
10

mp_testing_pcc_3e

Demo repository for the "Testing a book's code" series on Mostly Python.
Python
6
star
11

learning_log_heroku_test

A clean version of the Learning Log project from PCC, for testing a simplified heroku deployment process
Python
5
star
12

educator_news

A clone of HN, for the education profession.
Python
4
star
13

sitka_irg_realtime

Real-time analysis of the αΈ΄aasda HΓ©en stream gauge in Sitka, focusing on landslide risk.
Python
4
star
14

sitka_irg_analysis

An analysis of the correlation between the Indian River stream gauge and landslide activity in the Sitka area.
HTML
4
star
15

learning_log_2e_django40

Test version of the Learning Log project from Python Crash Course, second edition.
Python
3
star
16

faster_than_strptime

What's faster than strptime()?
Python
3
star
17

learning_log_django_41

Test instance of the Learning Log project, using Django 4.1.
Python
3
star
18

cs_standards

A casting of the CSTA Computer Science Standards in the format of the Great Schools Partnership model.
Python
2
star
19

taocp

Work related to The Art of Computer Programming (Knuth).
Python
2
star
20

cb_tracker

Simple terminal-based ticker for prices at Coinbase.
Python
2
star
21

learning_log_heroku_test_pipfile

For testing a modified Heroku buildpack, with a Django project using Pipfile.
Python
2
star
22

openedtools

2
star
23

terminal_invaders

A terminal-based Space Invaders clone, written in Python, for teaching basic Python.
2
star
24

whimbrel

A simple, terminal-based text editor.
Python
2
star
25

phs_adventure

A text-based adventure game, written in Python, that starts at the doors of Pacific High School.
Python
2
star
26

demo_open_settings

Demo script that opens system settings on any OS.
Python
2
star
27

roller_demo

Demo streamlit project; simulates rolling a single die.
Python
2
star
28

demo_testing_pcc_3e

Demo for how to test a book's code.
Python
2
star
29

legs_of_steel

A project focused on building elevation profiles of local trails, from gps tracks.
Python
1
star
30

dsd_sample_blog_reqtxt

Sample blog for trial runs of the django-simple-deploy project.
Python
1
star
31

sitka_weather_hx

A simple program to compile historical weather data for the Sitka area.
Python
1
star
32

phs_periodic_table

An open curriculum for a physical science class
1
star
33

hello_worlds

Hello World in a variety of languages.
C
1
star
34

ezhil_toc_test

Test case for adding table of contents to ezhil theme pages in Hugo sites.
HTML
1
star
35

tags_test

Simple repo for testing whether django-auto-prefetch improves query efficiency while using mptt
Python
1
star
36

dotfiles

My dotfiles
Emacs Lisp
1
star
37

release_test

Release test, haven't done it in a while.
1
star
38

sitka_landslides

Exploration of landslide-related data for the Sitka, Alaska area.
HTML
1
star
39

cyber_constitution

An interesting example class, from an Intro to Programming class.
Python
1
star
40

balloon_ninja

A simple game, written in Pygame. Aimed at helping new programmers learn to use Pygame. You slash balloons, and try not to slash kittens.
Python
1
star
41

nl_analyzer

Tool for analyzing costs of various newsletter platforms.
Python
1
star