Giter Club home page Giter Club logo

python-beginners's Introduction

Introduction to programming with Python

This workshop is an introduction to basic programming concepts and abstractions. It is laid out for hands-on workshops taking up roughly 4 hours. While we have tried to be compatible with Python 2 _and_ 3 wherever possible, we'd strongly encourage you to use Python 3.

The initial version of this material was loosely based on the "Python für Kids" book by Gregor Lingl. It is conceptual-- rather than incidental --that it trades in idioms for learnability. We believe that beginners sometimes have to jump through one or another hoop to fully comprehend the scope and applicability of a concept. Every introduced abstraction solves another pain point in the life of a beginning programmer.

HTML Version

You can view this workshop being hosted here: http://opentechschool.github.io/python-beginners/

The following sections are for people who want to contribute.

Setup

This workshop is written in the reStructuredText format. The .rst files can be edited with a normal text editor.

It can be rendered to several output formats using Sphinx. To do that, you need to have the following Python packages installed:

  • Sphinx (and its dependencies docutils and Pygments)
  • Fabric
  • sphinx-intl
  • sphinx-bootstrap-theme

You can install these with pip using pip install -r requirements.txt

To push / pull translations from Transifex you will need the package transifex-client as well.

Build

The fabric script fabfile.py contains tasks making the build process very easy.

If you just want to render the HTML version, it's sufficient to run:

$ fab build:en

Replace en with the language you'd like to build.

This will create a directory _build, containing the HTML version.

You can view this in a browser by running fab serve and visiting the web address listed.

Other builders can be passed as an argument. For instance use singlehtml to render the whole tutorial into a single HTML file:

$ fab build:en,singlehtml

Translation

Translations should normally be done through Transifex.

You can see the project on Transifex here.

After editing the tutorial, it is desirable to update sources for it.

  1. New translation templates (.pot) must be created, then po translation files are updated (or created for the first time) - fab gen_pots
  2. If you wish to upload new sources to transifex, you should use their cli client. tx push -s.
  3. To pull down translations for a particular language, use e.g. tx pull -l de, for de (german) or others.
  4. fab build:de will compile po files, and build the docs for that language.

It is also possible to edit and update po files manually, you can check out the other fab command (fab list) for help with that.

Note

only .po files should be committed to version control. .pot and .mo files are built automatically.

Deploy

The workshop is deployed as a GitHub Page. A good way to do that is described right here. To simplify this process, you can use a nifty fabric target:

$ fab setup

This recreates the _build/html folder, cloning the folder to the gh-pages branch of this repo. Then you should build updates for the desired language. Then cd into this folder, and git push the updates to update the branch. Like so:

$ fab build:en
$ cd _build/html
$ git status
$ git commit --all
$ git push

Credits

The material presented here is a collaborative work. It has been created largely by OpenTechSchool Python coaches. Every bit, from exercises to translations, has been contributed by the community. After every workshop where this material is used we try to gather feedback on how to improve the material.

License

This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

python-beginners's People

Contributors

ivoz avatar lehmannro avatar foonicorn avatar projectgus avatar nekopanic avatar sonoflilit avatar gnunicorn avatar benoitbleuze avatar alper avatar pletcher avatar utstikkar avatar haikoschol avatar keimlink avatar alecthegeek avatar oksome avatar leenagupte avatar sorrymak avatar staeff avatar

Watchers

James Cloos 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.