jknupp
Python: `with` Context Managers
How Do You Rewrite a Project From Scratch Once It's On GitHub?
Omega: The Last Python Web Framework
Writing Idiomatic Python Ebook
Docker Blurs the Line Between SaaS and Self-Hosted Apps
Docker is the Most Disruptive Technology in the Last Decade
Python Classes and Object Oriented Programming
Re:Finding the best ticket price – Simple web scraping with Python
on Tuesday June 17, 2014 @09:30AM (#7904269)
A shorter, more comprehensible version:
import requests
from bs4 import BeautifulSoup
from urlparse import urljoin
URL = 'http://philadelphia.craigslist.org/search/sss?sort=date&quer...
BASE = 'http://philadelphia.craigslist.org/cpg/'
response = requests.get(URL)
soup = BeautifulSoup(response.content)
for listing in soup.find_all('p',{'class':'row'}):
if listing.find('span',{'class':'price'}):
price = int(listing.text[2:6])
if 100 < price <=250:
print listing.text
print urljoin(BASE, listing.a['href']) + '\n'REST APIs, ORMs, And The Neglected Client
In Support of Female Engineers
How 'DevOps' Is Killing The Developer
Great Products Seem Obvious in Retrospect
Re:Why I'm Boycotting Mozilla Products
on Saturday March 29, 2014 @04:02PM (#7493718)
I never accused him of being a homophobe, I simply stated all that I can glean from the facts: he doesn't believe homosexuals should be allowed to marry.
Re:Why I'm Boycotting Mozilla Products
on Saturday March 29, 2014 @02:10PM (#7493198)
Notice I never said "He should never be allowed to state his opinion." He's free to do so, and did. And in doing so made a public statement about his views. If you believe basic human rights should be denied to a group of individuals, I have an issue with that.
Re:Why I'm Boycotting Mozilla Products
on Saturday March 29, 2014 @02:01PM (#7493164)
I agree. I'm not being consistent in my views. I'm going to continue to use JavaScript, but I don't the Eich should be running Mozilla. Humans are complicated.
Why I'm Boycotting Mozilla Products
Writing Idiomatic Python: The Video Series
A Web Hosting Service That Teaches You How To Host Your Web App
Contribute to an OSS Python app for reviewing OSS Python apps
Re:Free invites to Atom, GitHub's new text editor
on Monday March 10, 2014 @10:25PM (#7377064)
[email protected] please
Re:Free invites to Atom, GitHub's new text editor
on Monday March 10, 2014 @08:42PM (#7376717)
Re:What is a Web Framework?
on Tuesday March 04, 2014 @04:04PM (#7343122)
Sorry, seems like Disqus was serving up spammy ads along with the comments. I've disabled the ads.
Re:What is a Web Framework?
on Tuesday March 04, 2014 @04:03PM (#7343113)
The goal was not to convince anyone that they needed to use a web framework. Rather, I hoped to explain to novices exactly what a web framework is and what problems it solves.
Re:A Celery-like Python Task Queue in 55 Lines of Code
on Tuesday February 11, 2014 @01:14PM (#7219179)
No, I mean ZeroMQ takes care of the underlying queue for free (there is an underlying set of queues, which can be persisted if necessary)
Re:A Celery-like Python Task Queue in 55 Lines of Code
on Tuesday February 11, 2014 @12:31PM (#7218837)
Checkout sandman: www.sandman.io or www.github.com/jeffknupp/sandman
Re:A Celery-like Python Task Queue in 55 Lines of Code
on Tuesday February 11, 2014 @12:02PM (#7218625)
ZeroMQ takes care of the queueing. Though I didn't delve into it in depth in this example, you can create quite sophisticated broker-less distributed systems pretty easily with ZeroMQ.
Re:A Celery-like Python Task Queue in 55 Lines of Code
on Tuesday February 11, 2014 @12:00PM (#7218596)
Pickle (or any use of eval) is a security risk only if you're using it in the context of untrusted code. Basically any distributed task queue is going to have that risk if it can execute arbitrary code.
Re:A Celery-like Python Task Queue in 55 Lines of Code
on Tuesday February 11, 2014 @11:08AM (#7218248)
Ah, I'm sorry to hear that. Hopefully, they make their library code more readily available before closing their doors.