source: git/dyn_modules/python.mod @ f0f0cea

spielwiese
Last change on this file since f0f0cea was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 820 bytes
Line 
1%{
2/*
3 *
4 *  Python module
5 */
6
7#include <stdio.h>
8#include <stdlib.h>
9#include <string.h>
10#include <time.h>
11#include <Python.h>
12#include <wrapper.h>
13
14void mbpython(char* in);
15%}
16
17// some comments here
18
19category="tests";
20package="python_module";
21version = "$Id$";
22info    ="LIBRARY: kernel.lib  PROCEDURES OF GENERAL TYPE WRITEN IN C python(input); eval a string  in python";
23//files= wrapper.cc;
24%modinitial
25  Py_Initialize();
26  initSingular();
27  init_Singular();
28
29%endinitial
30
31%procedures
32/*
33 * NAME:     python
34 *           procedure without string as parameter and no return val
35 * PURPOSE:  interprets the string in python
36 */
37none python(string a)
38{
39  %declaration;
40  %typecheck;
41  mbpython(a);
42  %return();
43}
44example
45{
46  python("print 1+1");
47}
48
49
50
51%%
52%C
53
54void mbpython(char* inp){
55
56  PyRun_SimpleString(inp);
57
58
59}
60
61
62
Note: See TracBrowser for help on using the repository browser.