Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Python for Java developers
Javier Honduvilla Coto
November 24, 2014
Programming
0
34
Python for Java developers
Javier Honduvilla Coto
November 24, 2014
Tweet
Share
More Decks by Javier Honduvilla Coto
See All by Javier Honduvilla Coto
javierhonduco
0
44
javierhonduco
0
45
javierhonduco
0
26
javierhonduco
0
47
Other Decks in Programming
See All in Programming
grapecity_dev
0
170
grapecity_dev
1
200
korosuke613
2
250
grapecity_dev
0
200
minamijoyo
3
500
ntaro
0
170
grapecity_dev
0
180
hanasuke
1
590
line_developers_tw2
0
4.4k
tarugoconf
1
1.5k
xrdnk
0
110
mehowte
0
180
Featured
See All Featured
rasmusluckow
318
18k
roundedbygravity
242
21k
lara
590
61k
jacobian
255
20k
myddelton
109
11k
cherdarchuk
71
260k
aarron
257
36k
sachag
446
36k
pedronauck
652
110k
jnunemaker
PRO
40
4.6k
trallard
14
720
qrush
285
19k
Transcript
Can I haz ur pythons? Rafael Medina García @rmed_dev Fco.
Javier Honduvilla Coto @javierhonduco
Where is python?
Examples for the Java weenies
Simple TCP Socket: Java
Simple TCP Socket: Python
Reading a file: Java
Reading a file: Python
Hashtable: Java
“Hashtable”: Python
Why python rocks? • Function parameters • GC ◦ Reference
counting • Decorators • Types (WTF) • List-Stack-Queue-[...] • PyPI
Concurrency is not parallelism • Concurrency ◦ GIL: Global Interpreter
Lock (</3) i. threads vs processes • celery ii. tasks iii. groups iv. pipes • cpython, pypy
Celery • Async framework task Queue + Tasks = fun
Cpython and moar • cpython ◦ Guido’s Python Interpreter •
pypy ◦ “an implementation of the Python programming language written in Python itself”
Web frameworks + wsgi • Django • Flask • ∞
Scientific packages • ipython + notebook • cython • numba...
Our fav libs • requests (http for humans) • SQLAlchemy
(database toolkit)
SQLAlchemy I
SQLAlchemy II
Is (c)python slow? • Overhead • Cache misses • Complex
data structures • Any variable can change its type • (dynamic)
None
Bibliography • https://jakevdp.github.io/blog/2014/05/09/why-python-is- slow/ • http://docs.python-requests.org/en/latest/ • https://bitbucket.org/zzzeek/sqlalchemy • http://wsgi.readthedocs.org/en/latest/
• http://www.dabeaz.com/python/UnderstandingGIL.pdf • https://docs.python.org/2/library/gc.html • https://pypi.python.org/pypi • http://pypy.org/ • http://www.scipy.org/