Re: Python batching on XP

2005-09-28 Thread [EMAIL PROTECTED]
Hi ! I have Py 2.3.5, and subprocess is placed in version 2.4. The os.popen is not good, because it is not get return value. I can read the return value, but the message is os dependent (XP, 2k, NT). I create this function. It is not too good, but it is working: def Cmd(cmd,tmpdir="./"): ou

Re: Python batching on XP

2005-09-27 Thread Larry Bates
You should take a look at the subprocess module http://www.python.org/dev/doc/devel/lib/module-subprocess.html -Larry Bates [EMAIL PROTECTED] wrote: > Hi ! > > I want to write a program that backup some databases in the night. > > Pseudo like this: > > try: > if cmd('net stop dbservice'): >

Python batching on XP

2005-09-27 Thread [EMAIL PROTECTED]
Hi ! I want to write a program that backup some databases in the night. Pseudo like this: try: if cmd('net stop dbservice'): s=c://backup'+str(time.time())+'.zip' if cmd('zipit c:\\database '+s): if cmd('map drive backupdrive\\c$ y -user BACKUP -pwd SECRET'): if cmd('cop