Doug Potter wrote:

> for i in routers:
>     os.system('/bin/touch' %s) % i
> 
> of course this dosn't work.
> 
> Is there a simple way to get this done?

Yep, someone already answered that you can create the file in write mode 
and then close it, but I wanted to add a little more in why your 
solution doesn't work.

You're not interpolating the filename INTO the os.system string


The following would work

  for i in routers:
      os.system('/bin/touch %s'%1)

Granted, you should also provide a filename with a full path for simplicity.

HTH

Hugo

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to