Programming in Python. Basic information. Teaching. Administration Organisation Contents of the Course. Jarkko Toivonen. Overview of Python



Similar documents
Introduction to Python

C# and Other Languages

2! Multimedia Programming with! Python and SDL

Welcome to Introduction to Computers and Programming Course using Python

Programming Languages

Introduction to Python

A Python Tour: Just a Brief Introduction CS 303e: Elements of Computers and Programming

CS 301 Course Information

CS101 Lecture 24: Thinking in Python: Input and Output Variables and Arithmetic. Aaron Stevens 28 March Overview/Questions

1001ICT Introduction To Programming Lecture Notes

CSC230 Getting Starting in C. Tyler Bletsch

9/11/15. What is Programming? CSCI 209: Software Development. Discussion: What Is Good Software? Characteristics of Good Software?

CS 40 Computing for the Web

Software. Programming Language. Software. Instructor Özgür ZEYDAN. Bülent Ecevit University Department of Environmental Engineering

Objects and classes. Objects and classes. Jarkko Toivonen (CS Department) Programming in Python 1

Outline. multiple choice quiz bottom-up design. the modules main program: quiz.py namespaces in Python

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

PYTHON IN A NUTSHELL. O'REILLY Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo. Alex Martelli. Second Edition

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

COS 217: Introduction to Programming Systems

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

CS 6371: Advanced Programming Languages

Main Bullet #1 Main Bullet #2 Main Bullet #3

ECS 165B: Database System Implementa6on Lecture 2

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

GUI application set up using QT designer. Sana Siddique. Team 5

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

Under the Hood: The Java Virtual Machine. Lecture 24 CS 2110 Fall 2011

Introduction to Object-Oriented Programming

.NET Overview. Andreas Schabus Academic Relations Microsoft Österreich GmbH

CSE 307: Principles of Programming Languages

CSCE 110 Programming I Basics of Python: Variables, Expressions, and Input/Output

CS 43: Computer Networks Course Introduction. Grab a clicker and please sit towards the front, next to other students!

CSCI 3136 Principles of Programming Languages

Code Estimation Tools Directions for a Services Engagement

Crash Course in Java

Week 2 Practical Objects and Turtles

CS 106 Introduction to Computer Science I

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Tutorial 0A Programming on the command line

Jonathan Worthington Scarborough Linux User Group

VOC Documentation. Release 0.1. Russell Keith-Magee

C H A P T E R Regular Expressions regular expression

Java applets. SwIG Jing He

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

STUDY AND ANALYSIS OF AUTOMATION TESTING TECHNIQUES

Mixing Python and Java How Python and Java can communicate and work together

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. Oct 2003 Presented to Gordon College CS 311

Whitepapers at Amikelive.com

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

What Perl Programmers Should Know About Java

Programming Languages CIS 443

Big Data Storage, Management and challenges. Ahmed Ali-Eldin

Install Java Development Kit (JDK) 1.8

Contents. Java - An Introduction. Java Milestones. Java and its Evolution

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

Mobile Application Development Android

Python, C++ and SWIG

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals

1) Which of the following is a constant, according to Java naming conventions? a. PI b. Test c. x d. radius

A Comparison of Programming Languages for Graphical User Interface Programming

MYPY: A PYTHON VARIANT WITH SEAMLESS DYNAMIC AND STATIC TYPING. Jukka Lehtosalo University of Cambridge Computer Laboratory

CS54100: Database Systems

Building Applications Using Micro Focus COBOL

Crash Dive into Python

Introduction Our choice Example Problem Final slide :-) Python + FEM. Introduction to SFE. Robert Cimrman

6.S096 Lecture 1 Introduction to C

02 B The Java Virtual Machine

Java Crash Course Part I

MEAP Edition Manning Early Access Program Nim in Action Version 1

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Java and IRC. What Is IRC? Nicks, Channels and Operators. Using IRC. What Is an IRC Bot? IRC Protocol

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

How to use the Eclipse IDE for Java Application Development

CSE 452: Programming Languages. Acknowledgements. Contents. Java and its Evolution

Using Python in a High School Computer Science Program

Parrot in a Nutshell. Dan Sugalski dan@sidhe.org. Parrot in a nutshell 1

Java CPD (I) Frans Coenen Department of Computer Science

Installing Java. Table of contents

Computer Programming. Course Details An Introduction to Computational Tools. Prof. Mauro Gaspari:

Lecture 1 Introduction to Android

Introduction to Python

How To Write Portable Programs In C

Efficiency Considerations of PERL and Python in Distributed Processing

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

Semantic Analysis: Types and Type Checking

Crash Dive into Python

Rakudo Perl 6 on the JVM. Jonathan Worthington

Lesson 06: Basics of Software Development (W02D2

Numerical Analysis. Professor Donna Calhoun. Fall 2013 Math 465/565. Office : MG241A Office Hours : Wednesday 10:00-12:00 and 1:00-3:00

Building Java Programs

Transcription:

Programming in Python Jarkko Toivonen Department of Computer Science University of Helsinki September 18, 2009 Administration Organisation Contents of the Course Overview of Python Jarkko Toivonen (CS Department) Programming in Python 1 / 18 Jarkko Toivonen (CS Department) Programming in Python 2 / 18 Organisation Contents of the Course Basic information Teaching Organisation Contents of the Course Voluntary intermediate level course Teaching language: English Fall 2009, Period I, 4 credit units Registering for the course through ilmo: https://ilmo.cs.helsinki.fi/ Course home page: http://www.cs.helsinki.fi/u/jttoivon/python-09/ Lectures: Tuesday 12-14, Thursday 10-12 in Auditorium B123 Exception: 24th of September at 8-10 in Auditorium B123??? Exercises: two hours per week starts already in the first week See homepage or ilmo for times and places Course exam: Wednesday 21th of October at 9-12 in B123 Verify the time and place few days before the exam from here http://www.cs.helsinki.fi/kokeet/kkokeets09.html Jarkko Toivonen (CS Department) Programming in Python 3 / 18 Jarkko Toivonen (CS Department) Programming in Python 4 / 18

Evaluation Organisation Contents of the Course Organisation Contents of the Course Prerequisites and Aims Exam 20p + Exercises 20p + Project 20p = 60p Roughly: 30 points to get lowest grade (1/5) and 50 points for grade 5/5 The course cannot be passed by a separate exam Prerequisites: programming skill in at least one language, and basic computer skills (Linux) Aims: Can write portable applications in Python that work under various platforms, like Windows, Linux, Mac,... Knows the strengths and weaknesses of Python, and can therefore choose when to use Python and when use some other tool or language. Learns good software engineerings habits of writing clear code and documentation, and testing for correctness. Jarkko Toivonen (CS Department) Programming in Python 5 / 18 Jarkko Toivonen (CS Department) Programming in Python 6 / 18 Literature Organisation Contents of the Course Course book: Alex Martelli, Python in a Nutshell, O Reilly 2006 For additional books, and links to online resources, see the course homepage. Jarkko Toivonen (CS Department) Programming in Python 7 / 18 Organisation Contents of the Course Tentative list of topics of the course Basic concepts of Python Data types and variables Expressions Flow control and functions Basic input and output Data structures: lists, tuples, sets, dictionaries Objects and classes Exceptions Modules String handling Regular expressions File processing Documentation and testing Overview of NumPy and TkInter GUI libraries (if time permits) Jarkko Toivonen (CS Department) Programming in Python 8 / 18

History of Python Who are using Python? Developer Guido van Rossum Development started in the end of 80 s First release in 1991 Descendant of ABC language Other influencees: C, LISP, Haskell, Modula-3, Perl, Java,... Nowadays Python is developed by large group of programmers Open Source development model Many companies rely on Python: YouTube, Google, Industrial Light & Magic,... Jarkko Toivonen (CS Department) Programming in Python 9 / 18 Jarkko Toivonen (CS Department) Programming in Python 10 / 18 Where does it work? Facilities at our department On several operating systems, such as Windows, Unix, Mac Also different implementations: The main implementation is written in C, and is referred to as CPython Jython is implemented in Java IronPython implemented in the.net environment Each of these implementations allow extending Python with the implementation language Main platform: CPython on Linux Both version 2.5 and 3.0 are installed The computer system is in the state of change Things are guaranteed to work at least on machines melkki.cs.helsinki.fi and melkinpaasi.cs.helsinki.fi Windows and Mac are not supported, but you can use them on your own. Jarkko Toivonen (CS Department) Programming in Python 11 / 18 Jarkko Toivonen (CS Department) Programming in Python 12 / 18

More information Which Python version to use? Python homepage http://www.python.org Documentation http://www.python.org/doc/ Python has also an internal documentation system On this course we will concentrate on version 2.5 We will also look at some of the bigger new features of Python 3 Python version 3.0 breaks the downward compatibility Not really any books on version 3 yet Not many external libraries (like numpy) support version 3, yet There s lot of existing code written in Python 2.5, and still continues to be written Both versions are installed on our departments machines A conversion program 2to3 exists as well Jarkko Toivonen (CS Department) Programming in Python 13 / 18 Jarkko Toivonen (CS Department) Programming in Python 14 / 18 What kind of language Python is? Features Interactive Strongly typed Dynamic typing Duck typing Compiled and interpreted: Source code (.py extension) compiled into byte code Byte code (.pyc extension) is run with a virtual machine.py.pyc compiler Consistent and simple language: this makes it easy to learn Very High Level Language good set of data structures rich standard library Allows fast developing and prototyping May sometimes be a bit slow, due to it being dynamic and interpreted... but computers are cheap and programmer come expensive Python has classes, modules, and other modern features... but doesn t force you to use them virtual machine Jarkko Toivonen (CS Department) Programming in Python 15 / 18 Jarkko Toivonen (CS Department) Programming in Python 16 / 18

Hello world in Java and Python Why do we do programs? Java version: public class hello { public static void main(string[] args) { System.out.println("Hello, World!"); } } Python version: print "Hello, World!" To automate boring, repetitive and error prone tasks To compute and process data To store vast amounts of data To visualise and auralise data A program is a set of instructions that tell the computer what to do. Jarkko Toivonen (CS Department) Programming in Python 17 / 18 Jarkko Toivonen (CS Department) Programming in Python 18 / 18