Python

Python

Rules: a) English stuff only, b) Don't double post, c) Stick with posts if already posted, d) You can cross post but not in unrelated or non-English groups.
kunthar
Please explain me GIL!
Adriano
Guido van ROSSUM :: spending time with his Python :-)
Guido van ROSSUM :: spending time with his Python :-)
python maintenance by Guido - newtover
photo probably taken before his Dropbox t-shirt days :-) - Adriano
Adriano
Real-world Python deployment using pip & virtualenv - http://slacy.com/blog...
tekNico
John Hunter, the Matplotlib creator, died on August 28th, 2012. Please donate for his three children. "John Hunter Memorial Fund" <http://numfocus.org/johnhun...>.
John-hunter.jpg
tekNico
hailsematary
"Pystache is a Python implementation of Mustache. Mustache is a framework-agnostic, logic-free templating system inspired by ctemplate and et. Like ctemplate, Mustache "emphasizes separating logic from presentation: it is impossible to embed application logic in this template language."" - hailsematary from Bookmarklet
templating için snipmate'i kullanıyorum https://github.com/msander... gerçi, ama bıyıklı python'u sevdim, ondan paylaşıyorum, kıps kıps - hailsematary
Adriano
Develop UBUNTU apps :: using Quickly < 5 min . [includes PyGTK] - http://www.youtube.com/watch...
Develop UBUNTU apps :: using Quickly < 5 min . [includes PyGTK]
Play
"Canonical has launched its app developer web site in a bid to persuade developers to port applications over to its Ubuntu Linux distribution. Ubuntu's Software Center is Canonical's app store for its popular Ubuntu Linux distribution, offering both free and paid applications." For details, see http://developer.ubuntu.com \\ Transcript of video: http://developer.ubuntu.com/wp-cont... - Adriano from Bookmarklet
Adriano
Web scraping with Python :: Dark side of data - http://forgetfulfunctor.blogspot.com/2011...
"I found a great presentation given at Pycon in 2010 by Asheesh Laroia. I thought this might be a valuable resource for R users who are looking for ways to gather data from user-unfriendly websites." - Adriano from Bookmarklet
Adriano
Lennart REGBRO :: Porting to Python 3 . [in-depth eBook online] - http://python3porting.com/bookind...
Lennart REGBRO :: Porting to Python 3  . [in-depth eBook online]
looks thorough and helpful... just read the section on C-extensions (which 2to3 does not handle). - Adriano
Adriano
Cleverbot :: AI vs. AI, two chatbots talking to each other - http://www.youtube.com/watch...
Cleverbot :: AI vs. AI, two chatbots talking to each other
Play
pycleverbot - Python binding for the cleverbot web site http://code.google.com/p... - Adriano from Bookmarklet
Adriano
Web micro-framework BATTLE! - http://www.slideshare.net/r1chard...
Web micro-framework BATTLE!
scores : bottle 7, pesto 6, itty 4, flask cgi+wsgiref 3, werkzeug 2, web.py 1, cherrypy 0, bobo -2, aspen.io -5. - Adriano from Bookmarklet
tekNico
Look ma, realtime, no C extensions, 50 frames per second! Next time they tell you Python is slow, show them this. :-) "Realtime image processing in Python - PyPy Status Blog" <http://morepypy.blogspot.com/2011...>
pypy.png
I witnessed it during the Europython talk, it was so wonderful, I was moved. :-) <http://ep2011.europython.eu/confere...> - tekNico
Faruk
What is the best tool for HTML parsing with Python?
Try html5lib (http://code.google.com/p...), though there are cases when it is not so tolerant as browsers. - newtover
or try Beautiful Soup (http://www.crummy.com/softwar...) - Black Noir
can i use it on google app engine? - Faruk
Sure, both are written in pure Python. - newtover
thanks, i am trying BeautifulSoup now. It looks good - Faruk
herkes sen gibi dinazor değil emreyılmaz ne regexi - aydın
:D - Faruk
Late to the party, but for the record: BeautifulSoup is slow and abandoned. Use lxml.html <http://lxml.de/lxmlhtml.html>. - tekNico
Adriano
Alex MARTELLI :: What functionality does functools.partial offer that you can't get through lambdas? - http://stackoverflow.com/questio...
Alex MARTELLI :: What functionality does functools.partial offer that you can't get through lambdas?
"functools.partial's returned function is decorated with attributes useful for introspection -- the function it's wrapping, and what positional and named arguments it fixes therein. Further, the named arguments can be overridden. [T]hink of lambda as an eyesore anomaly in Python... if I could go back in time and change one thing within Python, it would be the absurd, meaningless, eyesore def and lambda keywords: make them both function." - Adriano from Bookmarklet
Adriano
Guido van Rossum :: 21 Years of Python, from Pet Project to Programming Language of the Year. - http://perspectives.mvdirona.com/2011...
talk at Amazon last week. Slides: http://mvdirona.com/jrh... - Adriano from Bookmarklet
aydın
deployment python project on nginx(mod-wsgi) blocking requests problem http://blog.dscpl.com.au/2009...
Faruk
Any ideas about 3rd party Google Earth apps? Can we use Python to create one?
ĎÚβĨŐÚŚ Dod
Webpy CSRF protection (request for comments) - https://gist.github.com/857297
Once again, I'm doing something small in web.py, but this one also has forms, and that's CSRF waiting to happen. Does my solution at https://gist.github.com/857297 look safe? Anyone knows about any internal/other web.py CSRF protection scheme out there? I'd rather not invent wheels when it comes to security. - ĎÚβĨŐÚŚ Dod from Bookmarklet
Brian Sullivan
I am regex challenged.
Some Python code I am looking uses this "filenamepattern=re.compile(r'[A-Za-z0-9][\w\_\-\.]*$')" to validate valid patterns. I want to add the space character to the valid list. What should I change the code to? - Brian Sullivan
r'[A-Za-z0-9][\w\_\-\.]*$' change to r'[A-Za-z0-9\s][\w\_\-\.\s]*$' - Sergey Mezentsev
see the '\s' special character http://docs.python.org/library... - Sergey Mezentsev
Ok that seems to do what I want - thanks. - Brian Sullivan
aydın
a is not b but p is q, guess why
isequal.png
@mirat, i m not sure, basically "is" is not for equivalent, it is for object identification but the strange thing is why it differs - aydın
yeap the point is python caches small ints (till 256) and when you define an int it returns cached small int object so "is" comparasion passes but after 256 python creates new object and "is" failed, thanks to ahmet :) - aydın
Extra credit, explain: p=1000; q=1000; p is q - Rob Syme
Every code object has a tuple of constants. The LOAD_CONST opcode loads a constant from this tuple onto the VM stack. So every time 1000 occurs in the program text, it refers to the same object in the tuple of constants for that block. At an interactive interpreter, each line is its own block. You can put multiple simple statements in one statement with semi-colons, so here you've... more... - Jeremy Hylton
it is clearer for now, thanks jeremy - aydın
thanks for this feed - amir
ĎÚβĨŐÚŚ Dod
Flocks is yet-another-attempt to go back from centralized social networking services to decentralized microblogging. | It's not finished yet (you can read, but can't post yet), still - [IMHO] the current version is already useful: this is where I get all those KITTEH items I keep tweeting about lately :) - ĎÚβĨŐÚŚ Dod from Bookmarklet
Attention #Flocks premature-adapters: "FlockRoll" is the new "Public" (less ambiguous). Please rename your "Public" ("Go" to it and "Edit"), Otherwise - you'll see no feeds when logged out. | If you install from scratch (or delete flocks.db), this will take care of itself. - ĎÚβĨŐÚŚ Dod
kirpit
"The rise of C# and Python are continuing in 2011. Both languages scored another all-time high this month and are now busy with overtaking PHP. Other interesting news is that we started to add results of Chinese search engine Baidu and reintroduced Yahoo!. These search engines now only count for 3% each until all false positives have been weeded out. This change has already some effect: JavaScript is back in the top 10 while SAS and Transact-SQL both lost much ground." - kirpit from Bookmarklet
Adriano
David Beazley :: Python GENERATOR Tricks for Systems Programmers (2008) - http://www.dabeaz.com/generat...
nice illustrations using generator objects (skipping list comprehension). - Adriano
Adriano
Yelp Engineering :: Python mrjob, MapReduce Distributed Computing for Everybody - http://engineeringblog.yelp.com/2010...
Yelp uses Amazon S3 to store daily logs and photos, generating around 100GB of logs per day. The company also uses Amazon Elastic MapReduce to power approximately 20 separate batch scripts, most of those processing the logs. \\ "We retired our Hadoop cluster for good, and switched all of our production jobs over to EMR. Our framework, mrjob, is finally mature enough that we're releasing it as an open source library. If you're new to MapReduce and want to learn about it, mrjob is for you. If you want to run a huge machine learning algorithm, or do some serious log processing, but don't want to set up a Hadoop cluster, mrjob is for you. If you have a Hadoop cluster already and want to run Python scripts on it, mrjob is for you. If you want to migrate your Python code base off your Hadoop cluster to EMR, mrjob is for you." - Adriano from Bookmarklet
Brian Sullivan
Anybody heard of any implementation of Rackspace CloudFiles for Zope? Ideally a product that turns the Rackspace cloud system into folders/objects on Zope transparently.
Brian Sullivan
I am looking for a strategy or samples (or even just a hint as to the best process) to create an email opt-in strategy in Zope. I am thinking that what you do is use some sort of one way hash on the email address and decode it to verify but beyond that it gets hazy.
Maybe what I am referring to is actually what is traditionally called "double opt-in" or "opt-in with confirmation". - Brian Sullivan
So based on what I am seeing -- some sort of MD5(not totally sure what that means but I understand there are Python supplied functions to generate it) hash of a combination of the email address and date/time stored and then sent to the user should guarantee that it is unique, can't be auto generated by some bot and should allow verification on http access using the hash in the url? - Brian Sullivan
OK -- all the potential solutions I am seeing use Python 2.5 + -- the version of Zope I am using is based on Python 2.4.4. - Brian Sullivan
Brian Sullivan
Does anybody have any experience with using Zope on a Rackspace Cloud server -- specifically a Rackspace Cloud Windows server?
Should I expect the server supplied by them to respond like a dedicated server ? - Brian Sullivan
I am happy to report that installing Zope on a Windows Rackspace Cloud server is dead easy. Creating and deploying multiple servers is just as easy, as is image backup and reverse DNS control. I am guessing for Linux people it is just as easy (and cheaper). The price is right, the service is right -- scalable and manageable. Is anybody else in the Zope world using them? - Brian Sullivan
Adriano
Bryan O'Sullivan :: Dual bitbucket / github citizenship via Mercurial - http://www.serpentine.com/blog...
Bryan O'Sullivan :: Dual bitbucket / github citizenship via Mercurial
"[A]lthough bitbucket is pretty good [and free now for <= 5 users], github is currently far slicker, and has a much larger community of potential collaborators. I’ve hosted most of my code on bitbucket for quite a while. Until this morning, I had a somewhat awkward way to mirror code to github. I just automated the problem away... [code]" #hg - Adriano from Bookmarklet
see also, Create a Git Mirror by Steve Losh, http://hgtip.com/tips... - Adriano
Here an additional resource for Git. 'Pro Git' by Scott Chacon, http://progit.org/book/ - Dan Kartono
Brian Sullivan
I am seeing more and more of these freelance marketplace type sites (maybe they have been there all along but I just wasn't looking). I remember something like this a long time ago -- a flood of sites that started about the same time, then just faded away.
Do these sites really work for anybody? On either the freelancer side or on the in need of help side? - Brian Sullivan
Depends on which ones you mean, and what you mean by 'work'.The actual marketplaces like elance or odesk work fine for what they are (a way to connect unsatisfied demand with low-price labor), but the 'contest' style sites are arguably a rip-off for the designers. - Michael R. Bernstein
No I was thinking odesk et al? Have you been successful there -either as a freelancer or looking for freelancers to work for you? - Brian Sullivan
It give a chance for employee and employer from around the world to be part of it. As long as there are requirements, and profitable too, it may last for a long. It is a hype now, and scams will come along too, beware. *hope ff will make a detailed timeline and better appearance for its comments, it's so lack of information. - Dan Kartono
But has anybody actually been successful using them from either side - the hiring or being hired sides? - Brian Sullivan
Huh, funny. I just got this article in my inbox today, from odesk. (http://www.inc.com/magazin...). @Brian Sullivan I already have an experience, being hired in getafreelancer, not odesk---just about to start there. - Dan Kartono
Brian, as freelancer I have largely avoided those sites, as I'm too high-priced to get much business [ETA: high-priced in this context seems to be anything over $20/hr.]. Anecdotally, I've seen accounts of US based developers that pretend they *aren't* in the US so they can get the low paying jobs (which are still better than nothing when you're unemployed). - Michael R. Bernstein
I tried a number of years ago to get some specialized help through one of these services (I forget the site name) -- it just didn't seem to be a reasonable way to do it. Working with or as a freelancer implies a certain amount of trust on both sides -- somehow that seems hard to establish effectively except in a less formal situation. - Brian Sullivan
Brian Sullivan
I am looking for a standard way (using python) to define time intervals for periodic events. I need to define things like every weekday at 8 am, the 2nd day of every month at 8am, every weekday at 8am, 10am and 3pm in addition to easy things like everyday at 1pm.
Does such a standard exist - perhaps with a library to manage the conversion to real times? - Brian Sullivan
Couple resources, may or may not help: https://github.com/paxan... , http://blog.mfabrik.com/2008... - Micah
The first one looks like exactly the type of thing I had in mind -- thanks. - Brian Sullivan
Excellent. :) - Micah from FFHound(roid)!
Now if I could just figure out how to use it in Zope 2. - Brian Sullivan
Other ways to read this feed:Feed readerFacebook