From: Sebastien M. <seb...@ig...> - 2006-03-13 08:24:45
|
Lind, Kenneth wrote: > Hi Sebastien, >=20 > This sounds like a strange thing to do. First, I would ask why are you= getting an error? Rather than hiding the error, you should fix it... >=20 > If that is not possible, a typical python way of doing this is to use a= try/except wrapping. for example: >=20 > try: > print 1/0 > except ZeroDivisionError: > pass >=20 > If you *really* want to manipulate sys.stderr, you can do it. Somethin= g like: >=20 > errF =3D open("stdout.err", "w") > sys.stderr =3D errF >=20 > Hope that helps. Best, > Ken It's this kind of manipulation I want. Thanks >>Hello, >> >>yes. maybe. if you are talking about printing to standard error, then : >> >> import sys >> sys.stderr.write("hello, stderr!") >> >>will do it. >> >>if, on the other hand, you mean something more complicated to do with=20 >>manipulating the shell ("redirection"...?) than I don't know, sorry. >> >>gilleain torrance >=20 >=20 > I would like to change the current path for stderr to /dev/null by exam= ple. >=20 > I have a plugin which creates a legend box from a fake (empty) apdb map= .=20 > Instruction, which loads the map, sends an error message and I would=20 > like to hide it. >=20 > How can I do ? >=20 > Thanks >=20 >=20 >> Hello, >> I would like to know if there is a way to manipulate standard error >> redirection into pymol scripting language ? >> >> Thanks --=20 S=E9bastien Moretti http://www.igs.cnrs-mrs.fr/ CNRS - IGS UPR 2589 163 Avenue de Luminy, case 934 13288 Marseille cedex 9 (France) |