[Tutor] DOS Commands?

James.Rocks@equant.com James.Rocks@equant.com
Fri Nov 8 08:07:01 2002


Hi,

I am trying to get the following to work from with Python:

      from time import *
      from os import popen

      sUnique = "%s%s%s%s%s%s%s%s%s" % localtime()

      sSMSFile = "c:\\temp\\%s.CTXScanner.%s" % (sUnique, '447771767405')

      fSMSFile = open (sSMSFile, "w")
      fSMSFile.write('Frm: CTX Scan\nSrv: %s\nSts: %s' % ('LONASMEG01', 'DN
15 Min'))
      fSMSFile.close()

      popen('ncftpput -u ****** -p ****** ******.lon.globalone.net sms %s'
% sSMSFile, 'w')

I get (on one line):

      <open file 'ncftpput -u ****** -p ****** ******.lon.globalone.net sms
      c:\temp\200211812591643120.CTXScanner.447771767405', mode 'w' at
0112E378>

Obviously I have tested it and it works fine from a command prompt (simply
cutting the relevant part from the program and pasting it into a commnd
window works) ... any ideas?

James

James C. Rocks
Equant
Archway House
Canary Wharf
London E14 9SZ