Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Terminate a python script from linux shell / bash script

Reply
Thread Tools

Re: Terminate a python script from linux shell / bash script

 
 
norseman
Guest
Posts: n/a
 
      07-10-2008

Gros Bedo wrote:
>
>>> That's not how it works. If you kill one running python script it will not
>>> effect other python scripts. Each script has its own interpreter process
>>> running.

>
>> GB> So, is there a way from the Linux shell or a bash script to terminate
>> GB> just one specific Python script ?

>
>>> So just kill it.

>
> Yes I've seen that each python script calls its own instance of Python. But how to know which is the good one in bash ? Is there a command that gets the parameters of process, so I could use grep to select the one containing the name of my script ?
> __________________________________________________ _______________
> Votre contact a choisi Hotmail, l'e-mail nouvelle génération. Créez un compte.
> http://www.windowslive.fr/hotmail/default.asp
> --
> http://mail.python.org/mailman/listinfo/python-list
>


==============================
Yes. man ps explains
try ps -AFL | grep [known filename or cmdlin token]
then kill -9 [PID] found (check it more than twice)

1) If your script is known to hang use what another wrote:
py s.py tokens &
capture=$! (get the PID ready)
kill -9 $capture

2) If you are like the other 99% needing the PID because we didn't know
we were going to need it, use the ps/grep combo.


Try not to damage your system.
Which means: Trying to automate this is VERY dangerous!
How long since your last full backup? And of course you
can redo everything since last backup from memory, yes?
It hangs, you kill it manually.

Steve
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash shell to Python shell? edwithad Python 4 09-28-2009 07:56 AM
RE: Terminate a python script from linux shell / bash script Gros Bedo Python 0 07-13-2008 06:59 PM
RE: Terminate a python script from linux shell / bash script Gros Bedo Python 1 07-10-2008 08:50 PM
Terminate a python script from linux shell / bash script Gros Bedo Python 2 07-10-2008 08:42 AM
(patch for Bash) GTK+2 + Bash William Park XML 3 07-14-2005 12:09 AM



Advertisments