<DIV>
<DIV>Hello,</DIV>
<DIV>i'm new to this list and to python too.</DIV>
<DIV>I'm using active state python 2.3 on win32,</DIV>
<DIV>my problem is the following: </DIV>
<DIV>I want learn how to execute system command passing parameters.</DIV>
<DIV>for example to copy a file I've tried to write this script:</DIV>
<DIV>&nbsp;</DIV>
<DIV>*****************************</DIV>
<DIV>import os<BR>os.chdir(''myDirectory")<BR>cmd="copy"<BR>parameters="file1 file1_backup"<BR>myCmd&nbsp;= os.popen(cmd,'w')<BR>myCmd.write(parameters)<BR>exitCode = myCmd.close()<BR>if exitCode:<BR>&nbsp;&nbsp;&nbsp; print '%s failed, this probably says why:\n%s' % (cmd, myCmd)</DIV>
<DIV>******************************</DIV>
<DIV>&nbsp;</DIV>
<DIV>the problem is that it doesn't work (the file file1_backup is not created)</DIV>
<DIV>and it writes the following line:</DIV>
<DIV>copy failed, this probably says why:<BR>&lt;closed file 'copy', mode 'w' at 0x01177660&gt;</DIV>
<DIV>have tou any idea?</DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks,</DIV>
<DIV>cop</DIV></DIV><p>
        

        
                <hr size=1><font face="Arial" size="2"><a href="http://it.rd.yahoo.com/mail/taglines/*http://it.seriea.fantasysports.yahoo.com">Scopri <b>Mister Yahoo!</a></b> -  il fantatorneo sul calcio di Yahoo! Sport'</font>