@@ -133,14 +133,14 @@ <h1>Python for .NET</h1>
133
133
< p > Note that this package does < em > not</ em > implement Python as a
134
134
first-class CLR language - it does not produce managed code (IL)
135
135
from Python code. Rather, it is an integration of the CPython
136
- engine with the .NET or Mono runtime. This approach allows you to use use
136
+ engine with the .NET or Mono runtime. This approach allows you to use
137
137
CLR services and continue to use existing Python code and C-API
138
138
extensions while maintaining native execution speeds for Python
139
139
code. If you are interested in a pure managed-code implementation
140
140
of the Python language, you should check out the < a href ="http://www.ironpython.com "> IronPython</ a >
141
141
project, which is in active development.
142
142
</ p >
143
- < p > Python for .NET is currently compatible with Python releases 2.7, 3.3, 3.4, and 3.5 .
143
+ < p > Python for .NET is currently compatible and tested with Python releases 2.7, 3.3, 3.4, 3.5, and 3.6 .
144
144
Current releases are available at the < a href ="http://pythonnet.github.io/ ">
145
145
Python for .NET website </ a > . To subscribe to the < a href ="http://mail.python.org/mailman/listinfo/pythondotnet ">
146
146
Python for .NET mailing list </ a > or read the < a href ="http://mail.python.org/pipermail/pythondotnet/ ">
@@ -161,8 +161,8 @@ <h2>Installation</h2>
161
161
Once you start up Python or IPython interpreter in this directory or
162
162
append this directory to < strong > sys.path</ strong > ,
163
163
then after < strong > import clr</ strong > statement .NET assemblies can be used.
164
- You can also run npython .exe to check how python can be embedded
165
- in console .NET application.
164
+ You can also run < strong > nPython .exe</ strong > ( < strong > mono nPython.exe </ strong > on *nix)
165
+ to check how python can be embedded in console .NET application.
166
166
Note that the source release does not include a copy of the CPython runtime,
167
167
so you will need to have installed Python on your machine before using
168
168
the source release.
@@ -339,7 +339,7 @@ <h2>Using Methods</h2>
339
339
</ p >
340
340
< pre > from System import Environment
341
341
342
- print Environment.GetFolderPath.__doc__
342
+ print( Environment.GetFolderPath.__doc__)
343
343
344
344
help(Environment)
345
345
</ pre >
@@ -375,7 +375,7 @@ <h2>Delegates And Events</h2>
375
375
callable when it is called:
376
376
</ p >
377
377
< pre > def my_handler(source, args):
378
- print 'my_handler called!'
378
+ print( 'my_handler called!')
379
379
380
380
# instantiate a delegate
381
381
d = AssemblyLoadEventHandler(my_handler)
@@ -401,7 +401,7 @@ <h2>Delegates And Events</h2>
401
401
way very similar to the C# idiom:
402
402
</ p >
403
403
< pre > def handler(source, args):
404
- print 'my_handler called!'
404
+ print( 'my_handler called!')
405
405
406
406
# register event handler
407
407
object.SomeEvent += handler
@@ -421,9 +421,9 @@ <h2>Exception Handling</h2>
421
421
422
422
try:
423
423
raise NullReferenceException("aiieee!")
424
- except NullReferenceException, e:
425
- print e.Message
426
- print e.Source
424
+ except NullReferenceException as e:
425
+ print( e.Message)
426
+ print( e.Source)
427
427
</ pre >
428
428
< p > </ p >
429
429
< a name ="arrays "> </ a >
@@ -577,13 +577,16 @@ <h2>Embedding Python</h2>
577
577
</ p >
578
578
< p > The Python runtime assembly defines a number of public classes
579
579
that provide a subset of the functionality provided by the Python
580
- C API.
581
- </ p >
582
- < p > These classes include PyObject, PyList, PyDict, etc. The source
583
- and the unit tests are currently the only API documentation.. The
584
- rhythym is very similar to using Python C++ wrapper solutions such
585
- as CXX.
580
+ C-API.
586
581
</ p >
582
+ < p > These classes include PyObject, PyList, PyDict, PyTuple, etc.
583
+ You can review the nPython.exe source code in in "Console.csproj" project
584
+ for example of embedding CPython in console .NET app.
585
+ Please refer to this README GitHub page for new simplified embedding API:
586
+ </ p >
587
+ < p >
588
+ < a href ="https://github.com/pythonnet/pythonnet/blob/master/README.md "> README.md </ a >
589
+ </ p >
587
590
< p > At a very high level, to embed Python in your application you
588
591
will need to:
589
592
</ p >
@@ -607,7 +610,7 @@ <h2>Embedding Python</h2>
607
610
free-threaded and uses a global interpreter lock to allow
608
611
multi-threaded applications to interact safely with the Python
609
612
interpreter. Much more information about this is available in the
610
- Python C API documentation on the www.python.org Website.
613
+ Python C- API documentation on the www.python.org Website.
611
614
</ p >
612
615
< p > When embedding Python in a managed application, you have to
613
616
manage the GIL in just the same way you would when embedding
0 commit comments