[python] Jak ukoncit podprogram po fatalnej chybe bez toho aby sa ukoncil aj hlavny program

Leos Pol leos na radiante-corp.com
Středa Leden 31 11:41:04 CET 2007


Zdravim,

RMiklos na pss.sk wrote:
> a hlavny program z ktoreho ho volam takto
> --------------- skript ---------------------
> from consolepgm import pgm
> #
> print "spustam program..."
> mypgm=pgm()
> mypgm.run()
> print "koniec programu"
> ---------------- koniec --------------------
>   

from consolepgm import pgm

print "spustam program..."
mypgm=pgm()
try:
	mypgm.run()
except SystemExit:
    print 'chyba v podprogramu'
print "koniec programu"


Leo

-- 
----
Leos Pol
SW Engineer
Radiante Corp.

If it can be imagined,
we can implement it



Další informace o konferenci Python