Simple web-app with python
Flask + Python
Nikita Penzin(Lozhnikov)
… is a widely used general-purpose, high-level
programming language - http://python.org
Python
The creator
Guido Van Rossum (1956 - …)
Employment: Google, Dropbox
“There is one way to do it right
...if you aren’t Dutc...
The Zen of Python
Beautiful is better than ugly
Explicit is better than implicit
Simple is better than complex
Complex is ...
Features
● dynamic type system
● automatic memory management
● large and comprehensive standard library
● lots of implemen...
Examples
print 'Hello, world!'
>>> Hello, world!
def fib(n):
if n < 2:
return n
return fib(n-2)+fib(n-1)
print fib(7)
>>> ...
Flask
Flask is a microframework for Python web-apps.
http://flask.pocoo.org/
created by Armin Ronacher
Flask based ‘Hello, world!’ app
1. Connect to a ‘flask’ wifi-hotspot from your
devices
2. Open your browser
3. Get to 192....
Explanation
flask.py
---------------------------------
from flask import Flask < import required modules
app = Flask(__nam...
Credits
https://www.python.org/
http://flask.pocoo.org/
https://github.com/npenzin
https://twitter.com/npenzin
mailto: mai...
Upcoming SlideShare
Loading in …5
×

Python and Flask introduction for my classmates Презентация и введение в flask

616 views

Published on

Python and flask 30 min introduction for students who have never seen anything except Delphi and Java

Published in: Software, Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
616
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Python and Flask introduction for my classmates Презентация и введение в flask

  1. 1. Simple web-app with python Flask + Python Nikita Penzin(Lozhnikov)
  2. 2. … is a widely used general-purpose, high-level programming language - http://python.org Python
  3. 3. The creator Guido Van Rossum (1956 - …) Employment: Google, Dropbox “There is one way to do it right ...if you aren’t Dutchman”
  4. 4. The Zen of Python Beautiful is better than ugly Explicit is better than implicit Simple is better than complex Complex is better than complicated Readability counts
  5. 5. Features ● dynamic type system ● automatic memory management ● large and comprehensive standard library ● lots of implementations ● beautiful, understandable, powerful syntax ● easy to learn ● TOP employers use it : Google, Yandex ...
  6. 6. Examples print 'Hello, world!' >>> Hello, world! def fib(n): if n < 2: return n return fib(n-2)+fib(n-1) print fib(7) >>> 13 a = 3 b = ‘hello’ print b * 3 >>> hellohellohello
  7. 7. Flask Flask is a microframework for Python web-apps. http://flask.pocoo.org/ created by Armin Ronacher
  8. 8. Flask based ‘Hello, world!’ app 1. Connect to a ‘flask’ wifi-hotspot from your devices 2. Open your browser 3. Get to 192.168.xxx.xxx/ 4. Have fun: get to 192.168.xxx.xxx/any text e.g. 192.168.xxx.xxx/<h1>Hello, class<h1>
  9. 9. Explanation flask.py --------------------------------- from flask import Flask < import required modules app = Flask(__name__) < create instance app of a class Flask @app.route("/") < decorate method hello with app.route def hello(): return "Hello World!" @app.route("/<text>") def hello_user(text): return text app.run(host=’0.0.0.0’) < call the run method on app
  10. 10. Credits https://www.python.org/ http://flask.pocoo.org/ https://github.com/npenzin https://twitter.com/npenzin mailto: mail@mainpart.in Any questions?

×