Twitter Updates
- Her only comment thus far : "This show is only for girls." 8 hours ago
- Torrenting MLP:FIM. For my daughter. To watch. and for reasons. 9 hours ago
- @shazow +1! I've always wanted a pair of Ety's, but those are a bit out of my price range. I have a knack for destroying headsets. :) 16 hours ago
- @kfury weird mental coercion going on when I read your reply: you said "better rated" and I read "over rated" my bias shows through. :) 16 hours ago
- @kfury Any thoughts on http://t.co/XFRH2uGg ? And agreed that Logitech seems overrated, but http://t.co/vl7m2eQ5 was pretty + on them. 16 hours ago
Blogroll
- 914 electric conversion blog
- ALL ART BURNS
- Arcade Zen
- Brian’s Gallery
- Chili’s World
- Chocomonkey’s Blog
- Follow me on Quora!
- Follow me on Twitter!
- Google Blog
- Juan’s website
- Julia y Daniel
- Katja’s Blog
- Kulick’s blog
- Paul’s Time Sink
- Peter S. Conrad
- Sad Salvation
- Slacy’s Gallery
- Snake Surley
- Sprang’s Blog
- Super Karate Monkey Fist
- Third Time Dad
- Universe Hacking
- Valspark
- Zac’s Story
- Zeigen, Inc.
Tag Archives: python
Python object question about __setattr__ and __getattr__.
Okay, I’m making a mock “object-like” object out of a dict. Details should be pretty much irrelevant. The behavior that I want is like this: o = ObjectLike() # Here, we construct and assign arbitrary nested objects of # type … Continue reading
Announcing availability of Minimongo, a Micro-ORM for MongoDB in Python
Minimongo is an extremely lightweight, schemaless ORM for Python & MongoDB. Minimongo delegates queries directly to pymongo. Minimongo is schemaless. (No Schema validation at all.) Minimongo manages database connections for you. Minimongo offers many other conveniences on top of pymongo, but … Continue reading
Simple pymongo dereference that understands other databases.
Here’s the code for a Python dereference function using pymongo that understands cross-database references properly: import pymongo def dereference(ref): dbname = ref.database collname = ref.collection print ref return pymongo.Connection()[dbname][collname].find_one({‘_id’: ref.id})
Identity mapper & reducer for MongoDB
This code for doing an identity map & identity reduce in MongoDB. Mostly, this is useful for debugging and testing. This code is written in Python, and using the pymongo driver. from pymongo.code import Code connection = pymongo.Connection() # You’ll … Continue reading
Simple script to copy id3 tags from one file to another.
I use lame for batch transcodes of mp3 files, for when I want to put them on a CD-R, or on my phone. I transcode them down to a much lower bitrate than what I store on my server. But, … Continue reading
Both production & development settings using zc.buildout & djangorecipe
It took me a while to figure this out, so I’m writing it down. What I wanted was to have my django.wsgi script use the production settings and to have bin/django use the development settings. Sounds easy, right? It’s not … Continue reading
Posted in General
Tagged development, django, production, python, recipe, zc.buildout
Leave a comment
Python: Unable to find vcvarsall.bat
If you’re running easy_install, pip, zc.buildout, virtualenv, or a similar tool on Windows, and it says: unable to find vcvarsall.bat The issue is that you need a compiler installed on your system. Many people seem to recommend MinGW, but I’ve … Continue reading
Posted in General
Tagged 2008, easy_install, pip, python, vcvarsall.bat, virtualenv, visual studio express, zc.buildout
17 Comments
Django development setup on Windows
Django development on Windows sounds easy, but there are a bunch of steps to get it all working right. Python. Use Python 2.7 from python.org http://python.org/download/. I recommend avoiding the 3rd party Python distributions (ActiveState, Enthought, etc.) and sticking with … Continue reading
Posted in General
Tagged django, postgresql, python, setuptools, visual studio express, windows, zc.buildout
Leave a comment
Python datetime quiz
Without looking at the documentation (or running the code), describe the outputs of the following 4 function calls: from datetime import datetime datetime.datetime.now() datetime.datetime.today() datetime.datetime.now().date() datetime.datetime.today().date() Post your answers as a comment.
Pitfalls of Python’s ‘is’ operator
I saw this post on Friendfeed, and thought I’d reproduce the code here, because it’s a really interesting Python snippet, and to me, basically says never, ever use the ‘is’ operator. Here’s the snippet that I just reproduced on Python … Continue reading