Issue
While creating a nested directory in Python 3.6 received following error:
AttributeError: 'module' object has no attribute 'mkdirs'
Sample code:
def create_sample_data():
os.mkdirs("/tmp/lambdadir/ProjectTemp/mynewtest")
f=open("/tmp/lambdadir/ProjectTemp/mynewtest/my_copy.txt","w+")
f.write("This is inside a directory")
f.close()
Please help.
Solution
There is no os.mkdirs
. Perhaps you meant os.mkdir
or os.makedirs
instead?
Answered By - jwodder
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.