ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
Re: [ctypes-users] Re: Converting between ctypes data and Python data
by Carsten Wartmann other posts by this author
Feb 15 2006 6:51AM messages near this date
Re: [ctypes-users] Re: Converting between ctypes data and Python data | [Fwd: Re: [ctypes-users] Re: Getting value out of a VARIANT array]
Thomas Heller schrieb:

>  The SPINKIT_DATA instance should behave the same way as the 
>  SpinKitPyData instance that you create,

Hrmp, sometimes it helps just talking about something ;-)

I had some problems acessing the values and thought it was due to the 
cytpes structures.

But indeed it works as you say...

>  if you abstract from some details.  Can't you use it directly?  And, 
>  imo, a more pythonic way to
>  write your SpinKitReadNonBlocking method would be this (it returns the 
>  SPINKIT_DATA instance or None):
>  
>  def SpinkKitReadNonBlocking(self):
>     data = SPINKIT_DATA()
>     if windll.spinkit.SpinKitReadImmediate(self.Handle, byref(data)):
>         return data
>     return None

Yes, thats also possible now. The only difference is

data = cmspinkit.SPINKIT_DATA()
if sk.SpinKitReadNonBlockingD(data):
	"do stuff with data"

versus

data=sk.SpinKitReadNonBlockingD()
if data<> None:
	"do stuff with data"


I in fact like #2 more but this obviously differs from how it is done in 
the original C Library/Function.

Thank you very much,
Carsten


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users
Thread:
Carsten Wartmann
Thomas Heller
Carsten Wartmann
Thomas Heller
Carsten Wartmann

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved