Possible Duplicate:
How do I check if a file exists using Python?
I am a beginner at Python. I have a bit of code that I want to handle in a way if that someone was to enter an invalid path that does not exist like Z:\
instead of C:\
I want it to raise some sort of error. I know how to go about doing it, I just don't know how to check if it will be invalid. How can I make my code check if that drive or path exists on this PC before it creates the path, is there a way to do that in python?
file_path = input("\nEnter the absolute path for your file: ")