SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top