10
Introduction to the Python programming language GC3: Grid Computing Competence Center, University of Zurich Mar. 19–20, 2014

Python Training Part 1

Embed Size (px)

DESCRIPTION

Python Training Course - Part 1

Citation preview

  • Introduction to the Pythonprogramming languageGC3: Grid Computing Competence Center,University of Zurich

    Mar. 1920, 2014

  • Welcome!

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • What is the GC3?

    A bridge between researchand computational infrastructure

    Support scientists in running large-scale dataprocessing.

    Develop tools to better integrate scientific usecases.

    Provide access to innovative infrastructures andtechnologies.

    Want to know more ? http://www.gc3.uzh.ch

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • And what about you?

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • Prerequisites

    This course assumes a basic experience withcomputer programming.

    Any language should do, as long as you are alreadyfamiliar with the concepts of variables and functions.

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • Where to find the course material

    These slides and all the example files can bedownloaded from the course web page at:http://www.gc3.uzh.ch/edu/python

    Better keep a browser tab open on that page.

    (After the course is over, please rate it and the materialusing the feedback form on that same page)

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • A helpful tool

    The Online Python Tutor is a free tool to visualize theexecution of small Python programs step-by-step.

    Objects1 msg = "Welcome to Python!"23 print (msg)

    Edit code

    Last >> line that has just executed next line to execute

    Program output:

    Frames

    Global variablesmsg "Welcome to Python!"

    Generate URL

    http://pythontutor.com/visualize.html#code=msg+%3D+%22Welcome+to+Python!%22%0A%0AprinTo share this visualization, click the 'Generate URL' button above and share that URL. To report a bug, paste theURL along with a brief error description in an email addressed to [email protected]

    Generate embed code

    To embed this visualization in your webpage, click the 'Generate embed code' button above and paste the resultingHTML code into your webpage. Adjust the height and width parameters as needed.Online Python Tutor supports Python 2.7 and Python 3.2 with limited module imports and no file I/O. The followingmodules may be imported: bisect, collections, datetime, functools, heapq, json, math, operator, random, re, stringHave a question? Maybe the FAQ or other documentation can help. Or check out its code at GitHub.Join the pythontutor-users mailing list to participate in user discussions and pythontutor-announce to receiveoccasional announcements. (Your name and email address will be kept private; only the list owner can see them.)Copyright 2010-2013 Philip Guo. All rights reserved.

    Online Python Tutor - Visualize program execution http://pythontutor.com/visualize.html

    1 di 1 09. 03. 13 15:33

    Feel free to use it for the course exercises and yourown code: http://pythontutor.com/visualize.html

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • Further reading

    The Python tutorial,http://docs.python.org/tutorial/

    The Zen of Python in 3 days,http://pixelmonkey.org/pub/python-training/

    Python for Java programmers, http://python4java.necaiseweb.org/Main/TableOfContents

    For an extensive and commented list, see: https://github.com/gc3-uzh-ch/python-course/blob/master/refs.mdwn

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • Python 2 vs Python 3

    There are currently two major versions of Pythonavailable, with slightly different syntax and features.

    Python 2.7 is the last release in the 2.x series.

    Python 3.x has a more polished syntax, removinginconsistencies and some historical baggage.

    But Python 2.x is still the default on most Linuxdistributions and some major Python packages havenot yet been ported to Py3, so we shall focus on Py2syntax.

    Watch a debate between Pro and Contra advocates:http://www.physik.uzh.ch/nchiapol/webm/3 1 Python3.webm

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014

  • Next steps

    The course will be structured as a mixture of slidesand hands-on sessions for practicing Pythonprogramming. The GC3 folks are here to help: askthem questions!

    So, the very first step is to set up your workstation sothat you can edit files and run Python code.

    Introduction University of Zurich, GC3: Grid Computing Competence Center Mar. 1920, 2014