Jump to content

How Do I Convert _io.TextIOWrapper To String?


Recommended Posts

i am making a text editor with python and i need to know how convert _io.TextIOWrapper to string.

i am using  filedialog from tkinter, and when i use askopenfile(initialdir = "/", title = 'Open', filetypes = (("Plain Text Files", "*.txt"),("All Files", "*.*"))), it gives me _io.TextIOWrapper. i need to derive the file path from this and convert to string as a variable, so i can just stick the variable in my open() function. 

does anyone have any experiance with this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...