Python as alternative to Visual Basic

F. Petitjean littlejohn.75 at noos.fr
Tue Sep 21 12:20:46 EDT 2004


On Tue, 21 Sep 2004 17:38:30 +0200, Fred <nobody at nowhere.com> wrote:
> On Mon, 20 Sep 2004 21:01:43 -0600, Dave Brueck
><dave at pythonapocrypha.com> wrote:
>>And don't forget ctypes! Although not a Windows-only tool, on a Windows system 
>>it opens the door to pretty much every Win32 API there is, all from pure Python.
> 
> Is there a framework that uses ctypes and wraps the Windows API as a
> set of classes? I'd rather use the native Windows widgets instead of
> using wxWidgets or Qt, but I don't really like PythonWin/MFC.
> 
> Fred.
  Yes : venster   http://venster.sourceforge.net

and here is a way to be explicit in the Windows API :

def prototype(func, result_type, *argstypes):
    """prototype(func, result_type, *argstypes) -> None
    Set the prototype of function func"""
    func.restype = result_type
    func.argtypes = argstypes


_user32 = windll.user32

DefWindowProc = _user32.DefWindowProcA
prototype(DefWindowProc, LRESULT, HWND, UINT, WPARAM, LPARAM)

and so on  (in windows.py)

regards.



More information about the Python-list mailing list