mani sabri wonueprjngmailcom original message necrjiabt57imetonepythonorg mailtopythonwin32 idea asking want run python shell dllmain function came far bool apientry dllmainhandle hmoduledword ul_reason_for_calllpvoid lpreserved switchul_reason_for_call case dll_process_attach py_isinitialized bool res allocconsole going use handles heard way handle outhand getstdhandlestd_output_handle handle inhand getstdhandlestd_input_handle handle errhand getstdhandlestd_error_handle redirecting console freopenconoutwstdout freopenconinwstdin freopenconerrwstderr another way redirect console stdofstream console_outconout stdifstream console_inconin stdofstream console_errconout printf prints new console redirection printftest opening stdout stdin files pass python redirection file afile fopenconout w file bfile fopenconin w py_initialize py_isinitialized returnfalse bellow lines instead redirecting python crashes dll pysys_setobjectstdout pyfile_fromfileafile testwb fclose pysys_setobjectstdin pyfile_fromfilebfile coninwb fclose lines produces output pyrun_simplestringprint hellon pyrun_simplestringfrom ipythonshell import ipshellembedn pyrun_simplestringipshell ipshellembedn pyrun_simplestringipshelln break case dll_thread_attach break case dll_thread_detach break case dll_process_detach freeconsole py_finalize break returntrue trying give access python shell inside another application allocconsole want wxpython gui framework includes several tools exactly put editable window often useful barebones console said able accomplish allocconsole redirect printf python misunderstand try asking question specific clear please dont hesitate ask best regards mani _______________________________________________ pythonwin32 mailing list kpitckaew45pythonorg httpmailpythonorgmailmanlistinfopythonwin32 wed 06 aug 2008 100013 0330 pythonwin32 embedding ipython windows dll