|
2 | 2 | OMPython |
3 | 3 | ######## |
4 | 4 |
|
5 | | -OMPython is a Python interface that uses CORBA (omniORB) or ZeroMQ to communicate with OpenModelica. |
| 5 | +OMPython is a Python interface that uses ZeroMQ or CORBA (omniORB) to communicate with OpenModelica. |
6 | 6 |
|
7 | 7 | Dependencies |
8 | 8 | ============ |
9 | 9 |
|
10 | | -Using omniORB (Python 2 only) |
11 | | ------------------------------ |
| 10 | +Using ZeroMQ |
| 11 | +------------ |
| 12 | +- Python 2.7 and 3.x supported |
| 13 | +- PyZMQ is required |
12 | 14 |
|
13 | | -- Python 2.7 is required (omniORB restriction). Download Python from http://www.python.org/download/ |
14 | | -- omniORB is required |
15 | | - - Windows: included in the installer of OpenModelica |
16 | | - - Linux: Install omniORB including Python 2 support (the omniidl command needs to be on the PATH) |
17 | | - On Ubuntu, this is done by running `sudo apt-get install omniorb python-omniorb omniidl omniidl-python` |
18 | | -- Installation using `pip` is recommended. |
| 15 | +Using omniORB |
| 16 | +------------- |
| 17 | +- Currently, only Python 2.7 is supported |
| 18 | +- omniORB is required: |
| 19 | + - Windows: included in the OpenModelica installation |
| 20 | + - Linux: Install omniORB including Python 2 support (the omniidl command needs to be on the PATH). |
| 21 | + On Ubuntu, this is done by running ``sudo apt-get install omniorb python-omniorb omniidl omniidl-python`` |
19 | 22 |
|
20 | | -Using ZeroMQ (Python 2 and 3 supported) |
21 | | ---------------------------------------- |
22 | | - |
23 | | -- Python 2.7 or 3.x.x is required. Download Python from http://www.python.org/download/ |
24 | | -- PyZMQ is required. |
25 | | -- Installation using `pip` is recommended. |
26 | 23 |
|
27 | 24 | Installation |
28 | 25 | ============ |
| 26 | +Installation using ``pip`` is recommended. |
29 | 27 |
|
30 | 28 | Linux |
31 | 29 | ----- |
| 30 | +Install the latest OMPython master by running:: |
32 | 31 |
|
33 | | -```bash |
34 | | -$ python -m pip install https://github.com/OpenModelica/OMPython/archive/master.zip |
35 | | -``` |
| 32 | + python -m pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip |
36 | 33 |
|
37 | 34 | Windows |
38 | 35 | ------- |
| 36 | +Install the version as packaged with your OpenModelica installation by running:: |
39 | 37 |
|
40 | | -- Add python to your PATH. |
41 | | -- Start command prompt/terminal and execute commands, |
42 | | -```powershell |
43 | | -> cd %OPENMODELICAHOME%\share\omc\scripts\PythonInterface |
44 | | -> python -m pip install . |
45 | | -``` |
46 | | -- This will add OMPython to the Python 3rd party libraries. |
| 38 | + cd %OPENMODELICAHOME%\share\omc\scripts\PythonInterface |
| 39 | + python -m pip install . |
47 | 40 |
|
48 | 41 | Usage |
49 | 42 | ===== |
| 43 | +Running the following commads should get you started |
| 44 | + |
| 45 | +.. code-block:: python |
| 46 | +
|
| 47 | + import OMPython |
| 48 | + help(OMPython) |
50 | 49 |
|
51 | | -```python |
52 | | -import OMPython |
53 | | -help(OMPython) |
54 | | -``` |
| 50 | +or read the `OMPython documentation <https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/ompython.html>`_ online. |
55 | 51 |
|
56 | 52 | Bug Reports |
57 | 53 | =========== |
58 | 54 |
|
59 | | -- See OMPython bugs on the [OpenModelica trac](https://trac.openmodelica.org/OpenModelica/query?component=OMPython) or submit a [new ticket](https://trac.openmodelica.org/OpenModelica/newticket). |
60 | | -- [Pull requests](../../pulls) are welcome. |
| 55 | +- See OMPython bugs on the `OpenModelica trac <https://trac.openmodelica.org/OpenModelica/query?component=OMPython>`_ |
| 56 | + or submit a `new ticket <https://trac.openmodelica.org/OpenModelica/newticket>`_. |
| 57 | +- `Pull requests <https://github.com/OpenModelica/OMPython/pulls>`_ are welcome. |
61 | 58 |
|
62 | 59 | Contact |
63 | 60 | ======= |
64 | 61 |
|
65 | | -Adeel Asghar, adeel.asghar@liu.se<br /> |
66 | | -Arunkumar Palanisamy, arunkumar.palanisamy@liu.se |
| 62 | +- Adeel Asghar, adeel.asghar@liu.se |
| 63 | +- Arunkumar Palanisamy, arunkumar.palanisamy@liu.se |
0 commit comments