I dont want to use commands or any similar module that uses unix shell.
Thanks in advance..
I dont want to use commands or any similar module that uses unix shell.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to do this recursively, going down a tree visiting all the directories, then you can use os.walk like this:
If you only want the subdirectories you can either call walk once:
Or do some sort of filter like this (walk is more stylish/portable):