First  |  Prev |  Next  |  Last
Pages: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
pre-uninstall script in bdist_wininst
Hi. I am using a postinstall-script like this: setup( ... scripts=['scripts\install.py'], options = { ... "bdist_wininst" : { "install_script" : "install.py", ... }, } ) According to the docs in [1] this script is a) called after install (w... 8 Aug 2010 16:42
ctypes: pointer to method
Hi, is it possible to pass pointer to a method using ctypes. Sample code: ... G_set_error_routine(byref(self._print_error)) ... def _print_error(self, msg, type): """!Redirect stderr""" self.log.write(msg) gives me G_set_error_routine(byref(self._print_error)) Typ... 8 Aug 2010 04:47
easy question on parsing python: "is not None"
How does "x is not None" make any sense? "not x is None" does make sense. I can only surmise that in this context (preceding is) "not" is not a unary right-associative operator, therefore: x is not None === IS_NOTEQ(X, None) Beside "not in" which seems to work similarly, is there other syntactical sugar lik... 13 Aug 2010 02:45
assigning variables from list data
I have a database query result (see code below). In PHP, I would have said list(var1,var2,var) = $result and each element in the list would be assigned to each of the named variables. I have my data coming out of the database, and I can see it is a list. so my question is, instead of having to do the variabl... 5 Aug 2010 11:19
abstract metaclass
Hi all, I'm trying to create a metaclass that keeps track of its objects, and implement this as a collections.MutableMapping. That is, something like this: class type2(type, MutableMapping): ... /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/abc.pyc in __new__(mcls, ... 6 Aug 2010 07:09
PyInt_FromLong gives segfault on small numbers (<257)
Hi, I'm trying to call python (python 2.6) functions from C++ using MS VC+ + 6.0 and any calls to PyInt_FromLong with numbers below 257 give me exceptions, no problems with bigger numbers PyObject *pValue; pValue = PyInt_FromLong(1L); (or pValue = PyInt_FromLong(1); Any ideas of what can I be doing wron... 5 Aug 2010 09:06
subprocess escaping POpen?!
Hi All, I have a script that does the following: from subprocess import Popen,PIPE,STDOUT def execute(command,cwd): return Popen( command, stderr=STDOUT, stdout=PIPE, universal_newlines=True, cwd=cwd, shell=True, ).communicate()[0] ... 6 Aug 2010 03:53
new to python - trouble calling a function from another function
Hello, I'm building an elevator simulator for a class assignment. I recently ran into a roadblock and don't know how to fix it. For some reason, in my checkQueue function below, the call to self.goUp() is never executed. It is on the last line of code I pasted in. I can put print statements before and after ... 7 Aug 2010 02:54
██▓▒░░ *** CREDIT CARD *** ░▒░▒▓██
██▓▒░░ *** CREDIT CARD *** ░▒░▒▓██ https://sites.google.com/site/worldclasscreditcard... 5 Aug 2010 02:40
A useful, but painful, one-liner to edit money amounts
There's got to be a better way to do this: def editmoney(n) : return((",".join(reduce(lambda lst, item : (lst + [item]) if item else lst, re.split(r'(\d\d\d)',str(n)[::-1]),[])))[::-1]) editmoney(0) '0' editmoney(13535) '13,535' editmoney(-14535) '-14,535' e... 7 Aug 2010 07:10
First  |  Prev |  Next  |  Last
Pages: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25