source: git/dyn_modules/python.mod @ 5e7ae8

spielwiese
Last change on this file since 5e7ae8 was 3c473c, checked in by Kai Krüger <krueger@…>, 14 years ago
rename directory modules to dyn_modules anticipating "modules" directory for cmake. git-svn-id: file:///usr/local/Singular/svn/trunk@13033 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 829 bytes
Line 
1%{
2/*
3 *  $Id$
4 *
5 *  Python module
6 */
7
8#include <stdio.h>
9#include <stdlib.h>
10#include <string.h>
11#include <time.h>
12#include <Python.h>
13#include <wrapper.h>
14
15void mbpython(char* in);
16%}
17
18// some comments here
19
20category="tests";
21package="python_module";
22version = "$Id$";
23info    ="LIBRARY: kernel.lib  PROCEDURES OF GENERAL TYPE WRITEN IN C python(input); eval a string  in python";
24//files= wrapper.cc;
25%modinitial
26  Py_Initialize();
27  initSingular();
28  init_Singular();
29
30%endinitial
31
32%procedures
33/*
34 * NAME:     python
35 *           procedure without string as parameter and no return val
36 * PURPOSE:  interprets the string in python
37 */
38none python(string a)
39{
40  %declaration;
41  %typecheck;
42  mbpython(a);
43  %return();
44}
45example
46{
47  python("print 1+1");
48}
49
50
51
52%%
53%C
54
55void mbpython(char* inp){
56
57  PyRun_SimpleString(inp);
58
59
60}
61
62
63
Note: See TracBrowser for help on using the repository browser.