### Navigation

- index
- modules |
- next |
- previous |
- pyFormex v0.8.6 documentation >
- pyFormex user guide >

# Running pyFormex

To run pyFormex, simply enter the command `pyformex` in a terminal window. This will start the Graphical User Interface (GUI), from where you can launch examples or load, edit and run your own scripts.

The installation procedure may have installed into your desktop menu or even have created a start button in the desktop panel. These provide convenient shortcuts to start the GUI by the click of a mouse button.

The program takes some optional command line arguments, that modify the behaviour of the program. Appendix Command line options gives a full list of all options. For normal use however you will seldom need to use any of them. Therefore, we will only explain here the more commonly used ones.

By default, sends diagnostical and informational messages to the terminal from which the program was started. Sometimes this may be inconvenient, e.g. because the user has no access to the starting terminal. You can redirect these messages to the message window of the GUI by starting pyformex with the command `pyformex --redirect`. The desktop starters installed by the installation procedure use this option.

In some cases the user may want to use the mathematical power of without the GUI. This is e.g. useful to run complex automated procedures from a script file. For convenience, will automatically enter this batch mode (without GUI) if the name of a script file was specified on the command line; when a script file name is absent, start in GUI mode. Even when specifying a script file, You can still force the GUI mode by adding the option –gui to the command line.

# Command line options

The following is a complete list of the options for the pyformex command.This output can also be generated by the command `pyformex --help`.

    Usage
    =====
      pyformex [<options>] [ [ scriptname [scriptargs] ] ...]

    pyFormex is a tool for generating, manipulating and transforming large
    geometrical models of 3D structures by sequences of mathematical
    transformations.

    Options
    =======
    --gui                   start the GUI (default if no scriptfile argument is
                            given)
    --nogui                 do not load the GUI (default if a scriptfile argument
                            is given)
    --interactive, -i       Go into interactive mode after processing the command
                            line parameters. This is implied by the --gui option.
    --force-dri             Force use of Direct Rendering
    --force-nodri           Disables the Direct Rendering
    --uselib                Use the pyFormex C lib if available. This is the
                            default.
    --nouselib              Do not use the pyFormex C-lib.
    --norst2html            Do not try to convert rst messages to html before
                            displaying.
    --config=CONFIG         Use file CONFIG for settings
    --nodefaultconfig       Skip the default site and user config files. This
                            option can only be used in conjunction with the
                            --config option.
    --redirect              Redirect standard output to the message board (ignored
                            with --nogui)
    --debug                 display debugging info to sys.stdout
    --debuglevel=DEBUG      display debugging info to sys.stdout
    --newviewports          Use the new multiple viewport canvas implementation.
                            This is an experimental feature only intended for
                            developers.
    --testmodule=TESTMODULE
                            Run the docstring tests for module TESTMODULE.
                            TESTMODULE is the name of the module, using . as path
                            separator.
    --testcamera            Print camera settings whenever they change.
    --testexecutor          test alternate executor: only for developers!
    --fastnurbs             test C library nurbs drawing: only for developers!
    --listfiles             list the pyformex Python source files.
    --search                search the pyformex source for a specified pattern and
                            exit. This can optionally be followed by -- followed
                            by options for the grep command. The final argument is
                            the pattern to search.
    --remove                remove the pyformex installation and exit
    --whereami              show where the pyformex package is installed and exit
    --detect                show detected helper software and exit
    --version               show program's version number and exit
    --help, -h              show this help message and exit

# Running without the GUI

If you start with the `--nogui` option, no Graphical User Interface is created. This is extremely useful to run automated scripts in batch mode. In this operating mode, will interprete all arguments remaining after interpreting the options, as filenames of scripts to be run (and possibly arguments to be interpreted by these scripts). Thus, if you want to run a script myscript.py in batch mode, just give the command pyformex myscript.py.

The running script has access to the remaining arguments in the global list variable argv. The script can use any arguments of it and pop them of the list. Any arguments remaining in the argv list when the script finishes, will be used for another execution cycle. This means that the first remaining argument should again be a script.

### Navigation

- index
- modules |
- next |
- previous |
- pyFormex v0.8.6 documentation >
- pyFormex user guide >