Re: How to use shell return value like $? In python?

2011-10-23 Thread aaabbb16
On Oct 23, 7:44 pm, aaabb...@hotmail.com wrote: > exp: > os.system('ls -al') > #I like to catch return value after this command. 0 or 1,2,3 > does python support to get "$?"? > then I can use something like: >  If $?==0: >       > > TIA > david So for what I do is: r_n

How to use shell return value like $? In python?

2011-10-23 Thread aaabbb16
exp: os.system('ls -al') #I like to catch return value after this command. 0 or 1,2,3 does python support to get "$?"? then I can use something like: If $?==0: TIA david -- http://mail.python.org/mailman/listinfo/python-list

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread aaabbb16
On 10月15日, 上午12时04分, Chris Rebert wrote: > On Fri, Oct 14, 2011 at 11:20 PM,   wrote: > > Test.py > > #!/usr/bin/python > > from my_lib import test > > class my_class(my_function.name): > > Why are you subclassing my_function.name and not just my_function? try to inherit or change "name" attribute

I am a newbie for python and try to understand class Inheritance.

2011-10-14 Thread aaabbb16
Test.py #!/usr/bin/python from my_lib import my_function class my_class(my_function.name): def __initial__(self, name); pass def test(): print "this is a test" If __name__ == '__maim__': my_class.main() --- my_lib.py class