Guest User

Untitled

a guest
Jan 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. @staticmethod # Creates a folder if not present
  2. def create_folder(folder_name):
  3. directory = os.path.dirname(folder_name)
  4. try:
  5. os.path.exists(directory)
  6. print("Folder failed")
  7. except:
  8. os.makedirs(directory, 0o777)
  9. print("Folder created")
  10.  
  11. Traceback (most recent call last):
  12. File "/var/lib/cloud9/TEMS_Operations/System_Files.py", line 125, in <module>
  13. temp.create_folder(temp.main_folder)
  14. File "/var/lib/cloud9/TEMS_Operations/System_Files.py", line 41, in create_folder
  15. directory = os.path.dirname(folder_name)
  16. File "/usr/lib/python2.7/posixpath.py", line 122, in dirname
  17. i = p.rfind('/') + 1
  18. AttributeError: 'function' object has no attribute 'rfind'
Add Comment
Please, Sign In to add comment