GithubHelp home page GithubHelp logo

aryabhatta000 / intro_programming Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ehmatthes/intro_programming

0.0 1.0 0.0 10.39 MB

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

License: MIT License

HTML 0.64% Jupyter Notebook 97.88% CSS 0.17% JavaScript 0.06% Python 0.98% Smarty 0.03% Shell 0.25%

intro_programming's Introduction

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!

intro_programming's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.