yolk -l gives me information that I've got 114 packages installed on my Ubuntu 10.04. After creating new virtualenv directory using
virtualenv virt_env/virt1 --no-site-packages --clear
I switched to that, my prompt changed and then yolk -l gives me again the same 114 packages.
What is going on there?
...
I have a string of HTML stored in a database. Unfortunately it contains characters such as ®
I want to replace these characters by their HTML equivalent, either in the DB itself or using a Find Replace in my Python / Django code.
Any suggestions on how I can do this?
...
Hi folks,
I have been playing with other frameworks, such as NodeJS, lately.
I love the possibility to return a response, and still being able to do further operations.
e.g.
def view(request):
do_something()
return HttpResponse()
do_more_stuff() #not possible!!!
Maybe Django already offers a way to perform operations afte...
Is it possible to change User-Agent of Google App Engine UrlFetch service?
...
Hi
I want to install osqa on windows local system for this i have downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has in built django,python,mysql & apache.
I have run a django example given on the django website. Its working fine.
But i am confused how to install osqa. I have downloaded the source code available on...
This is absolutely frustrating, but I am not sure if the following is an issue only on my machine or with IDLE in general.
When attempting to print a long list in the shell, and that could happen by accident while debugging, the program crushes and you have to restart it manually.
Even worse, if you have a few editor windows open, it a...
Hi SO community!
I searched a while but found nothing that helped me. Is there a way to check whether a drive letter stands for a shared drive/network drive or a local disc in python? I guess there is some windows api function that gives me that info, but I cant find it. Perhaps there is even a method already integrated in python?
What...
I want to sort objects using by one of their attributes. As of now, I am doing it in the following way
USpeople.sort(key=lambda person: person.utility[chosenCar],reverse=True)
This works fine, but I have read that using operator.attrgetter() might be a faster way to achieve this sort. First, is this correct? Assuming that it is correc...
I wonder if there are any best practices/patterns for deploying python apps on Google app engine specifically Django. The best practice should be combination of existing best practices viz. Fabric, Paver, Buildout etc. Also please share best practice patterns for developing (I could not get virtualenv running with Django and Django App e...
Hi folks,
I'm trying to add graphs to the admin interface, problem is that I have not found any documentation regarding this.
I'm sure there are generally accepted ways of customizing the way fields are displayed, and I do not wish to follow any problematic route.
Any ideas?
Edit:
this is a model I'm trying to reproduce!
Un...
I have a class which is being operated on by two functions. One function creates a list of widgets and writes it into the class:
def updateWidgets(self):
widgets = self.generateWidgetList()
self.widgets = widgets
the other function deals with the widgets in some way:
def workOnWidgets(self):
for widget in self.widgets:
...
This is my code:
template = loader.get_template('blog/post.html')
c = Context(parameterDict)
return HttpResponse(template.render(c))
I am using this to render data into a template(contained in parameterDict).
The problem is that parameterDict contains certain UTF characters like ®. This is causing a problem in my template...
I've got thousands of urls from many hosts I need to screenshot.
I can use the lib fine from the command line, but how can I integrate it into my code so I can take multiple screenshots simultaneously?
I think it's something to do with xvfb as with the answer to this question: http://stackoverflow.com/questions/1747022/how-to-kill-hea...
Hello all,
my problem is the GIL of course. While I'm analysing data it would be nice to present some plots in between (so it's not too boring waiting for results)
But the GIL prevents this (and this is bringing me to the point of asking myself if Python was such a good idea in the first place).
I can only display the plot, wait till ...
I have a django project that uses a sqlite database that can be written to by an external tool. The text is supposed to be UTF-8, but in some cases there will be errors in the encoding. The text is from an external source, so I cannot control the encoding. Yes, I know that I could write a "wrapping layer" between the external source and ...
Hello,
for putting methods of various classes into a global registry I'm using a decorator with a metaclass. The decorator tags, the metaclass puts the function in the registry:
class ExposedMethod (object):
def __init__(self, decoratedFunction):
self._decoratedFunction = decoratedFunction
def __call__(__self,*__args,*...
Basically I wanted what the pys60 module keycapture does (global capture of keystrokes) but I wanted to do this with the touchscreen. So if the program is running, all touch events can be intercepted and logged by the program. How is this possible?
...
I'm writing a slideshow program with Tkinter, but I don't know how to change the background color to black instead of the standard light gray. How can this be done?
import os, sys
import Tkinter
import Image, ImageTk
import time
root = Tkinter.Tk()
w, h = root.winfo_screenwidth(), root.winfo_screenheight()
root.overrideredirect(1)
root...
I have a basic "best practices" Python question. I see that there are already StackOverflow answers tangentially related to this question but they're mired in complicated examples or involve multiple factors.
Given this code:
#!/usr/bin/python
def test_function():
try:
a = str(5)
raise
b = str(6)
except:
...
Why would one use one over the other:
d = dict() ~0.208 usec
d = {} ~0.06 usec
...