Difference between revisions of "Python"

From ONELAB
Jump to: navigation, search
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

  1. 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.
  2. Double-click on the Gmsh executable (gmsh.exe
    Error creating thumbnail: Unable to save thumbnail to destination
    on Windows).
  3. Load one Python script (.py file) through the File/Open menu, e.g. pend.py.
  4. Click on Run.
  5. ... that's it!