Find function name in function

Sean Ross frobozz_electric at hotmail.com
Wed May 21 10:27:56 EDT 2003


Okay, thanks. I've never needed to redirect stdout before, so I didn't know.
I also didn't know about the dis module before this little failed
experiment, so I've managed to get a few things out of this.

"Gerrit Holl" <gerrit at nl.linux.org> wrote in message
news:mailman.1053509733.16598.python-list at python.org...
> Sean Ross schreef op dinsdag 20 mei om 21:29:01 +0000:
> >     # redirect ouput of disassemble (stdout)
> >     oldout = sys.stdout
> >     sys.stdout = open('log','w')
> >     dis.disassemble(code, lasti)
> >     sys.stdout.close()
> >
> >     # restore stdout
> >     sys.stdout = oldout
>
> I think backuping sys.stdout is not necessary, as sys.__stdout__
> exists for that goal.
>
> yours,
> Gerrit.
>
> --
> 117. If any one fail to meet a claim for debt, and sell himself, his
> wife, his son, and daughter for money or give them away to forced labor:
> they shall work for three years in the house of the man who bought them,
> or the proprietor, and in the fourth year they shall be set free.
>         -- Hammurabi, Code of Law
> --
> Asperger Syndroom - een persoonlijke benadering:
> http://people.nl.linux.org/~gerrit/
> Het zijn tijden om je zelf met politiek te bemoeien:
> http://www.sp.nl/
>






More information about the Python-list mailing list