[IPython-user] embedding IPython in windows dll

mani sabri mani.sabri@gmail....
Mon Mar 10 06:17:50 CDT 2008


Take a look , is there any difference between the commented lines and the
ctypes in PyRun_SimpleString?

//BOOL res = AllocConsole();
PyRun_SimpleString("import ctypes");
PyRun_SimpleString("res = ctypes.windll.kernel32.AllocConsole()");
				
//HANDLE OutHand = GetStdHandle(STD_OUTPUT_HANDLE);
//HANDLE InHand = GetStdHandle(STD_INPUT_HANDLE);
//HANDLE ErrHand = GetStdHandle(STD_ERROR_HANDLE);
PyRun_SimpleString("stdin = ctypes.windll.kernel32.GetStdHandle(-10)");
PyRun_SimpleString("stdout = ctypes.windll.kernel32.GetStdHandle(-11)");
PyRun_SimpleString("stderr = ctypes.windll.kernel32.GetStdHandle(-12)");

I saw IOSTREAM class in genutils.py but I couldn't quite catch it! Can
anybody help?

Best regards,
Mani
>-----Original Message-----
>From: ipython-user-bounces@scipy.org [mailto:ipython-user-
>bounces@scipy.org] On Behalf Of Alexander Belchenko
>Sent: Monday, March 10, 2008 10:21 AM
>To: ipython-user@scipy.net
>Subject: Re: [IPython-user] embedding IPython in windows dll
>
>mani sabri пишет:
>> Dll doesn't crash or ... everything works fine but there is no shell! Can
>> anybody help?
>
>If your main program is Windows GUI you need to explicitly create console
>with Win32 API
>(AllocConsole function) and then attach it to your program.
>
>http://msdn2.microsoft.com/en-us/library/ms682010(VS.85).aspx
>
>_______________________________________________
>IPython-user mailing list
>IPython-user@scipy.org
>http://lists.ipython.scipy.org/mailman/listinfo/ipython-user



More information about the IPython-user mailing list