Skip to content
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
Closed

Not hooking python #457

simonzack opened this issue Dec 7, 2015 · 4 comments
Labels

Comments

@simonzack
Copy link

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
Copy link
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
Copy link
Author

@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
Copy link
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
@ddebmath
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants