python

how can i update the value of a textbox in a live manner ?

I have a gui interface in blender and the following should be the scenario for the user : after pressing the button "Run" then the user could enter sentences in the input text box such that each sentence should be ended with a dot point '.' then if the user enter a sentence then the input box should be cleared and the entered sentence s...

In Amazon EC2, how do I make it run a python script when I "clone" that instance?

Suppose I have a script in /home/myuser/go.py How do I run that script, when a new instance is booted? (I'm used to using the point-and-click control panel Amazon has...) ...

question regarding universal feed parser

Hey guys, I faced a problem grabbing the content from a couple of blog feeds I have crawled. I'm uncertain what is the reason, but by parsing one or two blogs with the feedparser returns me this particular error: results = feedparser.parse(url) ent = [] for entry in results.entries: e = {} e['title'] = entry.title ...

Where to trigger ast modifications in Python?

I'm doing some AST modifications in Python. This may be done for optimization purpose or other. Where is the right place to put it, so when you do something like: pyhon myfile.py or python runserver.py myapp the modifications took place for every .py executed file? ...

Django: Call self function inside a Django model

I want to call for a self function of a model class as such in upload_to: class Foo(models.Model): filestack = models.FileField(upload_to=self. gen_save_path) def gen_save_path(self): """ gen_save_path: void -> String Generates the path as a string for fileStack field. """ return "some ge...

how to make a rss for my site's info on gae

i want to find a rss lib to do this , did you know ? like this : thanks ...

Python script to read from a file and get values

If in a file the values present are in either " or , separated values "Name" "Tom" "CODE 041" "Has" "Address" "NSYSTEMS c/o" "First Term" "123" 18 "Occ" "Engineer" "Level1" "JT" 18 How should the python script be written so as to get all the above values individually ...

Bundle a python script into an OS X App, but...

I currently have a script that I'm using to update files for me from a couple repositories. The script works fine if I execute it using: python myscript.py However, when I attempt to bundle into an App, it no longer functions correctly because a part of my script requires user input. There is no interface, however, for it to use. I've...

Python dynamically importing a script, need to have its __name__ == "__main__" code to be called

While importing a python script from another script I want the script code that is classically protected by if __name__ == "__main__": .... .... to be run, how can I get that code run? What I am trying to do is from a python script, dynamically change a module then import an existing script which should see the changes m...

Python time.gmtime() returning time that's 5 hours ahead of system time

I have been scouring the google machine and have come up with nothing to answer this. When making calls to: time.gmtime() This ends up returning a time, as the subject line says, 5 hours ahead of my system time. I cannot figure out what is going on. time.tzname() returns the proper timezone. Aside from setting python to a timezone...

python apt-get list upgrades

hi, how can i get a list of upgrade packages available and write it to file using python? when i run "apt-get upgrade > output" it works in bash, I think i have to send the trap signal (ctrl-C) in python program any suggestions? on how to achieve this... -krisdigitx i tried this on the code now, #!/usr/bin/env python import su...

Retrieving the Return Value of a Stackless Python Tasklet Bound Function?

Stackless Experts, I have managed to create tasklets under Stackless Python (both from the Stackless and the C side). It seems to me that in order to create a tasklet in Stackless, you bind an arbitrary Python callable (function) to the tasklet (as well as the required parameters), so the bound callable would be run as a tasklet. Howev...

Can't import scriptext module in PyS60 2.0 on N95

When I try and import scriptext on PyS60 version 2.0 on my N95 phone, I get an import error saying that there is no module named scriptext. How can I work out what the problem is? ...

Python C API: Switch on PyObject type

I have some code to interface Python to C++ which works fine but every time I look at it I think there must be a better way to do it. On the C++ side there is a 'variant' type that can deal with a fixed range of basic types - int, real, string, vector of variants, etc. I have some code using the Python API to convert from the equivalen...

is ready made vmware images good for python website development

I tried a lot and was not able to set python with django and wastd full day. I just found this http://bitnami.org/stack/djangostack Is that good for development and alos does it has mod_wsgi enabled on apache. I want to make sure that , everything is ok , so that i can start building app on this IF there are any other alternatives ...

How to use Python files spread out over many folders, or: how to organize a project.

I am looking to make my project fulfill the guidelines described here: http://infinitemonkeycorps.net/docs/pph/. I currently have the following directories: src/ test/ doc/ I would really like to organize my src/ file as follows: src/ similar_files/ other_files/ helpers/ etc However, I'm not familiar with how I could ha...

What is effected by ReferenceProperty

In reference to this two questions (see links below) and the Google AppEngine doc, I got a little bit confused: class Author(db.Model): name = db.StringProperty() class Story(db.Model): author = db.ReferenceProperty(Author) story = db.get(story_key) author_name = story.author.name source google The doc example indicates th...

Python: Object assignment with variable argument list

Is there a method to pass a variable number of arguments to a function and have it change those arguments using the ( *args, **keywords ) style of argument passing? I've tried a few things but either see no change or have an error raised by the compiler: def foo( *args ): args[0] = 4 This gets me TypeError: object does not suppor...

Exceptions from Buildbots PeriodicScheduler intervals?

Buildbots Periodic scheduler triggers builds at fixed intervals (e.g. every 30 minutes). But there are certain times (e.g. at night, during the weekend or while regular maintenance is performed) where I'd like it to relax. Is there a way to have a more fine-grained description for the Periodic scheduler? Or should I rather use the Night...

Removing spaces and newlines between tags in html (aka unformatting) in python

An example: <p> Hello</p> <div>hgello</div> <pre> code code <pre> turns in something like: <p> Hello</p><div>hgello</div><pre> code code <pre> How to do this in python? I make also intensive use of < pre> tags so substituting all '\n' with '' is not an option. What's the best way to do that? ...