Thursday, July 17, 2014

How to determine if a folder exists

Code
import os                                              #1
os.path.exists(folder_path_string)                     #2

How this works - Line by Line

import os                                           #1

Imports the os module

os.path.exists(folder_path_string)                  #2
 
This line checks for a folder in the folder_path_string and returns either True or False

No comments:

Post a Comment