I have a model, OrderedList, which is intended to be a listing of content objects ordered by the user. The OrderedList has several attributes, including a site which it belongs to.
The content objects are attached to it via an OrderedListRow class, which is brought into OrderedList's admin via an inline formset in the admin.
class Orde...
is there a way to find out from within a python program if it was started in a terminal or e.g. in a batch engine like sun grid engine?
the idea is to decide on printing some progress bars and other ascii-interactive stuff, or not.
thanks!
p.
...
Does anyone have any experience using django-haystack with the whoosh backend?
I'm looking to use it for a categorized live-search type tool. Is it gonna be fast/efficient enough in a production environment to avoid setting up either solr or xapian?
...
Hi Folks,
Is there a python module that will properly parse/unparse strings for using in shell commands? I'm looking for the python analog to perl's String::ShellQuote::shell_quote:
$ print String::ShellQuote::shell_quote("hello", "stack", "overflow's", "quite", "cool")
hello stack 'overflow'\''s' quite cool
And, even more importantl...
I have a small python VTK function that calculates the volume and surface area of an object embedded in a stack of TIFF images. To read the TIFF's into VTK, I have used vtkTIFFReader and processed the result using vtkImageThreshold. I then use vtkMassProperties to extract the volume and surface area of the object identified after thres...
As a self-taught python hobbyist, how would I go about learning to import and export binary files using standard formats?
I'd like to implement a script that takes ePub ebooks (XHTML + CSS in a zip) and converts it to a mobipocket (Palmdoc) format in order to allow the Amazon Kindle to read it (as part of a larger project that I'm worki...
How can truncate an input like 315.15321531321
I want to truncate all the values after the hundredths position so it becomes 315.15
how do i do that?
...
A lot of the time when I send image data over WSGI (using wsgiref), the image comes out distorted. As an example, examine the following:
...
After looking at the reusable apps chapter of Practical Django Projects and listening to the DjangoCon (Pycon?) lecture, there seems to be an emphasis on making your apps pluggable by installing them into the Python path, namely site-packages.
What I don't understand is what happens when the version of one of those installed apps chang...
I'm writing my second python script to try and parse the contents of a config file and would like some noob advice. I'm not sure if its best to use regex to parse my script since its multiple lines? I've also been reading about dictionaries and wondered if this would be good practice. I'm not necessarily looking for the code just a push ...
Ok, so i've downloaded the following library:
http://www.lag.net/paramiko/
and i can't seem to figure out how to install on my local machine:
Mac OS X 10.4.11
...
I'm using the python OpenCV bindings and at the moment I try to isolate a colorrange. That means I want to filter out everything that is not reddish.
I tried to take only the red color channel but this includes the white spaces in the Image too.
What is a good way to do that?
...
I'm working on a Image-processing chain that seperates a single object by color and contour and then calculates the y-position of this object.
How do I calculate the center of a contour or area with opencv?
Opencv links:
http://opencv.willowgarage.com/wiki/
http://en.wikipedia.org/wiki/OpenCV
...
from django import forms
class ActonForm(forms.Form):
creator = forms.RegexField('^[a-zA-Z0-9\-' ]$',max_length=30, min_length=3)
data = {'creator': 'hello'
}
f = ActonForm(data)
print f.is_valid()
Why doesn't this work? have i made a wrong regular expression? I wanted a name field with provision for single quotes and a hy...
I have pydev on eclipse and would like to debug handlers. I put breakpoint on a handler and start project in debug mode. When I click on the hyperlink corresponding to handler the control does not come back to breakpoint. Am I missing something here?
Also the launch is for google app engine application in python.
...
Let's say that I have a 'Scores' table with fields 'User','ScoreA', 'ScoreB', 'ScoreC'. In a leaderboard view I fetch and order a queryset by any one of these score fields that the visitor selects. The template paginates the queryset. The table is updated by a job on regular periods (a django command triggered by cron).
I want to add a...
Is there any way to search for a perticular package/function using keywords in python console...
for example i may want to search "pdf" for pdf related tasks.
...
I tried several Python IDEs (on Windows platform) but finally I found only Eclipse + PyDev meeting my needs. This set of tools is really comfortable and easy to use. I'm currently working on a quite bigger project. I'd like to have a possibility to use CVS or any other version control system which would be installed on my local harddrive...
I'm writing a simple CMS based on Django. Most content management systems rely on having a fixed page, on a fixed URL, using a template that has one or many editable regions. To have an editable region, you require a Page. For the system to work out which page, you require the URL.
The problem comes when you're no longer dealing with "p...
I'm getting a datetime string in a format like "2009-05-28T16:15:00" (this is ISO 8601, I believe) one hack-ish option seems to be to parse the string using time.strptime and passing the first 6 elements of the touple into the datetime constructor, like:
datetime.datetime(*time.strptime("2007-03-04T21:08:12", "%Y-%m-%dT%H:%M:%S")[:6])
...