3
3
[ ![ appveyor shield] [ ]] ( https://ci.appveyor.com/project/pythonnet/pythonnet/branch/master )
4
4
[ ![ travis shield] [ ]] ( https://travis-ci.org/pythonnet/pythonnet )
5
5
[ ![ codecov shield] [ ]] ( https://codecov.io/github/pythonnet/pythonnet )
6
+
6
7
[ ![ license shield] [ ]] ( ./LICENSE )
7
8
[ ![ pypi package version] [ ]] ( https://pypi.python.org/pypi/pythonnet )
8
9
[ ![ python supported shield] [ ]] ( https://pypi.python.org/pypi/pythonnet )
@@ -37,14 +38,14 @@ from System.Windows.Forms import Form
37
38
## Embedding Python in .NET
38
39
39
40
- All calls to python should be inside
40
- a ` using (Py.GIL()) {/_ Your code here _ /} ` block.
41
+ a ` using (Py.GIL()) {/* Your code here * /} ` block.
41
42
- Import python modules using ` dynamic mod = Py.Import("mod") ` ,
42
43
then you can call functions as normal, eg ` mod.func(args) ` .
43
44
- Use ` mod.func(args, Py.kw("keywordargname", keywordargvalue)) `
44
45
to apply keyword arguments.
45
46
- All python objects should be declared as ` dynamic ` type.
46
47
- Mathematical operations involving python and literal/managed types must
47
- have the python object first, eg ` np.pi_2 ` works, ` 2_np.pi ` doesn't.
48
+ have the python object first, eg. ` np.pi_2 ` works, ` 2_np.pi ` doesn't.
48
49
49
50
### Example
50
51
@@ -59,7 +60,7 @@ static void Main(string[] args)
59
60
Console .WriteLine (sin (5 ));
60
61
double c = np .cos (5 ) + sin (5 );
61
62
Console .WriteLine (c );
62
- /* this block is temporarily disabled due to regression
63
+ /* this block is temporarily disabled due to regression #249
63
64
dynamic a = np.array(new List<float> { 1, 2, 3 });
64
65
dynamic b = np.array(new List<float> { 6, 5, 4 }, Py.kw("dtype", np.int32));
65
66
Console.WriteLine(a.dtype);
83
84
84
85
[ appveyor shield ] : https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor
85
86
86
- [ codecov shield ] : https://img.shields.io/codecov/c/github/pythonnet/pythonnet/master.svg?label=codecov
87
+ [ codecov shield ] : https://img.shields.io/codecov/c/github/pythonnet/pythonnet/master.svg?label=Codecov
87
88
88
89
[ license shield ] : https://img.shields.io/badge/license-MIT-blue.svg?maxAge=3600
89
90
0 commit comments