With the following code:
import ctypes
> import readline
> from ctypes.util import find_library
>
> rl = ctypes.cdll.LoadLibrary(find_library('readline'))
>
> rl_redisplay = rl.rl_redisplay
> rl_redisplay.restype = None
> rl_redisplay.argtypes = None
>
> rl_redisplay_function = ctypes.c_void_p.in_
ing is
> running. However, when the program terminates normally and there happens to
> be one last callback underway, the c bindings hang. When viewed with GDB, I
> can see that the callback thread callstack looks like this:
>
> futex_abstimed_wait_cancelable()
> _pthread_cond
ience):
PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
PyObject_CallObject(cb, arglist);
PyGILState_Release(gstate);
This works perfectly while the python program using this c binding is running.
However, when the program terminates normally and there happens to be one last
callback underway,
Menu options work from the menu, but not from the accelerator associated
with that menu item. My research suggests that while 'command' works for the
menu item, 'bind' is required for the associated accelerator. For example,
File -> Quit is defined this way:
self.file_menu.add_command(
On Mon, Dec 14, 2020 at 4:57 AM Ethan Furman wrote:
>
> From: Caleb Gattegno
> Date: Fri, Dec 11, 2020 at 5:02 PM
> Subject: How to specify JSON parameters in CallBack?
>
>
> Please can you suggest where should I look for advice on converting a old
> style web app which v
From: Caleb Gattegno
Date: Fri, Dec 11, 2020 at 5:02 PM
Subject: How to specify JSON parameters in CallBack?
Please can you suggest where should I look for advice on converting a old style web app which vends whole pages of html
with a cgi-bin/python script invoked bypython3 server.py, into
question on callback functions with ctypes
I try to use GoVCL( https://github.com/ying32/govcl ) in python via
ctypes. GoVCL supplies C header and simple C demo under
https://github.com/ying32/govcl/tree/master/Tools/makeCHeader/test
Now the simple python code can run on both win7 and win10
alues to the names "i" and "icon".
> On the last line you create a lambda, an anonymous function, which you
> pass as the command callback for the button. Of course, no code inside the
> lambda is actually executed at this point. It is only after the entire for
> loop h
excuses for typos!
--
https://mail.python.org/mailman/listinfo/python-list
quot;i" and "icon".
On the last line you create a lambda, an anonymous function, which you pass
as the command callback for the button. Of course, no code inside the
lambda is actually executed at this point. It is only after the entire for
loop has completed, later when the user sees
erent names are written on
the gui just the callback is takest the newest icon object for all three
buttons
I know just a reference issue but it's been **bugging** me.
Thanks All
--
Abdur-Rahmaan Janhangeer
Mauritius
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday, August 30, 2018 at 10:08:34 AM UTC-6, Νίκος Βέργος wrote:
> I did try it with 'None' and as page='index.html' Flask return an error both
> ways (while bottle framework does not)
I think you are mistaken, making the change I suggested
fixes the "TypeError: index() missing 1 required p
e user clicks on the images within the html
> tamplate, to pass those variables value to '/' route so to perfrom then asome
> action with those values
>
> The error iam receiving is this:
> ===
> builtins.TypeError
> TypeError: index() missing 1 required positional arg
HI Dennis,
Thanks for the help, After changing WINFUNCTYPE to CFUNCTYPE, the call
back function works on the Linux :)
Thanks again,
Jason
On Wed, Jan 24, 2018 at 6:15 PM, Dennis Lee Bieber
wrote:
> On Wed, 24 Jan 2018 17:16:22 -0500, Jason Qian via Python-list
> declaimed the foll
On Thu, Jan 25, 2018 at 9:16 AM, Jason Qian via Python-list
wrote:
> Hi,
>
> I have following code that works fine on windows.
>
> InvocationCB=WINFUNCTYPE(None, c_char_p, c_int)
> submit = lib.submit
> submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB]
> submit.restype = ctypes.c_int
>
Hi,
I have following code that works fine on windows.
InvocationCB=WINFUNCTYPE(None, c_char_p, c_int)
submit = lib.submit
submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB]
submit.restype = ctypes.c_int
def handleResponse(message, code):
print('--- handleResponse ---')
prin
Vincent Vande Vyvre writes:
> Le 14/10/17 à 15:59, Stefan Behnel a écrit :
> ...
> Thanks, I know Cython but the code is already in C.
>
> This is a lib released as a frontend. Then usable only in command line.
This does not prevent the use of "Cython". In fact, one of
its use cases is the creat
On 14 October 2017 at 16:06, Vincent Vande Vyvre
wrote:
> I think I've found the problem, the string (a file path) is modified in c
> with "sprintf, snprintf, ..." And I plan to change that with some CPython
> equivalent function.
Nice :-) Glad you found it.
Paul
--
https://mail.python.org/mailm
Le 14/10/17 à 15:59, Stefan Behnel a écrit :
Vincent Vande Vyvre schrieb am 13.10.2017 um 13:18:
Le 13/10/17 à 12:39, Paul Moore a écrit :
As a specific suggestion, I assume the name of the created file is a
string object constructed in the C extension code, somehow. The fact
that you're gettin
Vincent Vande Vyvre schrieb am 13.10.2017 um 13:18:
> Le 13/10/17 à 12:39, Paul Moore a écrit :
>> As a specific suggestion, I assume the name of the created file is a
>> string object constructed in the C extension code, somehow. The fact
>> that you're getting the segfault with some uses of that
Thomas Jollans writes:
> On 2017-10-13 11:07, Vincent Vande Vyvre wrote:
>> Le 13/10/17 à 09:23, Chris Angelico a écrit :
>>> On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre
> ...
> If you have custom C code, it's likely that there is a memory management
> problem there. It's not unusual for
On 13 October 2017 at 12:18, Vincent Vande Vyvre
wrote:
> Le 13/10/17 à 12:39, Paul Moore a écrit :
>>
>> As a specific suggestion, I assume the name of the created file is a
>> string object constructed in the C extension code, somehow. The fact
>> that you're getting the segfault with some uses
Le 13/10/17 à 12:39, Paul Moore a écrit :
As a specific suggestion, I assume the name of the created file is a
string object constructed in the C extension code, somehow. The fact
that you're getting the segfault with some uses of that string
(specifically, passing it to %-formatting) suggests th
As a specific suggestion, I assume the name of the created file is a
string object constructed in the C extension code, somehow. The fact
that you're getting the segfault with some uses of that string
(specifically, passing it to %-formatting) suggests that there's a bug
in the C code that construc
On 2017-10-13 11:07, Vincent Vande Vyvre wrote:
> Le 13/10/17 à 09:23, Chris Angelico a écrit :
>> On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre
>> wrote:
>>> Simplified code:
>>>
>>> ---%<--
>>> ...
>>> ---%<--
Le 13/10/17 à 09:23, Chris Angelico a écrit :
On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre
wrote:
Simplified code:
---%<--
...
---%<--
If I place self.callback() at the end of the func process that doesn't
ult on disk with a new name
> self.out_filename.write(.)
>
> def run_multitasks(self):
> while self.tasks:
> t = Thread(target=process, args=self.tasks.pop(0))
> t.start()
> t.join()
> self.callback(self.out_f
sks:
t = Thread(target=process, args=self.tasks.pop(0))
t.start()
t.join()
self.callback(self.out_filename)
def add_task(self, fname, callback):
self.tasks.append(fname)
self.callback = callback
if len(self.tasks) =
-Original Message-
From: Bill Somerville
Sent: 04 August 2016 18:23
To: 'eryk sun' ; python-list@python.org
Subject: RE: Issue with ctypes and callback functions
-Original Message-
From: eryk sun [mailto:eryk...@gmail.com]
from_param is a hook method for a type that&
IG. Does it provide some means to
instantiate a wrapped type from an address? If it does, then you can use a void
pointer as the callback parameter.
Hi Eryk,
Thanks for looking at this. I had got as far as looking at the code above and
guessed that only ctypes types were supported. This does
of having the Python callback (my_cb)
> magically
> receive the SWIG wrapped 'my_type' struct.
from_param is a hook method for a type that's set in a function
pointer's argtypes. It gets called to convert an argument when the
function pointer is called from Python. The return va
-Original Message-
From: eryk sun [mailto:eryk...@gmail.com]
Sent: 03 August 2016 13:16
To: python-list@python.org
Cc: Bill Somerville
Subject: Re: Issue with ctypes and callback functions
On Wed, Aug 3, 2016 at 9:38 AM, Bill Somerville
wrote:
>
> Is this a good place to ask que
On Wed, Aug 3, 2016 at 9:38 AM, Bill Somerville
wrote:
>
> Is this a good place to ask questions about the above?
Discussing ctypes is fine here. There's also a ctypes-users list.
--
https://mail.python.org/mailman/listinfo/python-list
Hi All,
Is this a good place to ask questions about the above?
Regards
Bill.
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Nov 30, 2015 at 7:44 PM, Dennis Lee Bieber
wrote:
> On Mon, 30 Nov 2015 10:55:23 -0800 (PST), fl declaimed
> the following:
>
>>Thanks Ian. I created the class because I want to use the original example
>>line
>>
>> UI.Button("button %s" % i,
On Monday, November 30, 2015 at 12:02:57 PM UTC-5, Ian wrote:
> On Mon, Nov 30, 2015 at 10:44 AM, fl wrote:
> > I come across the following code snippet.
> >
> > for i in range(10):
> > def callback():
> > print "clicked button", i
callbackk()
> return
> UI=buibutton()
>
>
> for i in range(10):
> def callback():
> print "clicked button", i
> UI.Button("button %s" % i, callback)
>
>
> To my surprise, the output is not the original link expected. i.e. it is
&
On Monday, November 30, 2015 at 12:37:52 PM UTC-5, Terry Reedy wrote:
> On 11/30/2015 11:44 AM, fl wrote:
>
> > I come across the following code snippet.
>
> > for i in range(10):
> > def callback():
> > print "clicked button", i
&
On Monday, November 30, 2015 at 11:44:44 AM UTC-5, fl wrote:
> Hi,
>
> I come across the following code snippet.
>
>
>
>
>
> for i in range(10):
> def callback():
> print "clicked button", i
> UI.Button("button %s" % i
On 11/30/2015 11:44 AM, fl wrote:
I come across the following code snippet.
for i in range(10):
def callback():
print "clicked button", i
UI.Button("button %s" % i, callback)
http://effbot.org/zone/default-values.htm
Note that the above is an in
On Mon, Nov 30, 2015 at 10:44 AM, fl wrote:
> I come across the following code snippet.
>
> for i in range(10):
> def callback():
> print "clicked button", i
> UI.Button("button %s" % i, callback)
>
> The content inside parenthesis i
On Mon, Nov 30, 2015 at 10:53 AM, Zachary Ware
wrote:
> On Mon, Nov 30, 2015 at 10:44 AM, fl wrote:
>> The content inside parenthesis in last line is strange to me.
>>
>> "button %s" % i, callback
>
> https://docs.python.org/library/stdtypes.html#printf-s
On Mon, Nov 30, 2015 at 10:44 AM, fl wrote:
> The content inside parenthesis in last line is strange to me.
>
> "button %s" % i, callback
https://docs.python.org/library/stdtypes.html#printf-style-string-formatting
--
Zach
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I come across the following code snippet.
for i in range(10):
def callback():
print "clicked button", i
UI.Button("button %s" % i, callback)
The content inside parenthesis in last line is strange to me.
"button %s" % i, callback
T
;
> }
>
> it tries to PyINCREF to my passed callback.
This indicates that it expects the "callback" to be a Python object.
Check the C-API specification. It should tell you which parameters
are expected to be Python objects and which C objects.
--
https://mail.python.org/mailman/listinfo/python-list
doc.mefi...@gmail.com schrieb am 07.06.2015 um 10:56:
> And I can't use Cython, because I have C++ module, and I have to use it.
That's not a valid reason. Cython supports C++ code just fine.
http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html
Stefan
--
https://mail.python.org/mailma
> >And I can't use Cython, because I have C++ module, and I have to use it.
> >--
> >https://mail.python.org/mailman/listinfo/python-list
>
> Are you using Boost?
> http://www.boost.org/doc/libs/1_58_0/libs/python/doc/
>
> It handles lots of the setup for you.
>
> Laura
No, I'm not using Boost
In a message of Sun, 07 Jun 2015 01:56:47 -0700, doc.mefi...@gmail.com writes:
>And I can't use Cython, because I have C++ module, and I have to use it.
>--
>https://mail.python.org/mailman/listinfo/python-list
Are you using Boost?
http://www.boost.org/doc/libs/1_58_0/libs/python/doc/
It handles
I'm trying to debug and find my error. It goes wrong when:
PyObject *v;
v = va_arg(*p_va, PyObject *);
if (v != NULL) {
if (*(*p_format - 1) != 'N')
Py_INCREF(v);
}
it tries to PyINCREF to my passed call
And I can't use Cython, because I have C++ module, and I have to use it.
--
https://mail.python.org/mailman/listinfo/python-list
No, myclass is not null. I think my style of passing arguments is wrong.
--
https://mail.python.org/mailman/listinfo/python-list
doc.mefi...@gmail.com writes:
> Hi. I'm a newbie in python. But I want embed it in my C program.
>
> There is such method of my class:
> @staticmethod
> def install_instr_callback(callback):
> # set hook for every change of PC
> m68k.set_instr_hook_callback(call
Hi. I'm a newbie in python. But I want embed it in my C program.
There is such method of my class:
@staticmethod
def install_instr_callback(callback):
# set hook for every change of PC
m68k.set_instr_hook_callback(callback)
And in my C code there is such callback function:
s
On Fri, Mar 20, 2015 at 11:29 AM, wrote:
> Hi everyone,
>
> just like the title says I'm searching for a mechanism which allows to call a
> callback function from a thread, being the callback executed in the parent
> thread (it can also be the main thread). I'm basica
Hi everyone,
just like the title says I'm searching for a mechanism which allows to call a
callback function from a thread, being the callback executed in the parent
thread (it can also be the main thread). I'm basically looking for something
like the CallAfter method of the wx or
e to be called every time the slider is moved. This
procedure will be passed one argument, the new scale value.
If the slider is moved rapidly, you may not get a callback for
every possible position, but you'll certainly get a callback when
it settles
Command on Spinbox widget
A procedure
On Tue, Oct 28, 2014 at 6:35 PM, ast wrote:
> OK, but i still find very strange the choice of Python's designers to
> make the Scale behaves like that.
That's nothing to do with Python's design. That's all about Tkinter,
which presumably is imitating Tk. Python allows t
"Peter Otten" <__pete...@web.de> a écrit dans le message de
news:mailman.15231.1414399974.18130.python-l...@python.org...
Tanks for you answer
Python doesn't "know" it has to pass an argument, it just does it. Change
the callback to
def maj():
print(&quo
- Original Message -
> From: "ast"
> To: python-list@python.org
> Sent: Monday, 27 October, 2014 9:16:26 AM
> Subject: Callback functions arguments
>
> Hi
>
> In this web site at example n°5
> http://fsincere.free.fr/isn/python/cours_python_tkinter.p
afenetre, from_=-100, to=100, resolution=10, \
> orient=HORIZONTAL, length=300, width=20, label="Offset", \
> tickinterval=20, variable=Valeur, command=maj)
>
> The "maj" callback function is:
>
> def maj(nouvelleValeur):
> print(nouvelleValeur)
&g
length=300, width=20, label="Offset", \
tickinterval=20, variable=Valeur, command=maj)
The "maj" callback function is:
def maj(nouvelleValeur):
print(nouvelleValeur)
When the user move the scale with the mouse, the new position
is supposed to be printed on the python she
her down the stack and harder to isolate from the lock,
> although I would argue that's probably a code smell.
I'd definitely call it code smell. What happens with this?
with lock:
def inner():
do_more_work()
f.add_done_callback(inner)
The lock's possibly released
On Thu, Sep 25, 2014 at 8:47 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Thu, Sep 25, 2014 at 3:46 AM, Marko Rauhamaa wrote:
>>> Example (pseudocode):
>>>
>>>def callback(self):
>>> with self.lock:
>>>
Ian Kelly :
> On Thu, Sep 25, 2014 at 3:46 AM, Marko Rauhamaa wrote:
>> Example (pseudocode):
>>
>>def callback(self):
>> with self.lock:
>> ...
>>
>>def xyz(self, f):
>> with self.lock:
>> ...
>&
>
> There should be a guarantee that the callback is not called from the
> same thread before returning from Future.add_done_callback. Otherwise,
> the caller may have a really difficult time handling preemption and
> avoiding deadlocks at the same time.
>
> Example (p
Ian Kelly :
> The documentation for Future.add_done_callback says: "If the future
> has already completed or been cancelled, fn will be called
> immediately."
That sounds really bad.
There should be a guarantee that the callback is not called from the
same thread be
On Wed, Sep 24, 2014 at 8:44 AM, Praveen Gollakota wrote:
> However, it seemed to fail when I removed the `time.sleep(random.random())`
> statements, i.e. at least a few `func` functions and `callbacks` **did not**
> run in the same thread.
>
> For a project that I am working o
Praveen Gollakota writes:
> In the ThreadPoolExecutor (TPE), is the callback always guaranteed to run in
> the same thread as the submitted function?
To answer question of this type (yourself), you may look
at the relevant source code.
I am quite sure that the "submitted functi
Hello,
In the ThreadPoolExecutor (TPE), is the callback always guaranteed to run in
the same thread as the submitted function?
For example, I tested this with the following code. I ran it many times and it
seemed like `func` and `callback` always ran in the same thread.
import
Le vendredi 21 mars 2014 16:50:18 UTC, Mark H. Harris a écrit :
> > def TheProc(): <== you moved c_int from here ...
>
> > fpgui.fpgFormWindowTitle(0, 'Boum')
>
> > return 0
> > CMPFUNC = CFUNCTYPE(c_int) < and placed it here ...
>
>
> ... it wa
On 3/21/14 7:02 AM, fienspr...@gmail.com wrote:
Yep, Many thanks for help
Hum, i have find the solution, it was in "CallBack function" in help-doc.
No, it was not in the "CallBack function" in help-doc ...
def TheProc(): <== yo
moin/GoogleGroupsPython helpful. It will
>
> certainly help with the double-spacing in your quote above.
> Rhodri James *-* Wildebeest Herder to the Masses
Yep, Many thanks for help
Hum, i have find the solution, it was in "CallBack function" in help-doc
On Thu, 20 Mar 2014 23:56:43 -, wrote:
Give the function call its required argument and the error will go
away... well, at least that one.
Yep, many thanks for the answer.
But... im totally beginner with Python.
I develop in Pascal and C and want to understand the basics of Python.
In c
On Friday, March 21, 2014 7:56:43 AM UTC+8, fiens...@gmail.com wrote:
> > Give the function call its required argument and the error will go
>
> >
>
> > away... well, at least that one.
>
>
>
> Yep, many thanks for the answer.
>
> But... im totally beginner with Python.
>
> I develop in Pa
> Give the function call its required argument and the error will go
>
> away... well, at least that one.
Yep, many thanks for the answer.
But... im totally beginner with Python.
I develop in Pascal and C and want to understand the basics of Python.
In concrete, what must i change in the code ?
On 3/20/14 6:16 PM, fienspr...@gmail.com wrote:
def TheProc(c_int): fpgui.fpgFormWindowTitle(0, 'Boum')
return 0
TheProcF = CMPFUNC(TheProc)
Traceback (most recent call last): File "_ctypes/callbacks.c",
line 314, in 'calling callback function' TypeEr
Hello. I want to use a c library. It is a complete graphic widget set.
Here code working. But i have problem with the callback function. The callback
is executed while ClikOnForm is executed but i get a error message (see after
code
On Sun, May 26, 2013 at 9:12 AM, Shriramana Sharma wrote:
> On Friday, May 24, 2013 8:56:28 AM UTC+5:30, Dan Stromberg wrote:
> > Cython is good. So is the new cffi, which might be thought of as a
> > safer (API-level) version of ctypes (which is ABI-level).
>
> Hi -- can you clarify what is this
https://cffi.readthedocs.org/en/release-0.6/
> Date: Sun, 26 May 2013 09:12:10 -0700
> Subject: Re: Help with implementing callback functions using ctypes
> From: samj...@gmail.com
> To: python-list@python.org
>
> On Friday, May 24, 201
On Friday, May 24, 2013 8:56:28 AM UTC+5:30, Dan Stromberg wrote:
> Cython is good. So is the new cffi, which might be thought of as a
> safer (API-level) version of ctypes (which is ABI-level).
Hi -- can you clarify what is this new CFFI and where I can get it? In the
Python 3 library reference
On Wed, May 8, 2013 at 10:54 PM, dieter wrote:
> jamadagni writes:
> > ...
> I cannot help you with "ctypes". But, if you might be able to use
> "cython", then calling callbacks is not too difficult
> (you can find an example in e.g. my "dm.xmlsec.binding").
>
> Note, however, that properly hand
r than where
Python's control goes?
If I had seen this post I might not have even spent time on Cython. (For some
reason Google Groups doesn't send me email updates even if I ask it to.) Using
CTYpes I was able to implement a callback with less coding (for this particular
requirement) than
using ctypes. However it would seem that the first call to the
> callback results in a segfault.
> # call the C function
> spiro_to_bezier_strict ( src, len ( src ), bc )
This line should be:
spiro_to_bezier_strict ( src, len ( src ), byref(bc) )
Without the byref(...), it will try
elps in debugging crashes like this one.
http://docs.cython.org/src/userguide/debugging.html
> (you can find an example in e.g. my "dm.xmlsec.binding").
An "official" example is here:
https://github.com/cython/cython/tree/master/Demos/callback
> Note, however, that prop
jamadagni writes:
> ...
I cannot help you with "ctypes". But, if you might be able to use
"cython", then calling callbacks is not too difficult
(you can find an example in e.g. my "dm.xmlsec.binding").
Note, however, that properly handling the GIL ("Global Interpreter Lock")
may be of great impor
ython script spiro.py using
ctypes. However it would seem that the first call to the callback results in a
segfault. (The line before the callback is executed.) I tried debugging using
gdb but perhaps because of my insufficient knowledge I couldn't find out what
is causing the problem.
I
ohlfsen writes:
> Hello.
>
> Hoping that someone can shed some light on a tiny challenge of mine.
>
> Through ctypes I'm calling a c DLL which requires me to implement a callback
> in Python/ctypes.
>
> The signature of the callback is something like
>
> void
Hello.
Hoping that someone can shed some light on a tiny challenge of mine.
Through ctypes I'm calling a c DLL which requires me to implement a callback in
Python/ctypes.
The signature of the callback is something like
void foo(int NoOfElements, char Elements[][100])
How do I pos
On Wed, Nov 30, 2011 at 7:34 AM, Jason Veldicott
wrote:
> Hi,
>
> I am wondering if anyone here might be able to suggest if there is a way of
> switching over from python execution into debug mode of an IDE, from python
> code that is executed as a callback from a C++ DLL?
Hi,
I am wondering if anyone here might be able to suggest if there is a way of
switching over from python execution into debug mode of an IDE, from python
code that is executed as a callback from a C++ DLL?
Thanks
Jason
--
http://mail.python.org/mailman/listinfo/python-list
(most recent call last):
> File "_ctypes/callbacks.c", line 295, in 'calling callback function'
> File "./core.py", line 54, in DebugMessage
> print lvl, msg.value
> AttributeError: 'LP_c_char' object has no attribute 'value'
>
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 26 Mar 2011 05:23:27 +0300, OJ wrote:
> Hi I am opening a shared library which has defined the following
> callback prototype:
> extern void DebugMessage(int level, const char *message, ...);
>
> My implementation in Python looks like this:
> DEBUGFUNC = cty
Hi I am opening a shared library which has defined the following
callback prototype:
extern void DebugMessage(int level, const char *message, ...);
My implementation in Python looks like this:
DEBUGFUNC = ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.POINTER(ctypes.c_char))
def DebugMessage(lvl
Hello all,
I wonder if someone could explain some of the following.
(Python 3.2)
I have a class which has a method called 'callback()'.
An instance of this class calls a C extension which
then calls back into Python.
In all cases below, two arguments are passed to the C
code and
Hi,
I'm trying to write a COM client to a COM server which controls a power
meter. The COM server fires events that should be handled by the
client. The docs state that I have to supply a class which implements
the IFM2DeviceEvents interface. I need some instructions on how to
translate the VB sam
mething like
>
> def myHelp(option, opt, value, parser):
> parser.print_help()
> if hasattr(parser.values, 'file') and parser.values.file:
> proc = subprocess.Popen([parser.values.file, '-h'],
> stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> prin
, value, parser):
parser.print_help()
if hasattr(parser.values, 'file') and parser.values.file:
proc = subprocess.Popen([parser.values.file, '-h'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print proc.stdout.read()
print proc.stderr.read()
parser.
Here is a solution using plac (http://pypi.python.org/pypi/plac) and
not OptionParse, in the case
the Linux underlying command is grep:
import subprocess
import plac
@plac.annotations(help=('show help', 'flag', 'h'))
def main(help):
if help:
script_usage = plac.parser_from(main).forma
Hi,
I want to display help message of python script and then display help
message from the binary file (which also supports -h option):
Assumptions:
1) 'mybinary' - is linux executable file which supports '-h' and on '-
h' option it displays the help message
2) myscript.py - when passing '-h' opt
On Jul 31, 10:22 pm, "Mark Tolonen" wrote:
> "legard_new" wrote in message
>
> news:70faf0b4-fead-49ac-bf18-e182fd63b...@j8g2000yqd.googlegroups.com...
>
>
>
>
>
> > Hello,
>
> > I have a problem with calling Callback function with Pyt
1 - 100 of 315 matches
Mail list logo