I need to perform time consuming tasks in an webapplication.
Because the tasks can be so heavy that they run for minutes they have to run on multiple threads so the user won't have to look at a loading page for minutes.
So I thought a multithreaded queue would be a good solution.
Each instance of a object that you add to the queue shoul...
I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I understand it's not ...
I'm working on a web mapping service and would like to provide my users with a Python API that they can use to create custom plugins. These plugins would be running on my server so I'm trying to lock down Python as much as possible.
To ensure that users can't access files they are not supposed to, I'm planning on running the plugins ins...
Hi All,
I am looking for a Python API (or a C API as I am willing to bind) for editing Windows registries from XP to 7 from within a Linux system.
The Windows target will be a mounted volume under Linux.
I would be willing to code a library if none exists. Therefore, any docs or internals on the registry would be handy too.
Any help,...
In python, I remember there is a function to do this.
.count?
"The big brown fox is brown"
brown = 2.
...
Hello, how can I delete IE 8 cookies for a certain site from Python? TIA
...
I'm reading in a file and sending the data (once encrypted) to a dictionary, with a hash of the data before and after encryption. I then pickle the dictionary but find the file size is massive compared to the source file size. If I write the encrypted data straight to a file the size is identical to the source. Any idea why my pickled fi...
I'm sure this is a easy question, my Google-fu is obviously failing me.
How do you mount a filesystem using Python (i.e the equivalent of running the shell command mount ...). Obviously you can use os.system to run the shell command, but surely this is a nice tidy, python interface to the mount system call.
I can't find it (I thought i...
Hi,
I have sequences in fasta format that contains primers of 17 bp at the beginning of the sequences. And the primers sometimes have mismatches. I therefore want to remove the first 17 chars of the sequences, except from the fasta header.
The sequences look like this:
> name_name_number_etc
SEQUENCEFOLLOWSHERE
> name_number_etc
SEQUE...
I need to get values of these check boxes with same name through HTTP "POST".
<input type="checkbox" id="dde" name="dept[]" value="dde"/>
<input type="checkbox" id="dre" name="dept[]" value="dre"/>
<input type="checkbox" id="iid" name="dept[]" value="iid"/>
How to get these values in python using self.request.get() method?
...
Hello,
I am on windows and I am developing a pygtk app. I need to know when a window is visible or hidden by another window. In order to stop an heavy drawing process.
http://www.pygtk.org/docs/pygtk/class-gtkwidget.html#signal-gtkwidget--visibility-notify-event
I Use the visibility_notify_event to be notified on windows visibility st...
I'm working on a project that involves converting a large amount of HTML content to plain/text. I have a custom-written module that does the job OK, but I'm wondering if there's some standard tools to help get the job done.
...
I am in the process of coding an app which has to get the metadata (author,version..etc) out of several modules (.py files) and display them. The user selects a script and the script is executed. (New scripts can be added and old ones be taken of from the target folder just like a plugin system).
Firstly I import a script and I take o...
I have a sumranges() function, which sums all the ranges of consecutive numbers found in a tuple of tuples. To illustrate:
def sumranges(nums):
return sum([sum([1 for j in range(len(nums[i])) if
nums[i][j] == 0 or
nums[i][j - 1] + 1 != nums[i][j]]) for
i in range(len(nums))])...
I'm trying to learn how to parse .txt files in Python. This has led me to opening the interpreter (terminal > python) and playing around. However, I can't seem to be able to specify the right path. Where does Python first look?
This is my first step:
f = open("/Desktop/temp/myfile.txt","file1")
This blatantly doesn't work. Can an...
I'm trying to figure out how I can use:
order_with_respect_to()
to order via a Child relationship
class Product(models.Model):
name = models.CharField(max_length=100)
class Affiliate(models.Model):
product = models.ForeignKey(Product)
clicks = models.IntegerField(default=0)
I want to be able to display the Products in or...
I have a model form that I am writing a custom widget for in order to replace the many-to-many forms.SelectMultiple fields with jQuery FCBKcomplete widgets. While the replacement of the multiselect element works fine, it is no longer pulling the options for the multiselect.
Here is my widget:
class FCBKcompleteWidget(forms.SelectMultip...
(Important: See update below.)
I'm trying to write a function, import_something, that will important certain modules. (It doesn't matter which for this question.) The thing is, I would like those modules to be imported at the level from which the function is called. For example:
import_something() # Let's say this imports my_module
my_...
I'm having some issues trying to filter a set of objets by their date. Right now I can get all of a
user's transactions like this:
> t = Transaction.all().filter("client_email =", "some_email").filter("application_id =", "foo").fetch(100)
> len(t)
# => 4
Now, if I want to set up some date filters:
> min = datetime.datetime(2009, 2, 3...
I'm using Python appscript to write artwork to my iTunes Songs. I have a file stored in .pict format and when i use the normal open and read() routines, it reads the content as a string (encoded in utf-8).
imFile = open('/Users/kartikaiyer/temp.pict','r')
data = imFile.read()
it = app('iTunes')
sel = it.current_track.get()
sel.artworks...