Re: functon invoke or not

2013-01-09 Thread skyworld
On 1月9日, 下午4时46分, Mitya Sirenef wrote: > On Wed 09 Jan 2013 03:23:56 AM EST, skyworld wrote: > > > Hi, > > > I see someone's code as this: > > > class ABC: > >      def __init__(self, env): > >           ... > >           sel

functon invoke or not

2013-01-09 Thread skyworld
Hi, I see someone's code as this: class ABC: def __init__(self, env): ... self.jmpTable['batchQ']['submit_job'] = self.lsf_submit ... def lsf_submit(self, cmd,env): . what confused me is why there is no parentheses for self.lsf_submit

question on subprogram parameter

2012-10-28 Thread skyworld
Hi, I'm studying python now and I saw a piece of code like this: def storeDbase(db, dbfilename=dbfilename): . dbfile=open(dbfilename,'w') for key in db: print(key, file=dbfile) can anybody help me to understand what does this "file=dbfile" mean and what is its funct

Re: how to change os.popen4 to subprocess

2012-10-26 Thread skyworld
On Oct 27, 11:02 am, MRAB wrote: > On 2012-10-27 03:28, skyworld wrote:> Hi, > > > I'm new to python and I'm trying to porting some scripts from v0.96 to > > v2.0.1. A piece of code is like this: > > > cmd_h = os.popen4(env['SYSCMDLINE'])[1] >

how to change os.popen4 to subprocess

2012-10-26 Thread skyworld
Hi, I'm new to python and I'm trying to porting some scripts from v0.96 to v2.0.1. A piece of code is like this: cmd_h = os.popen4(env['SYSCMDLINE'])[1] the system indicates the popen4 is deprecated and suggest to use subprocess. Can anybody tell me how to use subprocess in this case? and what d