strange problems with code generation

Eric_Dexter at msn.com Eric_Dexter at msn.com
Fri Dec 1 23:00:38 EST 2006


I never see anything from print(data).  The example I tried to adapt
using readlines may be a little old or something.  I did close all the
files to prevent problems when I figure out what is wrong with what I
have.



John Machin wrote:
> You say "I am sure the readlines code is crashing it." I can't imagine
> how you can be sure of anything, but yes, it is a possibility that
> sys.stdin.readlines() might behave strangely when called from a GUI
> kit. Why from sys.stdin anyway?
>
> You have two *known* definite problems (not closing your output files,
> and no such attribute as "writeline") -- *fix* them, and try again.
>
> Do try to test that function in isolation.
> Put print statements in as I suggested. Comment out the .bat file
> invocation.
> Try calling the function from the interactive interpteter. Check if the
> files are being created, with the right size. If it works, add back the
> .bat file invocation. If that works, try it from your GUI.
>
> IOW, try to attack your problem methodically.
>
> AND try to answer at least some of the questions that helpers might ask
> you, like what does "print(data)" produce -- they're not asked out of
> idle curiosity.
> 
> HTH,
> John




More information about the Python-list mailing list