Difference between revisions of "Python"
From ONELAB
Line 3: | Line 3: | ||
= Getting started = | = Getting started = | ||
− | # Download and uncompress a recent version of Gmsh, or the Gmsh/GetDP bundle for [http://onelab.info/files/gmsh-getdp-Windows64.zip Windows64], [http://onelab.info/files/gmsh-getdp-Windows32.zip Windows32], [http://onelab.info/files/gmsh-getdp-Linux64.zip Linux64], [http://onelab.info/files/gmsh-getdp-Linux32.zip Linux32] or [http://onelab.info/files/gmsh-getdp-MacOSX.zip MacOSX]. These builds contain the '''onelab.py''' module pre-installed in the same directory as the Gmsh executable. | + | # Download and uncompress a recent version of Gmsh, or the Gmsh/GetDP bundle for [http://onelab.info/files/gmsh-getdp-Windows64.zip Windows64], [http://onelab.info/files/gmsh-getdp-Windows32.zip Windows32], [http://onelab.info/files/gmsh-getdp-Linux64.zip Linux64], [http://onelab.info/files/gmsh-getdp-Linux32.zip Linux32] or [http://onelab.info/files/gmsh-getdp-MacOSX.zip MacOSX]. These builds contain the '''onelab.py''' module pre-installed in the same directory as the Gmsh executable. If '''onelab.py''' is not in the same directory as the Gmsh executable, you will need to configure your '''PYTHONPATH''' accordingly. |
# Double-click on the Gmsh executable ('''gmsh.exe''' [[File:GmshIcon.png|GmshIcon.png]] on Windows). | # Double-click on the Gmsh executable ('''gmsh.exe''' [[File:GmshIcon.png|GmshIcon.png]] on Windows). | ||
# Load one Python script ('''.py''' file) through the '''File/Open''' menu, e.g. [http://onelab.info/files/pendulum/pend.py pend.py]. | # Load one Python script ('''.py''' file) through the '''File/Open''' menu, e.g. [http://onelab.info/files/pendulum/pend.py pend.py]. | ||
# Click on '''Run'''. | # Click on '''Run'''. | ||
# ... that's it! | # ... that's it! |
Revision as of 06:21, 29 May 2013
Any Python script can become a native ONELAB client by importing the onelab.py module.
Getting started
- Download and uncompress a recent version of Gmsh, or the Gmsh/GetDP bundle for Windows64, Windows32, Linux64, Linux32 or MacOSX. These builds contain the onelab.py module pre-installed in the same directory as the Gmsh executable. If onelab.py is not in the same directory as the Gmsh executable, you will need to configure your PYTHONPATH accordingly.
- Double-click on the Gmsh executable (gmsh.exe Error creating thumbnail: Unable to save thumbnail to destinationon Windows).
- Load one Python script (.py file) through the File/Open menu, e.g. pend.py.
- Click on Run.
- ... that's it!