Re: bug or feature?

2005-10-05 Thread Tomasz Lisowski
n error, or a feature? I would say - a feature. Everyone should be aware, that the argument default values are evaluated once, and the same value (memory object) is reused at each instance creation. Best regards, Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: non descriptive error

2005-10-07 Thread Tomasz Lisowski
"error". anyidea where i need to start looking? It seems to me, like a result of a "print" statement, exexcuted somewhere (maybe in the except: clause). You may look for lines similar to: print "error" Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: catching all exceptions

2005-08-13 Thread Tomasz Lisowski
> Hello, > > I'd like to catch all exeptions and be able to inspect them. > > The simple case: I know which exceptions I'll get: > > # standard textbook example: > try: > something() > except ThisException, e: > print "some error occurred: ", str(e) > > > The not-so-simple case: Handli

Re: Help w/ easy python problem

2005-09-22 Thread Tomasz Lisowski
.g. <0, 71>, representing the 72 characters wide lines being printed. Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: A simple list question.

2005-12-22 Thread Tomasz Lisowski
e sure, though, what you mean by accessing the elements in random order. What's the idea behind having mylist[1] = [c,f,g], when the elements c, f, and g are apread across all three internal lists, and at various position within these lists (not necessarily 1, as the mylist index suggests). Toma

Re: newbie: concatenate literals (using jython)

2005-12-22 Thread Tomasz Lisowski
a string, use > str(obj). see this tutorial section for more info: > > http://docs.python.org/tut/node9.html#SECTION00910 > > > > > You are right, Fredrik, but David is using Jython, so perhaps he tried to mimic the Java language behaviour, where adding in

Re: problem adding list values

2005-12-22 Thread Tomasz Lisowski
Dave Hansen wrote: > I think what you want is > >for cr in credlist: > credits += cr > > Which could also be implemented as > >credits = reduce(lambda x,y: x+y, credlist) or even: credits = sum(credlist) Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: Why it doesn't work?

2006-01-09 Thread Tomasz Lisowski
L['a'] first, before referencing L['a']['b'] So, you need to call first: L['a'] = {} Then you can write: L['a']['b'] = 2 Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: py vs pyc

2006-01-09 Thread Tomasz Lisowski
Sakcee wrote: > Hi > > I want to know that is .pyc files execute faster than .py files,? since > both are interpreted by python , is there any speedup in using one or > other.? > > e.g. > > what is the difference between runing from cmd "python test.py" and > "python test.pyc" > > > thanks >

Strange behaviour of floating point constants in imported modules

2005-05-23 Thread Tomasz Lisowski
a good method to avoid this kind of problems? How to make such distributed modules really portable? Thanks in advance -- Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange behaviour of floating point constants in imported modules

2005-05-25 Thread Tomasz Lisowski
ns? No, it is not a problem with possibly using the comma instead of a dot in the SOURCE - there only a dot can be used. That's clear. > > It's more likely that the .pyc file has been damaged somehow. AFAIK > they don't have checksums. Very unlikely. I have made these t

Re: Strange behaviour of floating point constants in imported modules

2005-05-25 Thread Tomasz Lisowski
tr(), repr() functions should be locale-independent. We have the functions in the locale module, if someone needs the locale-dependent string-float conversions. -- Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is Word?

2005-06-14 Thread Tomasz Lisowski
> Unfortunately, I need to open/edit a (temporary) text file with Word, and > those are opened by default with UltraEdit (or Notepad or..). Thanks for the > tip, though. > > Anything else? Do I need to read the registry? > > g You may try to launch Word as a COM object and control it directly

Re: Where is Word?

2005-06-14 Thread Tomasz Lisowski
d properties. You may also use the object browser. Tomasz Lisowski > > "Tomasz Lisowski" <[EMAIL PROTECTED]> schreef in bericht > news:[EMAIL PROTECTED] > >>You may try to launch Word as a COM object and control it directly from >>Python using the COM