1
- # Python for .NET
1
+ # Python.NET
2
2
3
- Python for .NET (` pythonnet ` ) is a package that gives Python programmers
3
+ Python.NET (` pythonnet ` ) is a package that gives Python programmers
4
4
nearly seamless integration with the .NET 4.0+ Common Language Runtime
5
- (CLR) on Windows and Mono runtime on Linux and OSX. Python for .NET
5
+ (CLR) on Windows and Mono runtime on Linux and OSX. Python.NET
6
6
provides a powerful application scripting tool for .NET developers.
7
7
Using this package you can script .NET applications or build entire
8
8
applications in Python, using .NET services and components written in
@@ -17,22 +17,22 @@ speeds for Python code. If you are interested in a pure managed-code
17
17
implementation of the Python language, you should check out the
18
18
[ IronPython] [ 1 ] project, which is in active development.
19
19
20
- Python for .NET is currently compatible and tested with Python releases
21
- 2.7 and 3.5-3.7 .
22
- Current releases are available at the [ Python for .NET website] [ 2 ] .
23
- To subscribe to the [ Python for .NET mailing list] [ 3 ] or read the
20
+ Python.NET is currently compatible and tested with Python releases
21
+ 2.7 and 3.5-3.8 .
22
+ Current releases are available at the [ Python.NET website] [ 2 ] .
23
+ To subscribe to the [ Python.NET mailing list] [ 3 ] or read the
24
24
[ online archives] [ 4 ] of the list, see the [ mailing list information] [ 3 ]
25
- page. Use the [ Python for .NET issue tracker] [ 55 ] to report issues.
25
+ page. Use the [ Python.NET issue tracker] [ 55 ] to report issues.
26
26
27
- - This page provides a detailed overview of Python for .NET,
27
+ - This page provides a detailed overview of Python.NET,
28
28
as well as some basic usage examples. Many other examples can be
29
29
found in the demos and unit tests for the package.
30
30
- Checkout the [ PythonNet] [ 77 ] code from github.
31
31
- [ Download releases] [ 6 ] for various versions of Python and CLR.
32
32
33
33
## Installation
34
34
35
- Python for .NET is available as a source release on [ GitHub] [ 5 ] and as a
35
+ Python.NET is available as a source release on [ GitHub] [ 5 ] and as a
36
36
binary wheel distribution for all supported versions of Python and the
37
37
common language runtime from the [ Python Package Index] [ 6 ] .
38
38
@@ -53,12 +53,12 @@ may be problems.
53
53
54
54
## Getting Started
55
55
56
- A key goal for this project has been that Python for .NET should
56
+ A key goal for this project has been that Python.NET should
57
57
"work just the way you'd expect in Python", except for cases that are
58
58
.NET specific (in which case the goal is to work "just the way
59
59
you'd expect in C#"). In addition, with the IronPython project having
60
60
established a community, it is my goal that code written for IronPython
61
- run without modification under Python for .NET.
61
+ run without modification under Python.NET.
62
62
63
63
If you already know Python, you can probably finish this readme and then
64
64
refer to .NET docs to figure out anything you need to do. Conversely if
@@ -73,7 +73,7 @@ source directory of the distribution that can be helpful as examples.
73
73
74
74
## Importing Modules
75
75
76
- Python for .NET allows CLR namespaces to be treated essentially as
76
+ Python.NET allows CLR namespaces to be treated essentially as
77
77
Python packages.
78
78
79
79
``` python
@@ -90,20 +90,20 @@ clr.AddReference("System.Windows.Forms")
90
90
from System.Windows.Forms import Form
91
91
```
92
92
93
- ** Note** Earlier releases of Python for .NET relied on "implicit loading"
93
+ ** Note** Earlier releases of Python.NET relied on "implicit loading"
94
94
to support automatic loading of assemblies whose names corresponded to an
95
95
imported namespace. Implicit loading still works for backward compatibility,
96
96
but will be removed in a future release so it is recommended to use
97
97
the ` clr.AddReference ` method.
98
98
99
- Python for .NET uses the PYTHONPATH (sys.path) to look for assemblies
99
+ Python.NET uses the PYTHONPATH (sys.path) to look for assemblies
100
100
to load, in addition to the usual application base and the GAC. To ensure
101
101
that you can implicitly import an assembly, put the directory containing
102
102
the assembly in ` sys.path ` .
103
103
104
104
## Using Classes
105
105
106
- Python for .NET allows you to use any non-private classes, structs,
106
+ Python.NET allows you to use any non-private classes, structs,
107
107
interfaces, enums or delegates from Python. To create an instance of a
108
108
managed class, you use the standard instantiation syntax, passing a set
109
109
of arguments that match one of its public constructors:
@@ -114,7 +114,7 @@ from System.Drawing import Point
114
114
p = Point(5 , 5 )
115
115
```
116
116
117
- In most cases, Python for .NET can determine the correct constructor to
117
+ In most cases, Python.NET can determine the correct constructor to
118
118
call automatically based on the arguments. In some cases, it may be necessary
119
119
to call a particular overloaded constructor, which is supported by a special
120
120
` __overloads__ ` attribute, which will soon be deprecated in favor of
@@ -229,7 +229,7 @@ help(Environment)
229
229
230
230
## Overloaded and Generic Methods
231
231
232
- While Python for .NET will generally be able to figure out the right
232
+ While Python.NET will generally be able to figure out the right
233
233
version of an overloaded method to call automatically, there are cases
234
234
where it is desirable to select a particular method overload explicitly.
235
235
@@ -384,7 +384,7 @@ the PythonNet assembly directory or on the PYTHONPATH in order to load them.
384
384
385
385
## Type Conversion
386
386
387
- Type conversion under Python for .NET is fairly straightforward - most
387
+ Type conversion under Python.NET is fairly straightforward - most
388
388
elemental Python types (string, int, long, etc.) convert automatically to
389
389
compatible managed equivalents (String, Int32, etc.) and vice-versa.
390
390
Note that all strings returned from the CLR are returned as unicode.
@@ -402,7 +402,7 @@ value type object to be created on the heap, which then has reference
402
402
type semantics.
403
403
404
404
Understanding boxing and the distinction between value types and reference
405
- types can be important when using Python for .NET because the Python
405
+ types can be important when using Python.NET because the Python
406
406
language has no value type semantics or syntax - in Python
407
407
"everything is a reference".
408
408
@@ -468,7 +468,7 @@ differences between value types and reference types.
468
468
469
469
## Embedding Python
470
470
471
- ** Note:** because Python code running under Python for .NET is inherently
471
+ ** Note:** because Python code running under Python.NET is inherently
472
472
unverifiable, it runs totally under the radar of the security infrastructure
473
473
of the CLR so you should restrict use of the Python assembly to trusted code.
474
474
@@ -494,7 +494,7 @@ call objects in a module you import.
494
494
495
495
For general-purpose information on embedding Python in applications,
496
496
use www.python.org or Google to find (C) examples. Because
497
- Python for .NET is so closely integrated with the managed environment,
497
+ Python.NET is so closely integrated with the managed environment,
498
498
you will generally be better off importing a module and deferring to
499
499
Python code as early as possible rather than writing a lot of managed
500
500
embedding code.
@@ -582,20 +582,24 @@ using (Py.GIL())
582
582
583
583
## License
584
584
585
- Python for .NET is released under the open source MIT License.
585
+ Python.NET is released under the open source MIT License.
586
586
A copy of the license is included in the distribution,
587
587
or you can find a copy of the [ license online] [ 9 ] .
588
588
589
589
Some distributions of this package include a copy of the C Python dlls and
590
590
standard library, which are covered by the [ Python license] [ 10 ] .
591
591
592
+ ## .NET Foundation
593
+
594
+ This project is supported by the [ .NET Foundation] ( https://dotnetfoundation.org ) .
595
+
592
596
[ 1 ] : http://www.ironpython.com
593
597
594
598
[ 2 ] : http://pythonnet.github.io/
595
599
596
- [ 3 ] : http ://mail.python.org/mailman/listinfo/pythondotnet
600
+ [ 3 ] : https ://mail.python.org/mailman3/lists/pythonnet.python.org/
597
601
598
- [ 4 ] : http ://mail.python.org/pipermail/pythondotnet /
602
+ [ 4 ] : https ://mail.python.org/archives/list/pythonnet@python.org /
599
603
600
604
[ 5 ] : https://github.com/pythonnet/pythonnet/releases
601
605
0 commit comments