Hi,
I'm playing with Windmill (similar to selenium) with is fun but one of the requirements is that is must be run over http. The project I'm working on is a fat client web app, all of our unit tests are just run on the local file system as there is no need for HTTP as all of the data services are mocked.
So basically what I'm looking ...
I have a text file with a lot of datetime strings in isoformat. The strings are similar to this:
'2009-02-10 16:06:52.598800'
These strings were generated using str(datetime_object). The problem is that, for some reason, str(datetime_object) generates a different format when the datetime object has microseconds set to zero and some str...
I'm trying to setup Django on an internal company server. (No external connection to the Internet.)
Looking over the server setup documentation it appears that the "Running Django on a shared-hosting provider with Apache" method seems to be the most-likely to work in this situation.
Here's the server information:
Can't install mod_py...
I'm having a set of Python scripts that process the photos. What I would like is to be able to create some kind of flash-presentation out of those images.
Is there any package or 'framework' that would help to do this?
...
Hello
I'm trying to run a python script. It works fine when I run it:
python2.5 myscript.py inpt0
The problem starts when I add a shebang:
#!/usr/bin/env python2.5
Result in:
$ myscript.py inpt0
: No such file or directory
Try 2:
#!/usr/local/bin/python2.5
Result in:
$ myscript.py inpt0
: bad interpreter: No such file or di...
I'm looking for a python browser widget (along the lines of pyQT4's QTextBrowser class or wxpython's HTML module) that has events for interaction with the DOM. For example, if I highlight an h1 node, the widget class should have a method that notifies me something was highlighted and what dom properties that node had (<h1>, contents of t...
I'm a C++/C#/.NET developer.
I'm looking for something new and fun. Also I want to develop some web applications. So my question is: is it worth to jump into Python (what is so good about it?), or you recommend me something else (what is so good about something else)?
...
Hi
I'm writing a GUI for using the oracle exp/imp commands and starting sql-scripts through sqlplus. The subprocess class makes it easy to launch the commands, but I need some additional functionality. I want to get rid of the command prompt when using my wxPython GUI, but I still need a way to show the output of the exp/imp commands. ...
I get "database table is locked" error in my sqlite3 db. My script is single threaded, no other app is using the program (i did have it open once in "SQLite Database Browser.exe"). I copied the file, del the original (success) and renamed the copy so i know no process is locking it yet when i run my script everything in table B cannot be...
I need to perform case-insensitive queries on username by default
when using the Django Auth framework.
I tried fixing the issue by writing a custom subclass of Queryset
and overriding the _filter_or_exclude method and then using that
subclass in a custom manager for the User model-
from django.db.models import Manager
from django.db.m...
I have a large set off files (hdf) that I need to enable search for. For Java I would use Lucene for this, as it's a file and document indexing engine. I don't know what the python equivalent would be though.
Can anyone recommend which library I should use for indexing a large collection of files for fast search? Or is the prefered way ...
I've got a fairly complex (about 20,000) line Python program which after some development has started consuming increasing amounts of memory when it runs. What are the best tools and techniques for finding out what all the memory is being used for?
Usually this comes down to either unexpectedly keeping references to objects, or extensio...
I am building a modular application in python. The plugins are not known until runtime.
I envisage that many plugins will create/read/update data, which they themselves care about, and other plugins may care about too.
An approach I am considering:
one plugin may be concerned with Users.
Another plugin may be interested in one or m...
All I want to do is serialize and unserialize tuples of strings or ints.
I looked at pickle.dumps() but the byte overhead is significant. Basically it looks like it takes up about 4x as much space as it needs to. Besides, all I need is basic types and have no need to serialize objects.
marshal is a little better in terms of space but t...
Is it possible to somehow decorate/extend the python standard logging system,
so that when a logging method is invoked it also logs the file and the line number where it was invoked or maybe the method that invoked it.
...
I have a Windows box with cygwin, python and django installed.
Now I want to run django-admin, but when I do I get the error:
$ django-admin.py
c:\Python26\python.exe: can't open file '/usr/bin/django-admin.py': [Errno 2] No such file or directory
...
I thought I was starting to get a grip on "the Python way" of programming. Methods of a class accept self as the first parameter to refer to the instance of the class whose context the method is being called in. The @classmethod decorator refers to a method whose functionality is associated with the class, but which doesn't reference a s...
For our (open source) fullscreen text editor we're changing background colors of gtk.Window, gtk.Fixed, etc. to custom colors. This works fine, but some GTK themes (e.g. Mac4Lin) define background pixmaps instead of background colors for some widgets. Those background pixmaps won't go away when calling modify_bg() methods of those widget...
Hello,
I need to generate code for a method at runtime. It's important to be able to run arbitrary code and have a docstring.
I came up with a solution combining exec and setattr, here's a dummy example:
class Viking(object):
def __init__(self):
code = '''
def dynamo(self, arg):
""" dynamo's a d...
Without using the new 2.6 subprocess module, how can I get either os.popen or os.system to execute my commands using the tcsh instead of bash? I need to source some scripts which are written in tcsh before executing some other commands and I need to do this within python2.4.
EDIT
Thanks for answers using 'tcsh -c', but I'd like to avoi...