[wingide-users] ctypes on windows - windll is not defined

Mike Driscoll mdriscoll at co.marshall.ia.us
Wed Feb 24 12:08:44 MST 2010


On 1:59 PM, Marius wrote:
> Hi!
>
>
> I'm giving WingIDE a try, however there's a cumbersome problem with
> ctypes in my way:
> It's a Windows XP SP III system, Python25, WingIDE.
> I even tried to switch to Python26.
> In any of these official Python versions ctypes is included by default.
>
> """
> from ctypes import *
> print windll.kerel32
> """
>
> Easy as that is: in the interpreter it works perfectly, returning
> <WinDLL 'kernel32', handle 7c8 blablabla>
>
> However - using the debugger and running the script directly doesn't
> work. Any time I import ctypes that works without any hassle, but I get:
> "NameError: name 'windll' is not defined." When I use something from ctypes.
>
> - Same thing for Unions or anything ctypes related.
> - However, forking an interpreter shell within WingIDE: no problems.
>
> Does anybody know what's the issue here and how to get rid of it?
>
> Best,
> Marius
>
>    
If you actually ran that code  in your example, it's no wonder why it 
didn't work. There is no "kerel32" method for the windll module.

I tried running the following on my Windows XP SP 3 machine:

 >>> from ctypes import *
 >>> print windll.kernel32
<WinDLL 'kernel32', handle 7c800000 at d93d90>

It worked fine for me. I have Python 2.5.4 and Wing Pro 3.2.4-1.


-- 
*Mike Driscoll*

Blog: http://blog.pythonlibrary.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20100224/92d6a47f/attachment.html


More information about the wingide-users mailing list