Hi,
I'm working right from the example here to make a basic extenstion
module. http://docs.python.org/ext/intro.html http://www.dalkescientific.com/writi...ng_python.html
I can load my module into python and dir shows my function. But I get
a syntax error if I try to access it. ast_man.exec
File "<stdin>", line 1
ast_man.exec
^
SyntaxError: invalid syntax
However, I can get at it using getattr. I tried compiling myself and
using setup. My method is defined as
static PyMethodDef ast_man_methods[] = {
{"exec",exec,ME TH_VARARGS,"Exe cute Asterisk commands."},
{NULL,NULL,0,NU LL}
};
What might be my problem??
thanks 1 1665
Todd wrote: I'm working right from the example here to make a basic extenstion module. http://docs.python.org/ext/intro.html http://www.dalkescientific.com/writi...ng_python.html
I can load my module into python and dir shows my function. But I get a syntax error if I try to access it.
ast_man.exec File "<stdin>", line 1 ast_man.exec ^ SyntaxError: invalid syntax
However, I can get at it using getattr. I tried compiling myself and using setup. My method is defined as
static PyMethodDef ast_man_methods[] = { {"exec",exec,ME TH_VARARGS,"Exe cute Asterisk commands."}, {NULL,NULL,0,NU LL} };
What might be my problem??
exec is a reserved word. exec 'print 1'
1 exec = 1
File "<stdin>", line 1
exec = 1
^
SyntaxError: invalid syntax
--
Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
We have lingered long enough on the shores of the cosmic ocean.
-- Carl Sagan, 1934-1996 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dario Gonzalez |
last post by:
Hi all,
I've just finished my first dynamically-loadable-cpp-implemented PHP
extension and now I need to know how to call a userland PHP function
from inside the extension. I need to use Headers() to be able to
download a file that is generated by my extension. So far I've used this
function from the php-script that uses my extension, but I'd like to
embed this functionallity into it.
I've searched the php-sources to see the...
|
by: Michael Strorm |
last post by:
Hi,
I'm using PHP 4.3.9 with Apache 2.0, and keep getting the error
" PHP Fatal error: Call to undefined function:
domxml_open_file() in /var/www/html/php/domtest.php on line 8" (from
the Apache error log).
Here's the page itself:-
|
by: Adam Warner |
last post by:
Hello all,
I'm very new to C but I have a number of years of Common Lisp programming
experience. I'm trying to figure out ways of translating higher order
concepts such as closures into C. The code will not be idiomatic C.
GCC has an extension to ISO C that permits nested functions:
<http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html>
For implementing closures they have a serious limitation:
|
by: SStory |
last post by:
Hi all,
I really needed to get the icons associated with each file that I want to
show in a listview.
I used the follow modified code sniplets found on the internet.
I have left in commented code for anyone else who may be looking to do the
same.
|
by: Marek |
last post by:
Hi
I'm trying to call a native C++ dll using the following code (both C# and
C++ code segments included). When I make the call to the method
(AddTwoDoubles) that has no return value all is fine. When I try and call a
function that returns a double (AddTwoDoubles2) I get the following message:
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'tempModule!<Module>::AddTwoDoubles2'
has unbalanced the stack. This is...
| |
by: Fuzzyman |
last post by:
What gives ?
>>> a =
>>> def f():
return a
>>> f()
>>> a.append(3)
>>> f()
|
by: Jarle Aase |
last post by:
Hi,
I wrote a multilanguage cms system a few years ago. Different languages are
handled by loading php-files where each language-specific string is
assigned to a normal php-variable ($LNG array).
This loading takes place for each request.
Now I'm developing a backend server in C++ that will allow some better
security-checking, session management and caching. The backend server has a
|
by: tomb |
last post by:
Can anybody help me by checking if I have correct call signatures?
In my C# Windows Form project (VS2008) I am using dll which has been
written for Visual C++ 6.0:
This function code is used to start receive active message of ioLogik
2000 Ethernet Module:
C/C++
int Message2K_Start( int iProtocol, WORD wPort, pfnCALLBACK&
iProcAddress);
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |