hello all,
I have a program, and in it, it eventually specifies 'aFolder' to be os.walk(path/to/folder) how do I obtain inifo such as the name or the path of the folder, is it then the temporary current working directory?

Recommended Answers

All 2 Replies

Show what you trying to do, we need more information about what error you are getting with what data and by what code you trying to accomplish and what you want to accomplish.

how do I obtain inifo such as the name or the path of the folder,

Maybe i dont understand you,if you give the path to the folder.
Then you can store it in a variable and just print it out.

import os

aFolder = 'C:/test/'
print 'Top folder is %s' % aFolder
for root, dirs, files in os.walk(aFolder):
    for sub in dirs:
        print sub #Will print all subfolder in C:\test\

You have os.getcwd()
Return a string representing of the current working directory.

If unclear as @tony postet give more info.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.