thorpedosg

BBUfHT4Z

Aug 6th, 2018
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Folder operations
  2. ======
  3.  
  4. Check for existence and create
  5. ---------
  6.  
  7. ```python
  8. if not os.path.exists( export_directory ) :
  9. os.makedirs(export_directory)
  10. os.mkdir(export_directory)
  11.  
  12. ```
  13.  
  14. Get the base directory
  15. ----------
  16.  
  17. ```python
  18. parent_folder_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
  19. ````
Add Comment
Please, Sign In to add comment