User will be inputing file path

I require the user to input path of file, from which i will be reading marker coordinate. So as raw_input function is unsupported in python, is there any other function or way to achieve this.

user_input = raw_input("Enter the path of your file: ")
filepath = str(user_input)

The above code incurs errors at python interactor, so let me know ,the way around it.
Thanks in advance!!!


You can use the replacement input function which exists in Python 3

filepath = input("Enter the path of your file: ")

The input built-in function returns a string type so you don’t need additional casting.


oh yes. thank you @Andinet_Enquobahrie . Have a great day ahead!!