Post on 26-Jun-2015
description
transcript
2
Which Python?
In military
In media & films
In nature
In computers
In ancient Greek
3
The programming language since 1991
4
Monty PythonGuido van Rossum
Wow... What a name, I like it!
5
Market Share
6
Contributions on Github
7
Python
● Is a scripting language● Files extensions are py & pyc● Case sensitive● Is by default clean● Needs minimum programming requirements● Supports in multiple platforms and OSs
8
Online tutorials can be found at
9
Installation
http://www.python.org/getit/
In Linux can be downloaded from repositories too.
10
1. Data types0. Variables2. Strings 3. Comments
5. Arithmetic operations 6. Conditional statements
8. Loop statements7. Functions
9. Classes
4. Lists/Dictionaries
11
Cheat sheets
http://sleet.aos.wisc.edu/~gpetty/wp/wp-content/uploads/2011/10/Python_qr.pdf
http://www.cogsci.rpi.edu/~destem/gamedev/python.pdf
12
Class Scenario:
Create a simple game which gets the number and checks if it is greater of less than the internal
random number if users can find it in 5 attempts they win else they will lose.
Notice : using classes
13
Class Scenario:
The Fibonacci function using recursive and dynamic programming functions.
Notice: using classes
14
Simple Network Programming
1. importing socket library2. creating a socket object
3. connecting to an address/port4. sending/receiving message
5. closing connection6. in server waiting for connections
15
Clients
16
Server
17
Class Scenario:
Create a client application which gets a message from standard input and send it to the server, server ip should be entered by user and the
process should be logged in system.
Notice: using socket library
18
Some Python Frameworks