a question

Sells, Fred fred at adventistcare.org
Wed Jan 19 15:52:53 EST 2005


I would use something like
cmd = '%s/mos user wmarch, ' % mosbin
cmd += 'cd /fa/wm/%s/%s, ' % (jaar, filetype)
cmd += ...
which reveals that you don't have enough args to satisfy all the %s's

-----Original Message-----
From: Nader Emami [mailto:emami at knmi.nl]
--snip--
I have a long command in Unix and I have to use os.system(cmd) 
statement. I do the following:

cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s, chmod 644 
%s' % (mosbin, jaar, filetype, filetype)
     status = os.system(cmd)


This is not very clear, and I have to break this long line in two 
segment by means of the next character '\' :
cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s, \
        chmod 644 %s' % (mosbin, jaar, filetype, filetype)

But in this case I get a syntax error! I don't know how I can solve this 
problem. Could somebody tell me about this?

With regards,
Nader


  (this
-- 
http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list