Making dir's

2006-01-22 Thread yawgmoth7
Hello, I am writing a script that will organize all the code in the given directory. Well, currently I have it make dir's with something like: os.mkdir("C") os.mkdir("Python") os.mkdir("ASM") And so on. That is not very practical, and I wish to change it. I was wondering if there were any other m

Re: Making dir's

2006-01-22 Thread [EMAIL PROTECTED]
yawgmoth7 wrote: > And so on. That is not very practical, and I wish to change it. I was > wondering if there were any other methods to which I could do this, I > was thinking maybe I could put the dir names in a dictionary then have > something like: > os.mkdir(thedictname) Why not use a loop? d

Re: Making dir's

2006-01-22 Thread James Stroud
yawgmoth7 wrote: > Hello, I am writing a script that will organize all the code in the > given directory. Well, currently I have it make dir's with something > like: > > os.mkdir("C") > os.mkdir("Python") > os.mkdir("ASM") > > And so on. That is not very practical, and I wish to change it. I was

Re: Making dir's

2006-01-22 Thread James Stroud
yawgmoth7 wrote: > Hello, I am writing a script that will organize all the code in the > given directory. Well, currently I have it make dir's with something > like: > > os.mkdir("C") > os.mkdir("Python") > os.mkdir("ASM") > > And so on. That is not very practical, and I wish to change it. I was

Re: Making dir's

2006-01-22 Thread Christoph Zwerschke
yawgmoth7 wrote: > os.mkdir("C") > os.mkdir("Python") > os.mkdir("ASM") > > And so on. That is not very practical, and I wish to change it. I was > wondering if there were any other methods to which I could do this, I > was thinking maybe I could put the dir names in a dictionary then have > somet

Re: Making dir's

2006-01-22 Thread Klaus Alexander Seistrup
Or os.makedirs(): #v+ >>> import os >>> print os.makedirs.__doc__ makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. T

Re: Making dir's

2006-01-22 Thread I V
Klaus Alexander Seistrup wrote: > Or os.makedirs(): Although that may or may not do what the OP wants. I was assuming she was trying to produce a directory structure like: /dir/C/ /dir/ASM/ /dir/Python/ os.makedirs() produces a directory hierarchy, like: /dir/C/ASM/Python/ -- http://mail.pyth