mirror of
https://github.com/not-kennethreitz/python-for-humans.git
synced 2026-06-05 15:10:20 +00:00
wtf
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
!SLIDE
|
||||
# Let's Build Things.
|
||||
|
||||
Python needs more Pragmatic Packages.
|
||||
|
||||
!SLIDE small
|
||||
|
||||
pra•gmat•ic |pragˈmatik|,
|
||||
*adj*, dealing with things sensibly and realistically in a way that is
|
||||
based on practical rather than theoretical considerations.
|
||||
|
||||
!SLIDE
|
||||
# Some Examples
|
||||
|
||||
!SLIDE
|
||||
# NOT PRACTICAL
|
||||
|
||||
[fucking urllib2 code]
|
||||
|
||||
!SLIDE
|
||||
# NOT PRACTICAL (cont)
|
||||
|
||||
!SLIDE
|
||||
# Practical.
|
||||
|
||||
@@@ ruby
|
||||
|
||||
!SLIDE
|
||||
# Pragmatic.
|
||||
|
||||
@@@ python
|
||||
import requests
|
||||
|
||||
url = 'https://api.github.com/user'
|
||||
auth = ('username', 'password')
|
||||
|
||||
r = requests.get(url, auth=auth)
|
||||
print r.content
|
||||
|
||||
|
||||
!SLIDE
|
||||
# Fit the 90% Use Case.
|
||||
|
||||
!SLIDE
|
||||
# Fit the 90% Use Case.
|
||||
|
||||
!SLIDE
|
||||
# urllib2
|
||||
|
||||
"I'd rather be writing ColdFusion."
|
||||
|
||||
!SLIDE
|
||||
# subprocess
|
||||
- envoy
|
||||
Reference in New Issue
Block a user