File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,15 +3,14 @@ pythonnet
33
44This fork of http://sourceforge.net/projects/pythonnet/ allows easy calling of python functions from C#.
55
6- All calls to python should be inside a "using (Py.GIL()) {/* Your code here * /}" block.
7- Import python modules using dynamic mod = Py.Import("mod"), then you can call functions as normal, eg
8- mod.func(args).
9- Use mod.func(args, Py.kw("keywordargname", keywordargvalue)) to apply keyword arguments.
10- All python objects should be declared as 'dynamic' type.
11- Mathematical operations involving python and literal/managed types must have the python object first, eg np.pi* 2 works, 2* np.pi doesn't.
6+ + All calls to python should be inside a "using (Py.GIL()) {/* Your code here * /}" block.
7+ + Import python modules using dynamic mod = Py.Import("mod"), then you can call functions as normal, eg mod.func(args).
8+ + Use mod.func(args, Py.kw("keywordargname", keywordargvalue)) to apply keyword arguments.
9+ + All python objects should be declared as 'dynamic' type.
10+ + Mathematical operations involving python and literal/managed types must have the python object first, eg np.pi* 2 works, 2* np.pi doesn't
1211
1312EG:
14-
13+ ``` csharp
1514static void Main (string [] args )
1615{
1716 using (Py .GIL ()) {
@@ -28,12 +27,13 @@ static void Main(string[] args)
2827 Console .ReadKey ();
2928 }
3029}
31-
32- which outputs:
33-
34- 1.0
30+ ```
31+ outputs :
32+ ```
33+ 1 . 0
3534- 0 . 958924274663
3635- 0 . 6752620892
3736float64
3837int32
3938[ 6 . 10 . 12 .]
39+ ```
You can’t perform that action at this time.
0 commit comments