I'm trying to write a simple python script that will copy a index.tpl to index.html in all of the subdirectories (with a few exceptions). But I'm getting bogged down by trying to get the list of subdirectories
...
Basically I have some variables that I don't want to preinitialize:
originalTime = None
recentTime = None
postTime = None
def DoSomething ( ) :
if originalTime == None or (postTime - recentTime).seconds > 5 :
...
I get compile error on the if:
UnboundLocalError: local variable 'originalTime' referenced before assignment
...
Hi there,
I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use with Pyt...
I've had a little experience developing small command-line apps with Python, I want to move on to developing GUI's with Python, from all the GUI frameworks for Python the ones I feel most inclined to are wxPython and Tkinter but I don't want to code all the GUI by myself at this time.
Is there any good GUI IDE for any of this frameworks...
I am looking for RAD like environment for PHP and/or Python free or not does not matter.
It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.
I have looked at Delphi4PHP. The RAD part is fantastic, but I don't like the framework on wh...
Hello everyone!
I need to port some functions from C# to Python, but i can't implement next code right:
[SqlFunction(IsDeterministic = true, DataAccess = DataAccessKind.None)]
public static SqlDouble LogNormDist(double probability, double mean, double stddev)
{
LognormalDistribution lnd = new LognormalDistribution(mean,stddev);
...
In PHP, I would do this to get name as an array.
<input type"text" name="name[]" />
<input type"text" name="name[]" />
Or if I wanted to get name as an associative array:
<input type"text" name="name[first]" />
<input type"text" name="name[last]" />
What is the Django equivalent for such things?
...
I'm attempting my first google app engine project – a simple player stats database for a sports team I'm involved with. Given this model:
class Player(db.Model):
""" Represents a player in the club. """
first_name = db.StringProperty()
surname = db.StringProperty()
gender = db.StringProperty()
I want to make a basic ...
I have downloaded & installed the latest Python InformixDB package, but when I try to import it from the shell, I am getting the following error in the form of a Windows dialog box!
"A procedure entry point sqli_describe_input_stmt could not be located in the dynamic link isqlit09a.dll"
Any ideas what's happening?
Platform: Windows Vi...
I've always thought that Python's advantages are code readibility and development speed, but time and memory usage were not as good as those of C++.
These stats struck me really hard.
What does your experience tell you about Python vs C++ time and memory usage?
...
With inspectdb I was able to get a "interval" field from postgres into django. In Django, it was a TextField. The object that I retrieved was indeed a timedelta object!
Now I want to put this timedelta object in a new model. What's the best way to do this? Because putting a timedelta in a TextField results in the str version of the obje...
I have two classes: Account and Operator. Account contains a list of Operators. Now, whenever an operator (in the list) receives a message I want to notify Account object to perform some business logic as well.
I think of three alternatives on how to achieve this:
1) Hold a reference within Operator to the container [Account] object an...
How can I download a webpage with a user agent other than the default one on urllib2.urlopen?
...
Hi,
I'm looking for a way to identify faces (not specific people, just where the faces are) and track them as they move across a room.
We're trying to measure walking speed for people, and I assumed this would be the easiest way of identifying a person as a person. We'll have a reasonably fast camera for the project, so I can probably...
When I say "installed application", I basically mean any application visible in [Control Panel]->[Add/Remove Programs].
I would prefer to do it in Python, but C or C++ is also fine.
...
I couldn't find documentation on an equivalent of Java's final in Python, is there such a thing?
I'm creating a snapshot of an object (used for restoration if anything fails); once this backup variable is assigned, it should not be modified -- a final-like feature in Python would be nice for this.
...
In Python is there any language (or interpreter) feature to force the python interpreter to always raise exceptions even if the exception offending code is inside a try/except block ?
I've just inherited a larger and old codebase written in python, whose purpose is to communicate with some custom designed hardware we also developed.
Ma...
I am trying to write a wrapper script for a command line program (svnadmin verify) that will display a nice progress indicator for the operation. This requires me to be able to see each line of output from the wrapped program as soon as it is output.
I figured that I'd just execute the program using subprocess.Popen, use stdout=PIPE, t...
Edit: Sorry I didn't clarify this, it's a Google App Engine related question.
According to this, I can give db.put() a list of model instances and ask it to input them all into the datastore. However, I haven't been able do this successfully. I'm still a little new with Python, so go easy on me
list_of_models = []
for i in range(0, len...
This is a great primer but doesn't answer what I need:
http://stackoverflow.com/questions/464342/combining-two-sorted-lists-in-python
I have two Python lists, each is a list of datetime,value pairs:
list_a = [['1241000884000', 3], ['1241004212000', 4], ['1241006473000', 11]]
And:
list_x = [['1241000884000', 16], ['1241000992000', 16...