In python, how can I load a sqlite db completely to memory before connecting to it?
I have a 100 mega bytes sqlite db file that I would like to load to memory before performing sql queries. Is it possible to do that in python? Thanks ...
I have a 100 mega bytes sqlite db file that I would like to load to memory before performing sql queries. Is it possible to do that in python? Thanks ...
Hello all, I am building Froyo, is it possible that during building, make/python can output the file and the command it is calling right now. For example, in one of the Android.mk, there is a line, says, echo build success. On the monitor it will show "build success", what I want is that in addition, it shows "Android.mk line 20: ech...
I am creating a pager that returns documents from an Apache CouchDB map function from python-couchdb. This generator expression is working well, until it hits the max recursion depth. How can it be improved to move to iteration, rather than recursion? def page(db, view_name, limit, include_docs=True, **opts): """ `page` goes ret...
M2Crypto raises a TypeError when loading SSL CA certificates. I'm getting the path of an SSL certificate from an instance of a Django model. My code worked perfectly because I was pulling the path of the certificate from a Django model My code: from M2Crypto import SSL from django.db import models class MyModel(models.Model): ...
For a small project I'm working on I need to cycle through a list. For each element of this cycle I have to start another cycle through the same list, with the former element as first element of the new cycle. For example I'd like to be able to produce something like this: 1, 2, 3, 4, 1, 2, 3, 4, 1, ... 2, 3, 4, 1, 2, 3, 4, 1, 2, ... 3,...
I need a regexfield in a django form to only accept letters and numbers, and nothing else. I've tried this, but it didn't work: myfield = forms.RegexField(label=("My Label"), max_length=31, regex=r'[a-zA-Z0-9]', error_message = ("This value must contain only letters and numbers."), I am not very good at using regular expressi...
if I have 2 strings like: a = "hello" b = "olhel" I want to use a regular expression (or something else?) to see if the two strings contain the same letters. In my example a would = b because they have the same letters. How can this be achieved? ...
Thanks in advance for taking the time to read this. Apologies that it is somewhat verbose. But hopefully it fully explains the problem. Stripped code demonstrating the issue is included. I'm having an issue with PyQt4 SIGNAL/SLOTS. While I can make everything work fine if I am writing in a single file, I can't make things work if I some...
I'm using python 2.7, and trying to run some CPU heavy tasks in their own processes. I would like to be able to send messages back to the parent process to keep it informed of the current status of the process. The multiprocessing Queue seems perfect for this but I can't figure out how to get it work. So, this is my basic working exampl...
Hi, I am trying to use Pylint with Emacs on Windows XP. My Emacs version is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install pylint, I added the following lines to Emacs init file, copied form Emacs Wiki. When I invoke the flymake-mode on a .py file, I can see the flymake starting the syntax check, the mode status c...
I tried to install Pylons 1.0 with Python 2.7 using the easy_install command in Windows Vista 64 but got the error: raise ValueError(str(list(result.keys()))) ValueError: [u'path'] Here is the link to the whole installation process from command prompt http://pastie.org/1190341 Why do I get this error? How do I solve it? Will P...
When I try to import pylons in the virtual python environment I get the error C:\env\Scripts>python Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (A MD64)] on win32 Type "help", "copyright", "credits" or "license" for more informati on. >>> import pylons Traceback (most recent call last): File "<stdin>", line 1, in ...
I'd like to annotate a plot in matplotlib with filled and non-filled dots. I can create a circle patch, but the circle scales with my axes which is not my desired effect. I can achieve this with plt.plot(x,y,'.',markersize=10) plt.plot(x,y,'o',markersize=10) but both markers are filled even if I set markerfacecolor=None. ...
I downloaded the win32 for python 2.6 from this site. This is the code to get/set the clipboard. def test(): OpenClipboard() d=GetClipboardData(win32con.CF_TEXT) # get clipboard data SetClipboardData(win32con.CF_TEXT, "Hello") # set clipboard data CloseClipboard() if __name__ == '__main__': if sys.platform == 'wi...
I've got two applications (app1 and app2) in my django project. I'm curious if there is a way to import things between applications. baseProject --app1 ----models.py ----etc.. --app2 ----models.py ----etc.. I'd like to be able, while in app2, to import something from the models section of app1. Is there an intended method to do ...
I'm trying to kill a thread in python. An exception would be the preferred way to do it, as a graceful exit of the run method of the thread through a try:except: pair would allow to close resources. I tried : http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python , but is specifies that is doesn't work whi...
Does anyone have a very simple example of using a find dialog with a text component in wxpython? Thanks in advance. ...
I'm trying to make a key logger for Mac OS for one of my research projects. I have a C code which will grab keystroke and write them to a text file. (The following code I have taken out some not important stuff) What I need to do now is just like PyHook, instead of write the data to a text file, to pass a Python callback function to th...
I found a lot of options but this one https://launchpad.net/django-openid-auth looks good. sadly I can't find examples/HOWTO about this?Does anyone point/redirect me to correct urls? ...
hi, i used following code to establish connection between my local machine and the remote machine : import os, sys, ftplib nonpassive=False remotesite= '10.88.203.21:22' remoteuser='root' remotepass='v-peg8!@#' localdir= "c:\\.." print "connecting" connection=ftplib.FTP(remotesite) print "successfully connected" connection.login(remo...