I'm trying to implement svnperms into a repository, but am having difficulty with a few things:
pre-commit has the execute permissions:
-rwxrwxr-x 1 svnadm svn 3018 May 27 10:11 pre-commit
This is my call to svnperms within pre-commit:
# Check that the author of this commit has the rights to perform
# the commit on t...
I want to save a set of key, value pairs (string, int) between runs of a Python program, reload them on subsequent runs and write the changes to be available on the next run.
I don't think of this data as a configuration file, but it would fit the ConfigParser capabilities quite well. I would only need two [sections]. It's only a few hu...
I am going to move to a 64 bit machine and a 64 bit OS (Windows) and am trying to figure out if any of the extensions/packages I am using are going to be lost when I make the move. I can't seem to find whether someone has built a list of known issues as flagged on the Python 2.5 release page. I have been using 2.5 but will at this tim...
I'm basically wondering if Python has any OOP shortcomings like PHP does. PHP has been developing their OOP practices for the last few versions. It's getting better in PHP but it's still not perfect. I'm new to Python and I'm just wondering if Python's OOP support is better or just comparable.
If there are some issues in Python OOP wh...
What's the best Python equivalent of Common Lisp's maplist function? From the maplist documentation:
maplist is like mapcar except that
function is applied to successive
sublists of the lists. function is
first applied to the lists themselves,
and then to the cdr of each list, and
then to the cdr of the cdr of each
list,...
The tutorials I've found on WxPython all use examples from Linux, but there seem to be differences in some details.
For example, in Windows a Panel behind the widgets is mandatory to show the background properly. Additionally, some examples that look fine in the tutorials don't work in my computer.
So, do you know what important differ...
I have a similar question to this one but instead my tuple contains lists, as follows:
mytuple = (
["tomato", 3],
["say", 2],
["say", 5],
["I", 4],
["you", 1],
["tomato", 6],
)
What's the most efficient way of sorting this?
...
From my understanding, Python's twisted framework provides a higher-level abstraction for networking communications (?).
I am looking for a Ruby equivalent of twisted to use in a Rails application.
...
instead of using exec in our script to do an nslookup, is there an easy way to write it programmatically in PHP, Python, or Ruby?
...
I accidentally removed /Library/Python on OS X Leopard. How can I reinstall that?
...
Possible Duplicate:
Why won't you switch to Python 3.x?
I see there are already a lot of duplicate questions asking whether or not new Python programmers should learn 2 or 3. I am not asking that question.
I am already a Python 2 programmer. I started tinkering with it some years ago. I started using it almost exclusively for ...
In the model 'entered' is a datetime field. I want to query the data to find all entry's that where made between noon(start_time) and 5:00pm (end_time).
selected = Entry.objects.filter(entered__gte=start_time, entered__lte=end_time)
(as I expected)I get an error of:
"ValidationError: Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.u...
I have been poking around for a recipe / example to index a list of tuples without taking a modification of the decorate, sort, undecorate approach.
For example:
l=[(a,b,c),(x,c,b),(z,c,b),(z,c,d),(a,d,d),(x,d,c) . . .]
The approach I have been using is to build a dictionary using defaultdict of the second element
from collections...
Hi,
I am writing a data comparison code in python to compare the data transformed in the SSIS packages. So, I have all the modules written that accesses the each and every task in SSIS packages. It compares fairly well except for those data that have different datatype, same values but different decimal places.
I started out converting...
I'm building a simple helper script for work that will copy a couple of template files in our code base to the current directory. I don't, however, have the absolute path to the directory where the templates are stored. I do have a relative path from the script but when I call the script it treats that as a path relative to the current w...
I have a very complicated class for which I'm attempting to make Python wrappers in SWIG. When I create an instance of the item in Python, however, I'm unable to initialize certain data members without receiving the message:
>>> myVar = myModule.myDataType()
swig/python detected a memory leak of type 'MyDataType *', no destructor found....
Can someone explain to me this odd thing:
When in python shell I type the following Cyrillic string:
>>> print 'абвгд'
абвгд
but when I type:
>>> print u'абвгд'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-9: ordinal not in range(128)...
I'm new to Django, but the application that I have in mind might end up having URLs that look like this:
http://mysite/compare/id_1/id_2
Where "id_1" and "id_2" are identifiers of two distinct Model objects. In the handler for "compare" I'd like to asynchronously, and in parallel, query and retrieve objects id_1 and id_2.
Is there a...
Update: 2009-05-29
Thanks for all the suggestions and advice. I used your suggestions to make my production code execute 2.5 times faster on average than my best result a couple of days ago. In the end I was able to make the java code the fastest.
Lessons:
My example code below shows the insertion of primitive ints but the producti...
In Python, I'm constantly using the following sequence to get an integer value from a byte buffer (in python this is a str).
I'm getting the buffer from the struct.unpack() routine. When I unpack a 'char' using
byte_buffer, = struct.unpack('c', raw_buffer)
int_value = int( byte_buffer.encode('hex'), 16 )
Is there a better way?
...