#python - Sat 28 Apr 2007 between 00:15 and 00:52

NY Lost Funds



Firewing1TFKyle: I think I found a decent solution
TFKyle: main thread (the gui thread) calls the backup operation as a new thread
inside that, subprocess.Popen, non-blocking
werneckyou call that decent ?
TFKylehrm, popen
Firewing1grab the Pid and just while loop it to check if it's active... If so, and "self.cancel == true" kill using PID
not perfect but it will do for now
werneckuse the GUI mainloop... it's the best solution... no threads
actionTFKyle dislikes using popen when there's python code to do something
TFKyledislikes using popen when there's python code to do something
Firewing1werneck, but then don't I have to use gobject.idles?
I need to have return values, and doesn't using only one thread disallow that?
TFKyleFirewing1: if you're using gtk it already uses gobject/GMainLoop
werneckno
you just register events and callbacks
TFKylethere's stuff to watch an fd in gobject's mainloop stuff I think
Firewing1werneck, do you have a link on how to implement this?
TFKylethough, not sure how it works for actually doing CPU work, if it's heavy it might require a GSource and liberal yeild'ing or something
werneckunfortunally not... you can check twisted source code... but it's not hard to do... just check the event methods and how to implement a callback
Firewing1k... For now I think I'll stick to the threads since it's working, but I'll change it to something more efficient later. Another blocker is I'd like to have tar, tar+gzip and direct copy as methods, and AFAIK there's no existing tar bindings for python
but that's another adventure...
kbrooksFirewing1, tarfile
TFKyleFirewing1: the first 2 can be done by the tarfile module I think
and the third os/shutil
ferguscanIf I have four points in 2-d space, representative of 2 lines, what's the easiest way in Python to find the intersection of those two lines?
actionTFKyle wonders if numpy/scipy has stuff for that
TFKylewonders if numpy/scipy has stuff for that
ferguscanTFKyle, not so important I guess. I'm already doing it myself. I was just wondering if I could reduce my code.
werneckpaste your code somewhere and maybe we can help you reducing it
ironfroggywhats up with the python announcement feeds?
im getting announcements for 2.4 final and PyCon05 Call for Proposals.
kbrooksironfroggy, very unusual
Firewing1Is win32api included by default in Windows Python isntalls?
dijixFirewing1: I know it's in the ActiveState install
Firewing1k
ironfroggyits not part of the standard installer for windows, but i think it ought to be. the thing is, its outside of the standard library and will likely never be part of it.
of course, ctypes covers a lot of things you'd need.
Firewing1ironfroggy, okay, so I'll use ctypes to kill processes on Windows
makes less for users to install
ironfroggywhats the win32 call for process killing?
so long as it has one, i dont know why os.kill wouldnt use it.
but if you are spawning your own processes, methods are being added to subprocess.Popen to do it more cleanly in killing them.

Page: 2 9 16 23 30 37 44 51 58 65 72 

IrcArchive

NY Lost Funds