I am fairly new in python and I am writing a python script that can read json files from a directory and work on it. For that purpose, I am asking the user about the file name.
file_dir = input("Please enter the directory COMPLETE path where all dialog json files are placed: ")
files = listdir(str(file_dir))
However, I get the error when I enter the path.
Please enter the directory COMPLETE path where all dialog json files are placed: /Users/monideepde/Documents/Sanofi/EnglishDialogs
Traceback (most recent call last):
File "/Users/monideepde/PycharmProjects/KoreDialogLanguageConverter/Converter.py", line 4, in <module>
file_dir = input("Please enter the directory COMPLETE path where all dialog json files are placed: ")
File "<string>", line 1
/Users/monideepde/Documents/Sanofi/EnglishDialogs
^
SyntaxError: invalid syntax
Process finished with exit code 1
Strangely, this error is not seen when I wrap my path in double-quotes. If anyone understands why I am getting this error can you please share it with me?
P.S: I am using python 2.7
Thanks