Re: [python-win32] win32console attach problems

2008-10-07 Thread Tim Roberts
Stian wrote: > > I've seen this myself, but couldn't reliably reproduce it. > > If I recall, allocating a new console, and then immediately > > freeing it seemed to clear the 'in-between' state. > > Man, that did the trick! Thanks! I added a win32console.AllocConsole() > before the FreeConsole()

Re: [python-win32] win32console attach problems

2008-10-07 Thread Stian
> I've seen this myself, but couldn't reliably reproduce it. > If I recall, allocating a new console, and then immediately > freeing it seemed to clear the 'in-between' state. Man, that did the trick! Thanks! I added a win32console.AllocConsole() before the FreeConsole() in the first try-except-c

Re: [python-win32] win32console attach problems

2008-10-06 Thread Stian
> On Windows, by default, scripts with a .py extension are run by > Python.exe, which is a console application. If you can write to stdout > and see the results in a console window, then you have a console. > Scripts with a .pyw extension are run by Pythonw.exe, which is a Windows > application.

Re: [python-win32] win32console attach problems

2008-10-06 Thread Tim Roberts
Stian wrote: > > Well, let me ask a silly question. Are you running this from a "pyw" > > app, using Pythonw.exe, so you don't have a console of your own? > > Well, that's not a silly question for me - I'm rather new to Python. > Anyway - let me tell you a bit more about how this is put together

Re: [python-win32] win32console attach problems

2008-10-05 Thread Stian
> Well, let me ask a silly question. Are you running this from a "pyw" > app, using Pythonw.exe, so you don't have a console of your own? Well, that's not a silly question for me - I'm rather new to Python. Anyway - let me tell you a bit more about how this is put together if that may be relevant

Re: [python-win32] win32console attach problems

2008-10-03 Thread Tim Roberts
Stian wrote: > > What error do you get? MSDN describes several different error returns. > Actually I was wrong. The first error is "Handle is invalid". Then all > following errors are "Access is denied.", which seems to be the same > error I get when a console is already attached. But if this was

Re: [python-win32] win32console attach problems

2008-10-03 Thread Stian
> What error do you get? MSDN describes several different error returns. Actually I was wrong. The first error is "Handle is invalid". Then all following errors are "Access is denied.", which seems to be the same error I get when a console is already attached. But if this was the case - shouldn't

Re: [python-win32] win32console attach problems

2008-10-03 Thread Tim Roberts
Stian wrote: > > > I'm experiencing concurring problems when attempting to attach to a > console using the PyWin32 win32console. I have an application which > may attach to a console, send ctrl+c to it and then detach - using > win32console. If I do this "too soon" after the console is started the

[python-win32] win32console attach problems

2008-10-03 Thread Stian
Hi, I'm experiencing concurring problems when attempting to attach to a console using the PyWin32 win32console. I have an application which may attach to a console, send ctrl+c to it and then detach - using win32console. If I do this "too soon" after the console is started the AttachConsole fails,