Created
July 30, 2016 21:15
-
-
Save ChadSki/e829947484c0f90346c336fd386d274a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace CPythonBinding | |
{ | |
class Program | |
{ | |
[DllImport("python34.dll")] | |
public static extern void Py_Initialize(); | |
[DllImport("python34.dll", CallingConvention=CallingConvention.Cdecl)] | |
public static extern int PyRun_SimpleString([MarshalAs(UnmanagedType.LPStr)]string toRun); | |
static void Main(string[] args) | |
{ | |
Py_Initialize(); | |
PyRun_SimpleString("print('yolo')"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment