Re: Python Fails to Write to File

2014-06-19 Thread Mark Lawrence
On 19/06/2014 08:54, cutey Love wrote: Thank you very much, that fixed it. What do you not understand about top posting and using google groups? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free f

Re: Python Fails to Write to File

2014-06-19 Thread cutey Love
Thank you very much, that fixed it. On Thursday, June 19, 2014 12:03:43 AM UTC+1, cutey Love wrote: > I'm trying to write data to a text file > > > > But I'm getting the error: > > > > TypeError: invalid file: <_io.TextIOWrapper > > > > Code is > > > > def saveFile(): > > file_p

Re: Python Fails to Write to File

2014-06-18 Thread Paul McNett
On 6/18/14, 4:03 PM, cutey Love wrote: I'm trying to write data to a text file But I'm getting the error: TypeError: invalid file: <_io.TextIOWrapper Always better to err on posting too much context (the entire traceback) than too little. Code is def saveFile(): file_path = filedia

Re: Python Fails to Write to File

2014-06-18 Thread Ian Kelly
On Wed, Jun 18, 2014 at 5:03 PM, cutey Love wrote: > I'm trying to write data to a text file > > But I'm getting the error: > > TypeError: invalid file: <_io.TextIOWrapper Post the full traceback. By posting only the error message you're removing useful information. -- https://mail.python.org/m

Python Fails to Write to File

2014-06-18 Thread cutey Love
I'm trying to write data to a text file But I'm getting the error: TypeError: invalid file: <_io.TextIOWrapper Code is def saveFile(): file_path = filedialog.asksaveasfile(mode='w', filetypes=[('text files', '.txt')], defaultextension=".txt") fo = open(file_path, 'w') for e