Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @staticmethod # Creates a folder if not present
- def create_folder(folder_name):
- directory = os.path.dirname(folder_name)
- try:
- os.path.exists(directory)
- print("Folder failed")
- except:
- os.makedirs(directory, 0o777)
- print("Folder created")
- Traceback (most recent call last):
- File "/var/lib/cloud9/TEMS_Operations/System_Files.py", line 125, in <module>
- temp.create_folder(temp.main_folder)
- File "/var/lib/cloud9/TEMS_Operations/System_Files.py", line 41, in create_folder
- directory = os.path.dirname(folder_name)
- File "/usr/lib/python2.7/posixpath.py", line 122, in dirname
- i = p.rfind('/') + 1
- AttributeError: 'function' object has no attribute 'rfind'
Add Comment
Please, Sign In to add comment