Kent, Thanks. this is great. Yes, when i start the thread, i also pass the gtk object to it. kinda like this.
serial_1 = Serial1(self.serial_1_buffer, self.serial_1_view) serial_1.start() so i am wanting to change that, but i do not exactly know how to stop a thread once i have it running, so that i could start another one. anyway, thanks for the link and the info, i am going to get started on testing this right away. This long a .py script is becomming a headache and i think it will be easier by far if it is pulled apart somewhat. thanks again shawn On 12/30/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
shawn bright wrote: > Hello there all. > i have an app that has grown to about 4000 lines. It uses 6 threads and > a GTK2 GUI. > i was wondering if i could split it into seperate files that i could > import. Each thread is a class. That should be fine. > i did not think that this would be a problem, but some of the threads > pass information to views and buffers. How do the threads find out about the views and buffers? If they are global objects then you will have a problem. If they are passed to the threads as parameters then it should be fine. > If i had a thread outside of the main file, could i pass a gtk object to > it so that it could write to it when it needed too? Yes. > and one last thing. If i did this, would i be able to only import the > class when i started the thread, and then re-import it if i started the > thread later . If so, this would allow me to work on a thread without > having to restart the main program, and i could let the other threads > keep running. As i find bugs, i could squash them without loosing any > functionality of the other threads. Then if i wanted to stop or restart > a thread by clicking a button, i could just re-import the class. > > is this ok ? You can use reload() to update a module that has been changed. You will also have to recreate any objects that were created from classes in the module so they become instances of the modified module. You might be interested in this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 Kent > > thanks > shawn > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor