Skip to content

Commit dd2dcd0

Browse files
committed
Update README.md
Update prior to merging back into the main repo.
1 parent 1ee7031 commit dd2dcd0

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
pythonnet
22
=========
33

4-
Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers.
4+
Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. It allows Python code to interact with the CLR, and may also be used to embed Python into a .NET application.
55

6-
[![Build status](https://ci.appveyor.com/api/projects/status/u3p6pkiqpgu0qoku/branch/python3)](https://ci.appveyor.com/project/TonyRoberts/pythonnet/branch/python3)
6+
[![Build Status](https://travis-ci.org/pythonnet/pythonnet.png?branch=master)](https://travis-ci.org/pythonnet/pythonnet)
77

8-
[![Build Status](https://travis-ci.org/renshawbay/pythonnet.png?branch=python3)](https://travis-ci.org/renshawbay/pythonnet)
8+
[![Build status](https://ci.appveyor.com/api/projects/status/c8k0miljb3n1c7be/branch/master)](https://ci.appveyor.com/project/TonyRoberts/pythonnet-480xs)
99

10-
**Features not yet integrated into the main branch**:
11-
- Python 3 support
12-
- Subclassing managed types in Python
10+
**Calling .NET code from Python**
1311

14-
--------------------------------------------------------------------------------------------------------
12+
Python for .NET allows CLR namespaces to be treated essentially as Python packages.
13+
14+
```python
15+
import clr
16+
from System import String
17+
from System.Collections import *
18+
```
19+
To load an assembly, use the "AddReference" function in the "clr" module:
20+
21+
```python
22+
import clr
23+
clr.AddReference("System.Windows.Forms")
24+
from System.Windows.Forms import Form
25+
```
26+
27+
**Embedding Python in .NET**
1528

1629
+ All calls to python should be inside a "using (Py.GIL()) {/* Your code here */}" block.
1730
+ Import python modules using dynamic mod = Py.Import("mod"), then you can call functions as normal, eg mod.func(args).

0 commit comments

Comments
 (0)