| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,6 +55,7 @@ | |||
| 55 | 55 | - ([@civilx64](https://github.com/civilx64)) | |
| 56 | 56 | - ([@GSPP](https://github.com/GSPP)) | |
| 57 | 57 | - ([@omnicognate](https://github.com/omnicognate)) | |
| 58 | + - ([@OneBlue](https://github.com/OneBlue)) | ||
| 58 | 59 | - ([@rico-chet](https://github.com/rico-chet)) | |
| 59 | 60 | - ([@rmadsen-ks](https://github.com/rmadsen-ks)) | |
| 60 | 61 | - ([@stonebig](https://github.com/stonebig)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,14 +21,17 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. | |||
| 21 | 21 | - Catches exceptions thrown in C# iterators (yield returns) and rethrows them in python ([#475][i475])([#693][p693]) | |
| 22 | 22 | - Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger ([#443][i443])([#690][p690]) | |
| 23 | 23 | - Incorporated reference-style links to issues and pull requests in the CHANGELOG ([#608][i608]) | |
| 24 | + - Added PyObject finalizer support, Python objects referred by C# can be auto collect now ([#692][p692]). | ||
| 24 | 25 | - Added detailed comments about aproaches and dangers to handle multi-app-domains ([#625][p625]) | |
| 25 | 26 | - Python 3.7 support, builds and testing added. Defaults changed from Python 3.6 to 3.7 ([#698][p698]) | |
| 26 | 27 | ||
| 27 | 28 | ### Changed | |
| 28 | 29 | ||
| 30 | + - PythonException included C# call stack | ||
| 29 | 31 | - Reattach python exception traceback information (#545) | |
| 30 | 32 | - PythonEngine.Intialize will now call `Py_InitializeEx` with a default value of 0, so signals will not be configured by default on embedding. This is different from the previous behaviour, where `Py_Initialize` was called instead, which sets initSigs to 1. ([#449][i449]) | |
| 31 | 33 | - Refactored MethodBinder.Bind in preparation to make it extensible (#829) | |
| 34 | + - Look for installed Windows 10 sdk's during installation instead of relying on specific versions. | ||
| 32 | 35 | ||
| 33 | 36 | ### Fixed | |
| 34 | 37 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | MIT License | |
| 2 | 2 | ||
| 3 | - Copyright (c) 2006-2017 the contributors of the "Python for .NET" project | ||
| 3 | + Copyright (c) 2006-2019 the contributors of the "Python for .NET" project | ||
| 4 | 4 | ||
| 5 | 5 | Permission is hereby granted, free of charge, to any person obtaining a | |
| 6 | 6 | copy of this software and associated documentation files (the "Software"), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,113 @@ | |||
| 1 | + pythonnet - Python for .NET | ||
| 2 | + =========================== | ||
| 3 | + | ||
| 4 | + |Join the chat at https://gitter.im/pythonnet/pythonnet| | ||
| 5 | + | ||
| 6 | + |appveyor shield| |travis shield| |codecov shield| | ||
| 7 | + | ||
| 8 | + |license shield| |pypi package version| |python supported shield| | ||
| 9 | + |stackexchange shield| | ||
| 10 | + | ||
| 11 | + Python for .NET is a package that gives Python programmers nearly | ||
| 12 | + seamless integration with the .NET Common Language Runtime (CLR) and | ||
| 13 | + provides a powerful application scripting tool for .NET developers. It | ||
| 14 | + allows Python code to interact with the CLR, and may also be used to | ||
| 15 | + embed Python into a .NET application. | ||
| 16 | + | ||
| 17 | + Calling .NET code from Python | ||
| 18 | + ----------------------------- | ||
| 19 | + | ||
| 20 | + Python for .NET allows CLR namespaces to be treated essentially as | ||
| 21 | + Python packages. | ||
| 22 | + | ||
| 23 | + .. code-block:: | ||
| 24 | + | ||
| 25 | + import clr | ||
| 26 | + from System import String | ||
| 27 | + from System.Collections import * | ||
| 28 | + | ||
| 29 | + To load an assembly, use the ``AddReference`` function in the ``clr`` | ||
| 30 | + module: | ||
| 31 | + | ||
| 32 | + .. code-block:: | ||
| 33 | + | ||
| 34 | + import clr | ||
| 35 | + clr.AddReference("System.Windows.Forms") | ||
| 36 | + from System.Windows.Forms import Form | ||
| 37 | + | ||
| 38 | + Embedding Python in .NET | ||
| 39 | + ------------------------ | ||
| 40 | + | ||
| 41 | + - All calls to python should be inside a | ||
| 42 | + ``using (Py.GIL()) {/* Your code here */}`` block. | ||
| 43 | + - Import python modules using ``dynamic mod = Py.Import("mod")``, then | ||
| 44 | + you can call functions as normal, eg ``mod.func(args)``. | ||
| 45 | + - Use ``mod.func(args, Py.kw("keywordargname", keywordargvalue))`` or | ||
| 46 | + ``mod.func(args, keywordargname: keywordargvalue)`` to apply keyword | ||
| 47 | + arguments. | ||
| 48 | + - All python objects should be declared as ``dynamic`` type. | ||
| 49 | + - Mathematical operations involving python and literal/managed types | ||
| 50 | + must have the python object first, eg. ``np.pi * 2`` works, | ||
| 51 | + ``2 * np.pi`` doesn’t. | ||
| 52 | + | ||
| 53 | + Example | ||
| 54 | + ~~~~~~~ | ||
| 55 | + | ||
| 56 | + .. code-block:: csharp | ||
| 57 | + | ||
| 58 | + static void Main(string[] args) | ||
| 59 | + { | ||
| 60 | + using (Py.GIL()) | ||
| 61 | + { | ||
| 62 | + dynamic np = Py.Import("numpy"); | ||
| 63 | + Console.WriteLine(np.cos(np.pi * 2)); | ||
| 64 | + | ||
| 65 | + dynamic sin = np.sin; | ||
| 66 | + Console.WriteLine(sin(5)); | ||
| 67 | + | ||
| 68 | + double c = np.cos(5) + sin(5); | ||
| 69 | + Console.WriteLine(c); | ||
| 70 | + | ||
| 71 | + dynamic a = np.array(new List<float> { 1, 2, 3 }); | ||
| 72 | + Console.WriteLine(a.dtype); | ||
| 73 | + | ||
| 74 | + dynamic b = np.array(new List<float> { 6, 5, 4 }, dtype: np.int32); | ||
| 75 | + Console.WriteLine(b.dtype); | ||
| 76 | + | ||
| 77 | + Console.WriteLine(a * b); | ||
| 78 | + Console.ReadKey(); | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + Output: | ||
| 83 | + | ||
| 84 | + .. code:: | ||
| 85 | + | ||
| 86 | + 1.0 | ||
| 87 | + -0.958924274663 | ||
| 88 | + -0.6752620892 | ||
| 89 | + float64 | ||
| 90 | + int32 | ||
| 91 | + [ 6. 10. 12.] | ||
| 92 | + | ||
| 93 | + Information on installation, FAQ, troubleshooting, debugging, and | ||
| 94 | + projects using pythonnet can be found in the Wiki: | ||
| 95 | + | ||
| 96 | + https://github.com/pythonnet/pythonnet/wiki | ||
| 97 | + | ||
| 98 | + .. |Join the chat at https://gitter.im/pythonnet/pythonnet| image:: https://badges.gitter.im/pythonnet/pythonnet.svg | ||
| 99 | + :target: https://gitter.im/pythonnet/pythonnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
| 100 | + .. |appveyor shield| image:: https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor | ||
| 101 | + :target: https://ci.appveyor.com/project/pythonnet/pythonnet/branch/master | ||
| 102 | + .. |travis shield| image:: https://img.shields.io/travis/pythonnet/pythonnet/master.svg?label=Travis | ||
| 103 | + :target: https://travis-ci.org/pythonnet/pythonnet | ||
| 104 | + .. |codecov shield| image:: https://img.shields.io/codecov/c/github/pythonnet/pythonnet/master.svg?label=Codecov | ||
| 105 | + :target: https://codecov.io/github/pythonnet/pythonnet | ||
| 106 | + .. |license shield| image:: https://img.shields.io/badge/license-MIT-blue.svg?maxAge=3600 | ||
| 107 | + :target: ./LICENSE | ||
| 108 | + .. |pypi package version| image:: https://img.shields.io/pypi/v/pythonnet.svg | ||
| 109 | + :target: https://pypi.python.org/pypi/pythonnet | ||
| 110 | + .. |python supported shield| image:: https://img.shields.io/pypi/pyversions/pythonnet.svg | ||
| 111 | + :target: https://pypi.python.org/pypi/pythonnet | ||
| 112 | + .. |stackexchange shield| image:: https://img.shields.io/badge/StackOverflow-python.net-blue.svg | ||
| 113 | + :target: http://stackoverflow.com/questions/tagged/python.net | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,10 @@ | |||
| 1 | 1 | package: | |
| 2 | 2 | name: pythonnet | |
| 3 | - version: "2.4.0.dev0" | ||
| 3 | + version: {{ GIT_DESCRIBE_VERSION }} | ||
| 4 | 4 | ||
| 5 | 5 | build: | |
| 6 | 6 | skip: True # [not win] | |
| 7 | - number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} | ||
| 7 | + number: {{ GIT_DESCRIBE_NUMBER }} | ||
| 8 | 8 | {% if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' %}string: py{{ environ.get('PY_VER').replace('.', '') }}_0 | |
| 9 | 9 | {% else %}string: py{{ environ.get('PY_VER').replace('.', '') }}_{{ environ.get('GIT_BUILD_STR', 'GIT_STUB') }}{% endif %} | |
| 10 | 10 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments