August 12th, 2005, 04:02 PM
At first, my program had been working fine, about 2 hours later when I tried to run it, even after no code had been changed, I started receiving an error. Or problem I should say. No error shows up, the program wil not open and the Python Interpreter crashed when it tries to run it. No matter what I do with the code that seems to be the problem, it never fixed the main problem. First, I have a function:
This function is outside of my main class (which is used for wxPython). I use this to call functions that are inside of the class as separate threads. next, I have the following code:
""" Runs multiple processes as separate threads """
for p in process: Timer(0, process).start()
This create a needed text control for my application. before this set of code, I have another line:
self.tos_text = wxTextCtrl(self, -1, '', wxPoint(595, 0), wxSize(430, 500), wxTE_MULTILINE | wxTE_READONLY)
self.tos_text.SetFont(wxFont(8, wxSWISS, wxNORMAL, wxNORMAL, False, 'Lucida Console'))
This line calls two different functions, the second function, DownloadTOS() at one point uses the RunProcess() function to call yet another function, the function it calls uses self.tos_text.
At this time, self.tos_text is used to append text onto it. For some reason this does not happen and Python tells me that the variable does not even exist. After a few times of re-trying the code, the Interpreter no longer operates. here is the final function I am referring to:
It has *never* been changed and it has worked before.
data = bnet_ftp.recv(1024)
if(TOS_USA in data): pass
else: self.AddText(self.tos_text, data, showtime=False)
Now, If I remove all of this code, except for the code that declared self.tos_text. And I append text to self.tos_text, it works perfectly fine. But when using all these functions, it doesn't. I'm beginning to wonder if the Timer() function is having something to do with it. However it worked fine before.
I will continue to look for a solution, if I find one, I'll edit my post .
Sorry this post had to be so long for any of you who decide to read it, but by doing this I won't (or shouldn't) have to answer to many questions.
Note: If anyone needs the source to the whole program, I'll be glad to send it to you.
August 12th, 2005, 04:19 PM
Well I am not sure about this but sometimes threads and loops don't fit for example by me I had an endless loop and then it always crashed because it went on and on???
BUt try to look over your threads and loop make holes so that the loop can be shut down in case...
Those people who think they know everything are a great annoyance to those of us who do.
August 12th, 2005, 04:24 PM
Well, looping or threads are no longer the problem. I barely changed my code, and now it tells me that self.tos_text does not exist. For anyone who wants to look at the code, here is the file.