[Tutor] question about looping.

Doug Potter dpotter at nc.rr.com
Fri Oct 6 11:29:02 CEST 2006


I at trying to create a bunch of text files in a single directory on a 
Linux system,
something like this.

import os

routers = ['adnc-6321', 'adnp-2341', 'adnw-2632']

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?

Thanks for your time.

More information about the Tutor mailing list