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
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
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
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
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
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
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