salir de un programa

Carlos Galisteo cgalisteo en k-rolus.net
Jue Dic 28 21:54:11 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sergi Rosello wrote:
> Estoy empezando con python y he echo el tipico menú con opciones. Me gustaría cerrar el programa de una manera elegante.

Yo uso sys.exit()

Extraido de [1]:

exit([status])

Exit the interpreter by raising SystemExit(status).
If the status is omitted or None, it defaults to zero (i.e., success).
If the status is numeric, it will be used as the system exit status.
If it is another kind of object, it will be printed and the system
exit status will be one (i.e., failure).

 Recuerda...pydoc es tu amigo :)

[1]http://pydoc.org/2.4.1/sys.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFlC7yW4wCemmtvmURAnThAJ4pmv/1NWmdZnySsMtC8p7crXCHPwCfchhO
jV7ZCpaN3WiHYX26gNw60y4=
=3Igs
-----END PGP SIGNATURE-----




Más información sobre la lista de distribución Python-es