Created
October 12, 2011 22:55
-
-
Save 3v1n0/1282891 to your computer and use it in GitHub Desktop.
A simple test to use python code from Vala
This file contains 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
[CCode (lower_case_cprefix = "Py_", cheader_filename = "Python.h")] | |
namespace Python | |
{ | |
public void Initialize (); | |
public void Finalize (); | |
[CCode (lower_case_cprefix = "PyRun_")] | |
namespace Run | |
{ | |
public void SimpleString (string @string); | |
} | |
} |
This file contains 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
/* Compile with valac --vapidir=. --pkg python pyvala.vala */ | |
using Python; | |
void main() { | |
Python.Initialize(); | |
Run.SimpleString("print 'hello from python!'"); | |
Python.Finalize(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment