strange problems with code generation

John Machin sjmachin at lexicon.net
Fri Dec 1 22:35:26 EST 2006


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