Re: [ctypes-users] Setting values of static variables in dlls
Brought to you by:
theller
From: Jacky <haz...@gm...> - 2009-05-13 04:03:54
|
It seems that correct way to assign a value is: >>> opt_flag.value = 1 On Tue, May 12, 2009 at 8:04 PM, Jacky <haz...@gm...> wrote: > The tutorial at > > > http://www.python.org/doc/2.5.2/lib/ctypes-accessing-values-exported-from-dlls.html > > describes how to access the value of a variable from a dl: > > >>> opt_flag = c_int.in_dll(pythonapi, "Py_OptimizeFlag") > >>> print opt_flag > c_long(0) > >>> > > > Is it possible to change the value of those variables? > Doing > > >>> opt_flag = c_long(1) > > has an effect only on the local python variable. > > Thanks! > |