473,545 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

where to find the spec of format in PyObject_CallMe thod

I am trying to use PyObject_CallMe thod. 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 2956
On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote:
I am trying to use PyObject_CallMe thod. 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_CallMe thodObjArgs is a faster
alternative."

So, If all your arguments are PyObject pointers, use
PyObject_CallMe thodObjArgs instead. Otherwise, use PyObject_CallMe thod
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...@uniqsy s.comwrote:
On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote:
I am trying to use PyObject_CallMe thod. 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_CallMe thodObjArgs is a faster
alternative."

So, If all your arguments are PyObject pointers, use
PyObject_CallMe thodObjArgs instead. Otherwise, use PyObject_CallMe thod
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
4609
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 declare self. Let's say my python file is called stuff.py and is like the following, doMath() is defined in stuff.py and is not part of any class:
2
1657
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 spec.
2
5264
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 about everyone else I suppose). That also makes Hotdog ver 6.5 and "Using htnl 4" by Molly Holzschlag Publ Que instantly out-of-date! Where are the...
2
2165
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 section. I can't find anything in the 4.0 spec about how to do this, and the only mention in this group I found is from 1998 below (CERN blocked my...
6
3662
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 of things? I have a linked style sheet that covers everything I want to do globally. What should be done if I want to change and/or add a couple of...
5
1104
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 site.
5
11010
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 setting stDataSource and stFileName to the desired values. Most of the time it works, but occasionally, typically as code changes are being made to...
2
1661
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) applications. Successful submitters will be rewarded with a free license for the benchmark suite, recognized on the SPEC website and in media materials, and...
24
2033
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 Petronas Towers is to be built. The architect designing and the company/team building this would be somebody who is an
0
7484
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7415
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3470
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
726
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.