SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] [IPython-dev] IPython proposal: getting rid of "ipython -pylab\-wthread\etc."

OK, I just found this thread that shows how to set PyOS_InputHook from
ctypes:
http://osdir.com/ml/python.ctypes/2006-12/msg00045.html
I tried it and it works fine. This will simplify the transition a lot. I
will develop some pure ctypes prototypes for the various toolkits and then
folks can begin to try this out.
Cheers,
Brian
On Thu, Jul 16, 2009 at 12:13 PM, Brian Granger <ell...@gm...>wrote:
> I tried ctypes first, but with no luck. Here is what I tried:
>
> >>> import readline
> >>> import ctypes
> >>> ctypes.pythonapi.PyOS_InputHook
> <_FuncPtr object at 0x76420>
> >>> def my_callback():
> ... print "In am here"
> ... return 0
> ...
> >>> cbf = ctypes.CFUNCTYPE(ctypes.c_int)(my_callback)
> >>> cbf
> <CFunctionType object at 0x769d0>
> >>> ctypes.pythonapi.PyOS_InputHook = cbf
>
> Do you see anything wrong with this?
>
> I should probably try it again to see if I can make it work though.
>
> Cheers,
>
> Brian
>
>
> On Thu, Jul 16, 2009 at 11:35 AM, Robert Kern <rob...@gm...>wrote:
>
>> On 2009年07月16日 13:11, Ville M. Vainio wrote:
>> > On Thu, Jul 16, 2009 at 9:06 PM, Brian Granger<ell...@gm...>
>> wrote:
>> >
>> >> I am fully aware that some environments upgrade things like GUI
>> toolkits
>> >> over very long time scales. More important - there isn't a released
>> version
>> >> of wx that has these capabilities in it. It will be a long time before
>> >
>> > I thought you were able to make wx work with a cython-based
>> > PyOS_InputHook extension. Possibly a C-based extension could fix this
>> > issue for users of old wx versions?
>>
>> Or even just a bit of ctypes?
>>
>> --
>> Robert Kern
>>
>> "I have come to believe that the whole world is an enigma, a harmless
>> enigma
>> that is made terrible by our own mad attempt to interpret it as though it
>> had
>> an underlying truth."
>> -- Umberto Eco
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPy...@sc...
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /