Getting the Directory/Path details
__peter__ at web.de
Thu Sep 25 19:19:55 CEST 2003
Kali K E wrote:
> I could not understand how I can do the following things in Python.
> Please help me.
> 1. First I have to find the current directory from where the script is
> 2. Next I have to form a directory structure there. If the current
> directory in step 1 is /home/mylogin, then from there I have to build
> a directory structure like
> There are three things as I look at it. First determing the current
> directory path. Second adding a string to it like /result etc. Third
> creating the new directory.
> Thank you for the help.
3 os.mkdir() or os.makedirs()
subfolders = [
folder = os.getcwd()
for sf in subfolders:
More information about the Python-list