• Keine Ergebnisse gefunden

Problems 5 SelfAssessment 4 Retrospect 3 Games? 2 GUI 1

N/A
N/A
Protected

Academic year: 2021

Aktie "Problems 5 SelfAssessment 4 Retrospect 3 Games? 2 GUI 1"

Copied!
14
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

1

GUI

2

Games?

3

Retrospect

4

Self Assessment

5

Problems

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 1 / 7

(2)

Easy Gui

Runs in Windows

http://easygui.sourceforge.net

The Book : Hello World (All programs from there)

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 2 / 7

(3)

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 2 / 7

(4)

1 # a simple easygui dialog

2

3 import easygui

4 f l a v o r = easygui . buttonbox ("What is your favorite

5 ice cream flavor?",

6 choicess = [’Vanilla’, ’Chocolate’, ’Strawberry’]

7 easygui . msgbox ("You picked " + f l a v o r )

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 2 / 7

(5)

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 2 / 7

(6)

1 # default arguments i n easygui

2

3 import easygui

4 f l a v o r = easygui . enterbox ("What is your favorite

5 ice cream flavor?",

6 default = ’Vanilla’)

7 easygui . msgbox ("You entered " + f l a v o r )

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 2 / 7

(7)

1 import random, easygui

2

3 secret = random . r a n d i n t ( 1 , 99)

4 guess = 0

5 t r i e s = 0

6

7 easygui . msgbox("""I have a secret!

8 It is a number from 1 to 99.

9 I’ll give you 6 tries.""")

10

11 while guess != secret and t r i e s < 6 :

12 guess = easygui . integerbox ("guess?")

13 i f not guess : break

14 i f guess < secret :

15 easygui . msgbox( s t r ( guess ) + " too low!")

16 e l i f guess > secret :

17 easygui . msgbox( s t r ( guess ) + " too high!")

18 t r i e s = t r i e s + 1

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 2 / 7

(8)

19

20 i f guess == secret :

21 easygui . msgbox("got it!")

22 e lse:

23 easygui . msgbox("No more guesses!")

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 3 / 7

(9)

Games with PyGame

Use pygame pygame.org

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 3 / 7

(10)

What did we do?

Basic Data Types, Operators Control Structures

Collection Types

Classes / Objects, Anonymous Classes Modules, Importing them

Basic IO, Files

Lambda Functions, Other Functional Proramming tools

Regular Expressions

URLs and HTTP, XML/HTML Parsing

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 4 / 7

(11)

What did we do?

Crawler, TF-IDFs, Shelves Iterators, Generators Socket Programming ZKP

Pickles

Threads, Pipes

Decorators, Descriptors Static Variables/Functions GUI (a little bit)

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 5 / 7

(12)

Some Questions and Self Evaluation

I have some questions here. Please write down the answers and give it back.

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 6 / 7

(13)

The points for each question is 2n for somen.

If the solution is perfect You get all the marks.

If the solution is MOL fine You get 2n−2n−2 If the solution is barely ok You get 2n−2n−1

If you can look it up in 10 mins You get 2n−2n−1−2n−2

Otherwise You know math. ; )

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 6 / 7

(14)

Problems

Finish the ones which are to be done.

Sandeep Sadanandan (TU, Munich) Python For Fine Programmers August 3, 2009 7 / 7

Referenzen

ÄHNLICHE DOKUMENTE

Zeile: (7+1–4)·6=24 Finde zu möglichst vielen Kombinationen mindestens eine Lösung und

©Heike Putze – diplomierte Legasthenietrainerin®... Rechne und male die

Technische Universität Braunschweig Institut für Informationssysteme http://www.ifis.cs.tu-bs.de Christoph Lofi, Jan-Christoph Kalo. SQL-Lab – Aufgabenblatt 5 – SQL Statements

[r]

[r]

3.5 Muller Games and Game Reductions positional strategies of Player 1: A trap strategy, an attractor strategy, and a winning strategy on a subgame with fewer priorities.. At first,

3.5 Muller Games and Game Reductions positional strategies of Player 1: A trap strategy, an attractor strategy, and a winning strategy on a subgame with fewer priorities.. At first,

Although Muller games are, in general, not positionally deter- mined, we will see that Muller games are determined via winning strategies that can be implemented using finite