New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not hooking python #457

Closed
simonzack opened this Issue Dec 7, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@simonzack

simonzack commented Dec 7, 2015

When I run python in the idle shell

import subprocess
subprocess.call([r'C:\Program Files\Python35\python.exe'])

The conemu window does not pop up and the windows command prompt does.

My list of hooked executables include:

python.exe|pythonw.exe
@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 7, 2015

Owner

Shell? Do not mean python.exe?
It's console application, the are not processed by DefTerm engine. You have to use -new_console switch

Owner

Maximus5 commented Dec 7, 2015

Shell? Do not mean python.exe?
It's console application, the are not processed by DefTerm engine. You have to use -new_console switch

@simonzack

This comment has been minimized.

Show comment
Hide comment
@simonzack

simonzack Dec 7, 2015

@Maximus5 I mean idle which comes with python, it's a gui for the command-line version of python (I actually use ipython + jupyter but I think this is easier for testing). You can run idle using "C:\Program Files\Python35\pythonw.exe" "C:\Progra~1\Python35\Lib\idlelib\idle.pyw".

Under idle the subprocess commands can be run which pops up a console window not caught by conemu:

import subprocess
subprocess.call([r'C:\Program Files\Python35\python.exe'])

I'm not sure what you mean by new_console, isn't the purpose of a default console to replace any cmd prompt that pops up?

simonzack commented Dec 7, 2015

@Maximus5 I mean idle which comes with python, it's a gui for the command-line version of python (I actually use ipython + jupyter but I think this is easier for testing). You can run idle using "C:\Program Files\Python35\pythonw.exe" "C:\Progra~1\Python35\Lib\idlelib\idle.pyw".

Under idle the subprocess commands can be run which pops up a console window not caught by conemu:

import subprocess
subprocess.call([r'C:\Program Files\Python35\python.exe'])

I'm not sure what you mean by new_console, isn't the purpose of a default console to replace any cmd prompt that pops up?

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Feb 7, 2016

Owner

That happens because of python's Idle architecture crazyness.
2016-02-07_21-21-10
The window "Python 3.4.x Shell" is created within one pythonw.exe, which is hooked by DefTerm properly, but command (python.exe) is executed within child pythonw.exe process, which is not hooked, obviously, because it has no GUI window!

Owner

Maximus5 commented Feb 7, 2016

That happens because of python's Idle architecture crazyness.
2016-02-07_21-21-10
The window "Python 3.4.x Shell" is created within one pythonw.exe, which is hooked by DefTerm properly, but command (python.exe) is executed within child pythonw.exe process, which is not hooked, obviously, because it has no GUI window!

@Maximus5 Maximus5 added the hooks label Feb 7, 2016

@konjecture

This comment has been minimized.

Show comment
Hide comment
@konjecture

konjecture May 24, 2016

So I'm having the same problem. I use a voice command to execute a python script and would like the script to run in the ConEmu console and not the py.exe terminal. Any way to accomplish that?

konjecture commented May 24, 2016

So I'm having the same problem. I use a voice command to execute a python script and would like the script to run in the ConEmu console and not the py.exe terminal. Any way to accomplish that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment