473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

where to find the spec of format in PyObject_CallMethod

I am trying to use PyObject_CallMethod. It needs a format string to
specify what are the followed arguments. Is it possible to use a
PyObject* as an argument?

Where can I find the spec for the format?

Thanks in advance.

Jan 10 '07 #1
2 2943
On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote:
I am trying to use PyObject_CallMethod. It needs a format string to
specify what are the followed arguments. Is it possible to use a
PyObject* as an argument?

Where can I find the spec for the format?

Thanks in advance.
See http://docs.python.org/api/object.html#l2h-247 :

Note in particular "The C arguments are described by a Py_BuildValue()
format string that should produce a tuple" and "Note that if you only
pass PyObject * args, PyObject_CallMethodObjArgs is a faster
alternative."

So, If all your arguments are PyObject pointers, use
PyObject_CallMethodObjArgs instead. Otherwise, use PyObject_CallMethod
and consult the documentation for Py_BuildValue on how to construct the
format string.

Hope this helps,

Carsten.
Jan 10 '07 #2
Thanks. I have mixed arguments.

I found the format spec @ http://docs.python.org/api/arg-parsing.html

On Jan 10, 5:31 pm, Carsten Haese <cars...@uniqsys.comwrote:
On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote:
I am trying to use PyObject_CallMethod. It needs a format string to
specify what are the followed arguments. Is it possible to use a
PyObject* as an argument?
Where can I find the spec for the format?
Thanks in advance.Seehttp://docs.python.org/api/object.html#l2h-247:

Note in particular "The C arguments are described by a Py_BuildValue()
format string that should produce a tuple" and "Note that if you only
pass PyObject * args, PyObject_CallMethodObjArgs is a faster
alternative."

So, If all your arguments are PyObject pointers, use
PyObject_CallMethodObjArgs instead. Otherwise, use PyObject_CallMethod
and consult the documentation for Py_BuildValue on how to construct the
format string.

Hope this helps,

Carsten.
Jan 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lamthierry | last post by:
Calling a python method from C++ has the following signature: PyObject * PyObject_CallMethod(PyObject *self, char *method_name, char *arg_format, ...); I'm having trouble figuring out how to...
2
by: JC | last post by:
Does anyone know where I can find the old SOAP 1.1 specification. The content of the URL http://www.w3.org/TR/SOAP/ where it used to be has been replaced by the new 1.2 spec. But I need the 1.1...
2
by: Victor Bien | last post by:
W3C says somewhere that tables should not be used for formatting columns etc. but that style sheets should be used instead. This has a major unlearning/relearning implications for me (and just...
2
by: David Pautler | last post by:
I'm creating a web-based authoring tool where one form encompasses several sections for editing. I'd like each section to have its own reset button, so that use of that button affects only that...
6
by: Mark Cunningham | last post by:
I am curious if there is something that would be considered a proper method for locating small (three to four items) amounts of page specific styling. Or does it really matter in the great scheme...
5
by: Howard Kaikow | last post by:
I know where to find the spec for ECMAScript and the Document Object Model, but where do I find the spec for, e.g.? alert location.href -- http://www.standards.com/; See Howard Kaikow's web...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
2
by: Matthijs van Waveren | last post by:
"Your opportunity to be a RECOGNIZED EXPERT in the HPC Community" The SPEC High Performance Group is seeking candidates for a benchmark suite based on Message Passing Interface (MPI)...
24
by: Diwa | last post by:
Hi All, This is not a C++ technical question, hence this is an off-topic post. But it is C++ related and posted only to this group. Suppose, today a building like Empire State building or...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.