Created
December 4, 2015 11:28
-
-
Save ch-hristov/770558a47b26aebff7a9 to your computer and use it in GitHub Desktop.
IronPython example
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
var engine = Python.CreateEngine(); | |
var scope = engine.CreateScope(); | |
scope.SetVariable("mol", new SmilesParser()); | |
string script = "import clr\nk = mol.ParseMolecule(\"CCCCCC\")\nr = k.Count"; | |
ScriptSource ss = engine.CreateScriptSourceFromString(script); | |
ss.Execute(scope); | |
var variable = scope.GetVariable("r"); | |
MessageBox.Show(variable.ToString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment