rreben / learn-how-to-code

Python tutorial for beginners. Easy to use development environment based on anaconda, jupyter and vagrant.
4 stars 3 forks source link

Learn How to Code

Project mission

This project teaches the very basics of programming (in Python):

This is done by providing an easy to install programming environment. If you know how to use a web browser, then you are ready to follow the tutorial and do your own experiments.

Integrated tutorial and platform to edit and run your programs

Get an idea of how to learn-how-to-code with this project

How to get started

Installation

If you know how to insall programs on a Mac or PC, you should be able to get everything up and running. If not, ask someone to help you.

Follow these simple steps to install everything you need to start programming:

  1. install virtual box.
    • install vargrant.
    • Copy the zipfile from Github. And extract it somewhere.
    • Use a terminal (dos-prompt / cmd) and navigate to the folder that contains the extracted files. You should find a file named vagrantfile.
    • type in vagrant up. This command will prepare a "virtual computer" on your pc or mac. Everything will be installed within this "virtual computer" so there won't be any interferences with other programs on your mashine.
    • type in vagrant provision this command may take even longer (leave it for the night). It will install a modern python development environment.

Start the tutorial

After the installation. Use http://localhost:8888 in your web browser, to start the environment. Click on the first lesson to start the tutorial.

Stoping and resuming

Behind the scenes

Inspired by the ZX81

35 years ago I started programming on a ZX81. Since then I never stopped. Now my son is the same age as I was then. He starts to program on his iPod (although he owns a desktop PC). Why is this? It should be so much easier to program with an IDE using a modern programming language ...

Really? Thinking back, the ZX81 was the ideal platform to learn how to code:

So this project is about ultimate simplicity. How can we teach the basics of programming: variables, conditions, loops and "subprograms"?

This project is not aiming at a nostalgic ZX81-emulation. On the contrary I will use Python 3.X, jupyter with the Anaconda ecosystem to prepare a learning platform via vagrant / chef on a virtual mashine.

The goal is to prepare an easy set up of an development environment that can be used via the browser. And to provide a set of simple jupyter playbooks. Aimed at the beginner to teach them the basics.

The ZX81

Acknowledgement

This work is inspired by Matthew A. Russel's work on Mining the social Web, where I found out about iPython (now jupyter) and how to use Vagrant and chef to prepare an easy to deploy development environment.

I followed the ZX81 manual. And adopted it for learning python. So I owe a lot to Steven Vickers and his famous book: "Sinclair ZX81 BASIC Programming by Steven Vickers Second Edition 1981."

I used the following chef recipes to cook up the development environment:

Status

Handling errors

Problems with mounting the directories / Guest additions do not match

You might see a warning while vagrant up, telling you that guest additions do not match the version of the virtual box.

important warning

The effect might be that the directories with the jupyter notebooks are not mounted correctly. In this case you will see that jupyter is running (localhost:8888 will show a webpage), however you will not see any meaningful tutorials.

If this happens, you have to update your virtualbox installation to the newest version. Use vagrant destroy to restart from scratch, use vagrant up to install again (do this in a strong wifi network). This should fix everything.

Tips for analysing errors

In most cases, this should solve your problems. But if the message "The guest additions on this VM do not match the installed version of VirtualBox! ..." persists, you might try to issue. vagrant plugin install vagrant-vbguest and restart vagrant. This might indicate further problems with the guest additions.

Use vagrant ssh to login to your guest mashine. Here you might issue ipython notebook --help to learn more about starting the jupyter service.

Other bugs and errors

Your stuck with the installation. Please create an issue on Github, I will try to help you then.

Get in touch