Re: Printing a hex character and prefixing it correctly

2009-05-15 Thread BgEddy
%02X % k Kind Regards, BgEddy -- http://mail.python.org/mailman/listinfo/python-list

Re: storing references instead of copies in a dictionary

2008-07-17 Thread bgeddy
mk wrote: Calvin Spealman wrote: To your actual problem... Why do you wanna do this anyway? If you want to change the function in the dictionary, why don't you simply define the functions you'll want to use, and change the one you have bound to the key in the dictionary when you want to change

Re: storing references instead of copies in a dictionary

2008-07-17 Thread bgeddy
castironpi wrote: On Jul 17, 10:05 am, mk [EMAIL PROTECTED] wrote: def f2(arg): return f2 +arg def f1(arg): return f1 +arg a={1:f1,2:f2} print [eval(x[1])(x[0]) for x in a.items()] def f2(arg): return New f2 +arg print [eval(x[1])(x[0]) for x in a.items()] Neat trick, if probably

Re: storing references instead of copies in a dictionary

2008-07-17 Thread bgeddy
bgeddy wrote: castironpi wrote: On Jul 17, 10:05 am, mk [EMAIL PROTECTED] wrote: def f2(arg): return f2 +arg def f1(arg): return f1 +arg a={1:f1,2:f2} print [eval(x[1])(x[0]) for x in a.items()] def f2(arg): return New f2 +arg print [eval(x[1])(x[0]) for x in a.items()] Neat trick

Re: Retrieving int from hex in a file.

2008-04-28 Thread bgeddy
Filipe Teixeira wrote: Hi. I have to open a binary file from an old computer and recover the information stored (or at least try to). I use: f=open('file.bin','rb') a=f.read() f.close() a in now a string full of hex representations in the form: a[6]='\x14' a[7]='\x20' I would like to

Re: how do I know if I'm using a debug build of python

2008-04-17 Thread bgeddy
Tim Mitchell wrote: Hi, A quick question: Is there any way for a python script to know if it's being executed by a debug build of python (python_d.exe) instead of python? Thanks Tim Not sure what this returns in Windows as I run Linux but this returns to namer of the python