![]() |
| ||
| File Handling Ok so I was working on file handling, nothing special just making new (.txt) files and putting some text in it. That works fine the problem is that when I try to read the file from within python nothing comes up and when I try to open the file once I close it from python it has all this weird letters along with what i wrote in that file. I know this doesn't make sense at all so here is an example of what is going on.
Ok so thats what I wrote into the IDlE, the first problem is that when I ask python to print what I wrote into that file, I dont get anything back just a blank line. Then when I go and check the new file this is what I get : Quote:
|
| ||
| Re: File Handling Line four didn't get you anything? You should've gotten an IO error; you're not supposed to read from files you open for writing. If even you had opened the file as w+, you still should've gotten that blank line, because of the position you are in the file (past what you have written). Files are sequential. As to that junk text, I have no idea what's going on there. |
| ||
| Re: File Handling Well that was very simple i feel so dumb |
| ||
| Re: File Handling Is everything okay now? |
| ||
| Re: File Handling yea thank for the help |
| All times are GMT -4. The time now is 2:05 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC