473,769 Members | 3,923 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 2968
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
4662
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
1662
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
5275
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 documents that show you how to do this? The tutorial on the W3C site is too elementary for me. ...
2
2174
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 email to Alan). I've tried wrapping each section in its own fieldset, but that had no effect.
6
3669
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 divs and paragraphs on a specific page and the style applied is specific to that one page? ...
5
1113
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
11039
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 the module, the following message appears:
2
1671
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 their programs will influence future designs of computer hardware and software. For example the...
24
2066
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
10049
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.