On Mon, Sep 29, 2014 at 12:58:09PM +0100, Alan Gauld wrote: [...] > How do you know that val is not a blank line? > Remember that a blank line is not necessarily empty, it might be full of > unprintable characters. > > Try this instead: > > while True: > print "try" > val = ser.read(10) > print 'len: ', len(val) > for char in val: > print ord(char)
Another way to see invisible control characters is: print repr(val) -- Steven _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor