Thanks All for your help. It is much appreciated and shows how helpful the 
BB Forum users are and how valuable the Forum is.
John

On Wednesday, April 6, 2016 at 5:54:47 AM UTC-7, Dennis Lee Bieber wrote:
>
> On Tue, 5 Apr 2016 19:11:32 -0700, John Baker 
> <[email protected] <javascript:>> declaimed the 
> following: 
>
>
> >Here's some of my code. Hopefully you'll see something newbie-wrong that 
> >I've done. It's been a while since I have done file I/O, so it's likely 
> >that I have some syntax error(s). 
> > 
> > 
>
>         To reiterate, the first thing is that ALL of your open() calls are 
> erroneous. The second argument to open() is a string, you seem to be 
> providing some object -- unless the objects r and w were earlier bound to 
> strings of "r" and "w", the open calls should be failing. 
>
>         Since you are using bare except clauses, you could be trapping on 
> /any/ 
> error and never identifying what the error is. 
>
>         You state you are not seeing any messages... What are the values 
> of 
> "PaintFlow" and "control_output" at the start of that image (really? a 
> screen grab rather than text cut&paste?)? Could it be that you aren't even 
> entering that block because the if statement is coming up false? 
>
>         As often advised on comp.lang.python -- reduce your case to the 
> minimal 
> that illustrates the problem. You think you are having problems creating a 
> file, so create a short test program that does nothing else. 
>
> -=-=-=-=-=- 
>
> debian@beaglebone:~$ ls Desktop/ 
> debian@beaglebone:~$ ls 
> Desktop  build  example.py  io.py  t.py 
> debian@beaglebone:~$ cat io.py 
> f = open("/home/debian/Desktop/junk.txt", "w") 
> f.write("This is\njust\nsome junk\n") 
> f.close() 
> f = open("/home/debian/Desktop/junk.txt", "r") 
> for i,ln in enumerate(f): 
>         print "line #%s = '%s'" % (i,ln) 
> f.close() 
> debian@beaglebone:~$ python io.py 
> line #0 = 'This is 
> ' 
> line #1 = 'just 
> ' 
> line #2 = 'some junk 
> ' 
> debian@beaglebone:~$ ls Desktop/ 
> junk.txt 
> debian@beaglebone:~$ cat Desktop/junk.txt 
> This is 
> just 
> some junk 
> debian@beaglebone:~$ 
>
> -=-=-=-=- 
> Note that reading lines does not strip the trailing new-line marker, hence 
> the ' showing up on a line by itself. 
> -- 
>         Wulfraed                 Dennis Lee Bieber         AF6VN 
>     [email protected] <javascript:>    HTTP://wlfraed.home.netcom.com/ 
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to