Re: [Tutor] question about importing threads

2007-02-11 Thread Luke Paireepinart
shawn bright wrote: > great, saves me 15 lines. > thanks You have 15 lines of imports? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] question about importing threads

2007-02-11 Thread shawn bright
great, saves me 15 lines. thanks sk On 2/11/07, Kent Johnson <[EMAIL PROTECTED]> wrote: shawn bright wrote: > one last queston. if i have a class that i import as a module, say a > script that emails me when something goes wrong. > so i have a file called my_own_email.py and in it a class call

Re: [Tutor] question about importing threads

2007-02-11 Thread Kent Johnson
shawn bright wrote: > one last queston. if i have a class that i import as a module, say a > script that emails me when something goes wrong. > so i have a file called my_own_email.py and in it a class called > MyOwnEmail. Now MyOwnEmail needs the smtplib module. Do i need to import > it just fo

Re: [Tutor] question about importing threads

2007-02-11 Thread shawn bright
Yes, Mr Gauld, this is a help. Even though i am still newbie enough to take some time digesting it. one last queston. if i have a class that i import as a module, say a script that emails me when something goes wrong. so i have a file called my_own_email.py and in it a class called MyOwnEmail. No

Re: [Tutor] question about importing threads

2007-02-09 Thread ALAN GAULD
> i have two classes in my program that use a global object > that is a socket connection. > ... code snipped > is there something tricky about passing this as a global object to > different modules that would need to use it? Whiler its possible to use a global in this way its usually better to

Re: [Tutor] question about importing threads

2007-02-09 Thread shawn bright
ok, i have started doing this with my 4000 + line file. So far its been working out. i have another question about it. i have two classes in my program that use a global object that is a socket connection. example: global my_sockobj serverhost = 'mehost.com' serverport = 9100 my_sockobj = socke

Re: [Tutor] question about importing threads

2006-12-31 Thread Alan Gauld
"shawn bright" <[EMAIL PROTECTED]> wrote > Yes, the thing is getting to be a pain to deal with at this size, i > am > in-process of splitting out the classes into their own files. One thing to watch is that while its easy and tempting to create one file per class it's often better to keep depend

Re: [Tutor] question about importing threads

2006-12-31 Thread shawn bright
Thanks, Alan. Yes, the thing is getting to be a pain to deal with at this size, i am in-process of splitting out the classes into their own files. Thanks for your help. shawn On 12/30/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "shawn bright" <[EMAIL PROTECTED]> wrote i > testing this right aw

Re: [Tutor] question about importing threads

2006-12-30 Thread Alan Gauld
"shawn bright" <[EMAIL PROTECTED]> wrote i > 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. As a general rule of thumb, any Python script (or any programming language file for that matter!) that ge

Re: [Tutor] question about importing threads

2006-12-30 Thread shawn bright
great help, and great link, thanks again. shawn On 12/30/06, Kent Johnson <[EMAIL PROTECTED]> wrote: shawn bright wrote: > 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

Re: [Tutor] question about importing threads

2006-12-30 Thread Kent Johnson
shawn bright wrote: > 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

Re: [Tutor] question about importing threads

2006-12-30 Thread shawn bright
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 th

Re: [Tutor] question about importing threads

2006-12-30 Thread Kent Johnson
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 pro

[Tutor] question about importing threads

2006-12-30 Thread shawn bright
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. i did not think that this would be a problem, but some of the threads pass information to views