I'm creating some python code, where its initial stage lets the user input the directory of a source folder, destination folder and a text file. These directories should be checked right after the user input. Here is an example how it should look like:
Enter directory path of a source folder:
>>>C:\bla\source_folder
Thanks, this folder exists.
Enter directory path of a destination folder:
>>>C:\dest_folder
(let's say this folder does not exist)
This folder does not exist! Please enter correct path.
>>>C:\bla\dest_folder
Enter directory path of a text file:
>>>C:\bla\bla.txt
Thanks, this file exists.
My code is incomplete, and probably wrong, because I really don't know how to do it.
def source_folder()
source_folder = raw_input("Enter path of source folder: ")
try:
if open(source_folder)
print("Folder path is correct!")
except:
#if there are any errors, print 'fail' for these errors
print(source_folder, 'This folder has not been found')
def dest_folder()
dest_folder = raw_input("Enter path of destination folder: ")
def input_file()
input_file = raw_input("Enter path of your text file: ")