I managed to solve this by setting the Std Handles (SetStdHandle) and
reopening stderr and s tdout of the Python CRT (vc 71)
Our app is built with VC 8, so I had to use a Dll built with VC 7.1 to
accomplish this (with LoadLibrary and GetProcAddress.
Code references:
http://msdn.microsoft.com/libr
> I am afraid my orginal post was a bit unclear. I am looking for a way
> to capture script output running in an ActiveScript Python host.
I'm afraid that is not possible - some script code will need to perform that
redirection for you, and that might need to happen for each script - the
axscript
David Nicolson wrote:
> This might do what you want to achieve. It seems to make py2exe crash
> on exit, some file locking error. Works fine otherwise though.
>
> #!/usr/bin/env python
>
> import sys
>
> class LogBuffer:
> def __init__(self):
> pass
>
> def flush(self):
>
This might do what you want to achieve. It seems to make py2exe crash
on exit, some file locking error. Works fine otherwise though.
#!/usr/bin/env python
import sys
class LogBuffer:
def __init__(self):
pass
def flush(self):
sys.__stdout__.flush()
def write(s
Hi,
Thanks for the answers so far.
I am afraid my orginal post was a bit unclear. I am looking for a way
to capture script output running in an ActiveScript Python host.
--
/Johan.
___
Python-win32 mailing list
Python-win32@python.org
http://mail.pyth
You can add this after your script "> file.txt"
Example:
:you_script.py >korv.txt
Then it will your print to the korv file..
/HejHopp
"Johan Lindvall" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Is there any way of capturing or displaying stdout when running a
> Py
Hi,
Is there any way of capturing or displaying stdout when running a
Python script? I know about:
import sys
sys.stdout = open("logfile.txt", "a")
but I don't want to modify my scripts to achieve this.
--
/Johan.
___
Python-win32 mailing list
Python