Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python for Java developers
Search
Javier Honduvilla Coto
November 24, 2014
Programming
0
87
Python for Java developers
Javier Honduvilla Coto
November 24, 2014
Tweet
Share
More Decks by Javier Honduvilla Coto
See All by Javier Honduvilla Coto
Debugging – Learning Linux @ Facebook
javierhonduco
0
110
Understanding Ruby with BPF
javierhonduco
1
50
Spying Linux processes
javierhonduco
0
120
word2vec
javierhonduco
0
82
UC3M university cafeteria redesign
javierhonduco
0
94
Mac OSX UI toolkit and design guidelines
javierhonduco
0
130
Other Decks in Programming
See All in Programming
CSC307 Lecture 01
javiergs
PRO
0
640
SwiftUIで本格音ゲー実装してみた
hypebeans
0
550
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
920
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
530
Patterns of Patterns
denyspoltorak
0
400
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
180
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
480
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
220
Deno Tunnel を使ってみた話
kamekyame
0
280
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
150
Featured
See All Featured
Leo the Paperboy
mayatellez
0
1.3k
Designing for Performance
lara
610
70k
Everyday Curiosity
cassininazir
0
110
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Mind Mapping
helmedeiros
PRO
0
43
Heart Work Chapter 1 - Part 1
lfama
PRO
3
35k
ラッコキーワード サービス紹介資料
rakko
0
1.9M
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
39
Building Adaptive Systems
keathley
44
2.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
30
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
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/