Output to file gets lost - don't know where to look ...

U

uair01

I'm running python in IDLE on suse11.

I have a python program and after writing 100kB to 200kB to a file,
the write statements seem to stop working.
Basically the print statements look like this:

some loops:
logFile.write(string1)
logFile.write(string2)
end of loops

print(stringA)
logFile.write(string3)
logFile.write(string4)
print(stringB)

String1 and sometimes string2 / string3 (or a part of it) will end up
in the file, but string4 not.
stringsA and stringB get printed to the concole as expected.

Stepping through the program with a debugger shows that *all* write-
statements get executed.

I use several logFile.flush() statements and a logFile.close() at the
end.

Is there some kind of file-size-limit or some kind of memory or buffer
problem? Or could it be a bug in IDLE? I don't know where to look
further.

OH ... maybe just writing this message has helped. Now I see the
following error messages inside the window from where I started IDLE.
Could that be the cause?

Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/usr/lib/python2.5/idlelib/MultiCall.py", line 151, in handler
r = l(event)
File "/usr/lib/python2.5/idlelib/CallTips.py", line 62, in
refresh_calltip_event
self.open_calltip(False)
File "/usr/lib/python2.5/idlelib/CallTips.py", line 65, in
open_calltip
self._remove_calltip_window()
File "/usr/lib/python2.5/idlelib/CallTips.py", line 41, in
_remove_calltip_window
self.calltip.hidetip()
File "/usr/lib/python2.5/idlelib/CallTipWindow.py", line 126, in
hidetip
self.label.destroy()
AttributeError: 'NoneType' object has no attribute 'destroy'

I will try the python program outside of IDLE.
 
U

uair01

I will try the python program outside of IDLE.

Yes, running the program from the Linux shell instead of from IDLE
produces all output correctly.
Now I'll have to look for a new simple development environment :-(
I think I'll try SPE that has worked well for me ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top