[pyar] subprocess: controlar proceso

Guillermo Narvaez gnrvzsix en gmail.com
Mie Jul 20 10:09:48 ART 2011


Muchas gracias j0hn! Lo estoy viendo ahora.

J. Guillermo Narvaez
_
Information Security Analyst - CompTIA S+ Certified
Network Manager at Programa Joaquin V. Gonzalez,
OLPC implementation in La Rioja Argentina.
_
gtalk: gnrvzsix en gmail.com
twitter: _aran0id




2011/7/20 j0hn <j0hn.com.ar en gmail.com>

> 2011/7/20 Guillermo Narvaez <gnrvzsix en gmail.com>
>
>>  Hola lista!
>>
>> Estoy jugando con subprocess, mas precisamente creando una conexion ssh,
>> hasta ahora crea el proceso y queda corriendo pero me gustaria poderlo
>> finalizar cuando lo requiera. ¿alguien podria explicarme como?
>>
>> Saludos.
>> J. Guillermo Narvaez
>> _
>> Information Security Analyst - CompTIA S+ Certified
>> Network Manager at Programa Joaquin V. Gonzalez,
>> OLPC implementation in La Rioja Argentina.
>> _
>> gtalk: gnrvzsix en gmail.com
>> twitter: _aran0id
>>
>>
>>
>> _______________________________________________
>> pyar mailing list pyar en python.org.ar
>> http://listas.python.org.ar/listinfo/pyar
>>
>> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>>
>> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
>> Argentina - http://www.usla.org.ar
>>
>
> En la documentación[0] te da 2 métodos para terminar un proceso:
>
> Poll.terminate()
> Poll.kill()
>
> Lo probé con gedit y anduvo:
>
> import subprocess
> p = subprocess.Popen(["/usr/bin/gedit"])
> p.terminate()
>
> Espero que sirva.
>
> [0] http://docs.python.org/library/subprocess.html
>
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20110720/82f265a4/attachment.html>


More information about the pyar mailing list