According to this discussion of Google App Engine on Hacker News,
A DB (read) request takes over 100ms on the
datastore. That's insane and unusable
for about 90% of applications.
How do you determine what is an acceptable response time for a DB read request?
I have been using App Engine without noticing any issues with DB res...
Hello python guys,
I am a php programmer and since Komodo apears to be programmed in Python I am call in on you guys.
Normally a php class is called like this:
exampleClass::classFunction(arg);
However I use php a bid different and my classes are called like this:
Y::s('exampleClass')->classFunction(arg);
If you are wondering, th...
I'm making a Twitter client with PyQt, which uses WebKit to draw the tweet list. Now I'm trying to use CSS to set a background image in the WebKit widget - but the image won't show up. This is the relevant part of the CSS:
body
{ ...
Hi folks,
I'm using mechanize to navigate pages, it works pretty well.
Unfortunately I have a random error come up, by random I mean it occasionally appears.
URLError at /test/
urlopen error [Errno 1] _ssl.c:1325: error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record mac>
I really need help on this one :)
...
I wrote a python script that does some stuff to generate and then keep changing some text stored as a string variable. This works, and I can print the string each time it gets changed.
Problems have arisen while trying to display that output in a GUI (just as a basic label) using tkinter.
I can get the label to display the string for t...
This is happening in python files.
For example, I want to do type "fC" in normal mode, and instead of finding the first "C" character, it is just doing code fold toggling.
...
I use dumpdata to output all my apps's classes. One of my app has one class that never get's outputted and I don't know where to start looking to know what's wrong. The class is used regularly, every other classes in the app are dumped fine and dumpdata doesn't throw any error.
Any cue ?
...
I have a django queryset in my views whose values I pack before passing to my template. There is a problem when the queryset returns none since associated values are not unpacked. the quersyet is called comments.
Here is my views.py
def forums(request ):
post_list = list(forum.objects.filter(child='0')&forum.objects.filter(deleted=...
I'm trying to calculate the similarity (read: Levenshtein distance) of two images, using Python 2.6 and PIL.
I plan to us
e the python-levenshtein library for fast comparison.
Main question:
What is a good strategy for comparing images? My idea is something like:
Convert to RGB (transparent -> white) (or maybe convert to monochrome?...
Tab completion on IPython seems not to be working. For example,
import numpy
numpy.<tab>
simply adds a tab.
import numpy
num<tab>
just adds a tab, too. Could you please suggest some possible causes for this problem? I am running Windows 7 and Python 2.6.5.
...
This loop checks if a record is in the sqlite database and builds a list of dictionaries for those records that are missing and then executes a multiple insert statement with the list. This works but it is very slow (at least i think it is slow) as it takes 5 minutes to loop over 3500 queries. I am a complete newbie in python, sqlite and...
I'm trying to build a better/more powerful form class for Django. It's working well, except for these sub-forms. Actually, it works perfectly right after I re-start apache, but after I refresh the page a few times, my HTML output starts to look like this:
<input class="text" type="text" id="pickup_addr-pickup_addr-pickup_addr-id-pickup_...
I have a python program that needs to generate several guids and hand them back with some other data to a client over the network. It may be hit with a lot of requests in a short time period and I would like the latency to be as low as reasonably possible.
Ideally, rather than generating new guids on the fly as the client waits for a re...
Hi,
Is it possible to have assignment in a condition?
For ex.
if (a=some_func()):
# Use a
...
There are a lot of questions about matplotlib, pylab, pyplot, ipython, so I'm sorry if you're sick of seeing this asked. I'll try to be as specific as I can, because I've been looking through people's questions and looking at documentation for pyplot and pylab, and I still am not sure what I'm doing wrong. On with the code:
Goal: plot ...
I am trying to get a list of IP addresses serving or downloading a file. What I did was to contact a tracker like openbittorrent.com to get the following (as part of the scrape file):
B%00%00%0C%5F%B1%B1l%CAGa%84S%CB%B0%9BG%84%3BE:0:1
Now, the long string in the beginning is the info hash. As a next step, I did this:
http://tracker.s...
I have a factory method that generates django form classes like so:
def get_indicator_form(indicator, patient):
class IndicatorForm(forms.Form):
#These don't work!
indicator_id = forms.IntegerField(initial=indicator.id, widget=forms.HiddenInput())
patient_id = forms.IntegerField(initial=patient.id, widget=for...
Looking in my /usr/local/lib/python.../dist-package directory, I have .egg directories and .egg files.
Why does the installer choose to extra packages to the .egg directory, yet leave other files with .egg extensions?
...
For anyone who's spent some time with sml, ocaml, haskell, etc. when you go back to using C, Python, Java, etc. you start to notice things you never knew were missing. I'm doing some stuff in Python and I realized what I really want is a functional-style datatype like (for example)
datatype phoneme = Vowel of string | Consonant of voice...
I'm trying to write some Python code that will establish an invisible relay between two TCP sockets. My current technique is to set up two threads, each one reading and subsequently writing 1kb of data at a time in a particular direction (i.e. 1 thread for A to B, 1 thread for B to A).
This works for some applications and protocols, but...