I've been trying to do something that I thought was going to be relatively straight-forward, but so far I haven't found a good solution.
What I'm trying to do is discover a pid on a process and kill it. The way that I thought that I could do it is something along the lines of: import commands program = "someprogram" a = commands.getoutput('ps ax|grep %s ' % (program)) Then, I'd parse the returned info get the pid and kill it, probably via another command. However, what happens is that the "ps ax" portion truncates the listing at 158 characters. It just so happens that the unique name that I need in the list comes after that. So, works from the bash shell, but doesn't work using getoutput. I have also tried variations on a theme. For example, I created a shell file and tried to route into a file: ps ax|grep my_program_name > ps.output No luck. Do you have any suggestions? _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor