Hello,
Since I can write the statement like:
>>> print os.path.isdir.__doc__
Test whether a path is a directory
Why do I still need the getattr() func as below?
>>> print getattr(os.path,"isdir").__doc__
Test whether a path is a directory
Thanks!
--
http://mail.python.org/mailman/listinfo/pyt
Thank you.I'm just learning Python and want to make something clear to me.:)
2007/1/20, Steven D'Aprano <[EMAIL PROTECTED]>:
> On Sat, 20 Jan 2007 17:30:24 +0800, Jm lists wrote:
>
> > Hello members,
> >
> > I want to know does the "eval" in pyt
Hello members,
I want to know does the "eval" in python have the same features as in
Perl (capture errors)?
For example,in perl I can wrote:
$re = eval { 1 / 0 };
Though 1/0 is a fatal error but since it's in "eval" block so the perl
interpreter doesn't get exit.
Thanks again.
--
http://mail.
Thanks for all the kind helps!
2007/1/20, Parthan SR <[EMAIL PROTECTED]>:
>
>
> On 1/20/07, Jm lists <[EMAIL PROTECTED]> wrote:
> > hello members,
> >
> > See my script piece below:
> >
> > def testB(shift,**argv):
> > print "first
hello members,
See my script piece below:
def testB(shift,**argv):
print "first argument is %s" %shift
print "all other arguments are:",argv
testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]')
It can't work at all.please help tell me the reasons.thanks.
--
http://mail.py
-e line 1, near "}else"
Execution of -e aborted due to compilation errors.
2007/1/19, Diez B. Roggisch <[EMAIL PROTECTED]>:
> Jm lists wrote:
>
> > Please help with this script:
> >
> > class ShortInputException(Exception):
> >
Please help with this script:
class ShortInputException(Exception):
'''A user-defined exception class.'''
def __init__(self,length,atleast):
Exception.__init__(self)
self.length=length
self.atleast=atleast
try:
s=raw_input('E