forked from fkarb/pythonnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclrpython.c
More file actions
29 lines (26 loc) · 1.01 KB
/
clrpython.c
File metadata and controls
29 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// ==========================================================================
// This software is subject to the provisions of the Zope Public License,
// Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
// THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
// WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
// FOR A PARTICULAR PURPOSE.
// ==========================================================================
//
// Example how to integrate Python, PythonNet and Mono into a C application
// It provides a command prompt equal to PythonNet's console but using a
// different path.
//
// Author: Christian Heimes <christian(at)cheimes(dot)de>
//
#include "pynetclr.h"
int main(int argc, char **argv) {
PyNet_Args *pn_args;
pn_args = PyNet_Init(0);
if (pn_args->error) {
exit(1);
}
int rc = Py_Main(argc, argv);
PyNet_Finalize(pn_args);
exit(rc);
}