Skip to content

Commit f864edb

Browse files
committed
Initial commit
0 parents  commit f864edb

29 files changed

+417
-0
lines changed

Examples.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/HelloWorld.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using UnityEngine;
2+
using IronPython.Hosting;
3+
4+
namespace Exodrifter.UnityPython.Examples
5+
{
6+
public class HelloWorld : MonoBehaviour
7+
{
8+
void Start()
9+
{
10+
var engine = Python.CreateEngine();
11+
var scope = engine.CreateScope();
12+
13+
string code = "str = 'Hello world!'";
14+
15+
var source = engine.CreateScriptSourceFromString(code);
16+
source.Execute(scope);
17+
18+
Debug.Log(scope.GetVariable<string>("str"));
19+
}
20+
}
21+
}

Examples/HelloWorld.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/HelloWorldUnity.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using UnityEngine;
2+
3+
namespace Exodrifter.UnityPython.Examples
4+
{
5+
public class HelloWorldUnity : MonoBehaviour
6+
{
7+
void Start()
8+
{
9+
var engine = global::UnityPython.CreateEngine();
10+
var scope = engine.CreateScope();
11+
12+
string code = "import UnityEngine\n";
13+
code += "UnityEngine.Debug.Log('Hello world!')";
14+
15+
var source = engine.CreateScriptSourceFromString(code);
16+
source.Execute(scope);
17+
}
18+
}
19+
}

Examples/HelloWorldUnity.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IronPython-2.6.2.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
454 KB
Binary file not shown.

IronPython-2.6.2/IronPython.Modules.dll.meta

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IronPython-2.6.2/IronPython.dll

1.43 MB
Binary file not shown.

IronPython-2.6.2/IronPython.dll.meta

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)