Using Sympathy from command line

You can run a Sympathy from the command line by running python with syg or sy and a workflow path as arguments. For the relevant startup options, see Sympathy Start options. For more information about see Start options. Use the -h option to get more information about the arguments.

Run Sympathy for Data GUI on Windows or Unix:

python syg

Run Sympathy for Data CLI on Windows or Unix:

python sy filename

On Windows it is often useful to launch Sympathy in this way, using python.exe instead of pythonw.exe to get terminal output. If you also have access to RunSympathyGUI.exe and RunSympathyCLI.exe that we bundle with our installers they can be used to run Sympathy for Data. These two basically run pythonw.exe syg and python.exe sy respectively.

Run Sympathy for Data GUI on Windows:


Run Sympathy for Data CLI on Windows:

RunSympathyCLI.exe filename

On Unix and provides the same convenience.

Run Sympathy for Data GUI on UNIX:


Run Sympathy for Data CLI on UNIX:

./ filename

Sympathy Start options

--loglevel=X or -LX
Set log level to X which should be a number between 0 and 5 inclusive. 0 means no logging and higher number corresponds to more verbose logging. The log is printed to standard output.
--node_loglevel=X or -NX
Set node log level to X which should be a number between 0 and 5 inclusive. 0 means no logging and higher number corresponds to more verbose logging. The node log is printed to standard output.
--configfile <FILELIST> or -C <FILELIST>
Use config files from comma separated <FILELIST>. See Using config files for more info about config files.
--inifile INIFILE or -I INIFILE
Specify preferences file.
--exit_after_exception {0,1}
If set to 1, exit after uncaught exception occurs in a signal handler. 1 is default for non-GUI execution and 0 is default for GUI.
--num_worker_processes N
Number of python worker processes (0) use system number of CPUs
Generate documentation files for Sympathy.
Generate documentation files for Sympathy in a virtual python environment.
Write output directly to stdout and stderr without platform interception. Useful for debugging.
Generate HTML report of the execution to filename. Use this option together with -L5 and -N5 to get as much information as possible.
--help or -h
Print usage message and exit.
--version or -v
Show Sympathy for Data version. Start options

Besides sy and syg, has a few other options that can be useful.

Run Sympathy for Data CLI. For usable arguments see Sympathy Start options.
Run Sympathy for Data GUI. For usable arguments see Sympathy Start options.
Run Sympathy for Data Viewer. It can be supplied an optional filename argument.
Run all unit tests and test workflows for the sympathy platform and for all configured node libraries. See Writing tests for your nodes for an introduction to library tests.
Run Sympathy for Data Benchmark suite. It generates a HTML report to supplied filename argument.
Run Spyder with the environment (PYTHONPATH) set up.
Run ipython with the environment (PYTHONPATH) set up.
Run nose with the environment (PYTHONPATH) set up.
--help or -h
Print usage message and exit.

Using environment variables

Environment variable expansion is useful in node configurations where the node should behave differently depending on the environment where it is executed. A simple example would be a workflow that always loads a certain file from the current users home directory. To achieve that you can simply configure a Datasource node to point to $(HOME)/somefile.txt and it will point to the file somefile.txt in the users home directory.

Apart from using already existing OS environment variables you can also add your own environment variables at four different levels: OS/shell, local config, workflow, and global config. Local config or workflow level variables are generally preferred as they don’t risk affecting workflows that they shouldn’t.

Default workflow environment variables

A few variables are always defined in every workflow. For example $(SY_FLOW_FILEPATH) which holds the full path to the workflow file, or $(SY_FLOW_DIR) which contains the directory of the workflow file. These variables behave just like normal workflow variables, but they are not stored in syx-file. Instead they are computed on the fly as they are used.

For a complete list see File->*Preferences*->*Environment*.

Adding OS/shell environment variables

Setting environment variables or shell variables is done differently depending on operating system, version, shell etc. As an example lets set the shell variable GREETING and start Sympathy in a command prompt in Windows:

> set GREETING=Hi!
> RunSympathyGUI.exe

Add a Hello world Example node and configure it to display $(GREETING). Run the node. The output should be Hi!.

Adding environment variables via local config files

When starting Sympathy with one or more config files specified you can set environment variables in those config files. Simply add lines like this to the config file:

$(GREETING) = "Yo!"

Adding workflow environment variables

Workflow level environment variables can be added and removed via the preferences gui. Go to File->*Preferences...*->*Environment* and add, change, and remove workflow variables. These variables are stored in the workflow file, and will only affect that workflow, and its subflows. A subflow can always override a variable set by one of its parent flows.

Adding environment variables to the global config file

Just as for workflow level variables global config variables can be added and edited under File->*Preferences...*->*Environment*, but they are stored in the global config file for Sympathy so they affect all workflows.


In case of name conflicts, environment variables are looked up in the following order:

  1. OS/shell
  2. Local config files
  3. Workflow (defined in current subflow)
  4. Workflow (defined in a parent workflow)
  5. Global config file

Using config files

Config files can be used to set environment variables and for directly changing node config parameters.

Here is an example config file:

alias helloworld = {1679abf7-2fb9-4453-9b45-a7eb61b670ed}
helloworld.parameters.greeting.value = "Howdy!"

The crazy string of numbers and characters on the first line is a node UUID. This uniquely identifies a single node in a workflow. The alias command is used to give the node a more human-readable name that can be used throughout the rest of the config file. To find the UUID of a node right click on it and choose Info.

When setting strings with non-ascii characters note that the config file should always be encoded using utf8:

alias helloworld = {1679abf7-2fb9-4453-9b45-a7eb61b670ed}
helloworld.parameters.greeting.value = "Grüß Gott!"

Or use escape sequences for any non-ascii characters:

alias helloworld = {1679abf7-2fb9-4453-9b45-a7eb61b670ed}
helloworld.parameters.greeting.value = "Gr\u00FC\u00DF Gott!"

When changing parameters in parameter groups or parameter pages write the full path to the parameter. The following example changes the parameters of an Example1 node:

alias example1 = {9cc8b9b8-bcc5-4218-8bb4-13cf1e249626}
example1.parameters.delay.delay.value = 0.005
example1.parameters.examples.logics.boolflag.value = false
example1.parameters.examples.strings.lineedit.value = "some string"

All values must be valid JSON, which for instance means that true and false are lower case.

When using multiple config files in the same call the last config file has highest priority and the first one has the lowest priority:

> RunSympathyGUI.exe flow.syx -C low_prio.cfg,high_prio.cfg

You can also add environment variables to your config files using the following syntax:

$(GREETING) = "Good day!"

Environment variables defined in config files have precedence over workflow specific and global variables. For more info on environment variables see Using environment variables.

Whenever you start Sympathy with a config file the flow that you open will be copied to a temporary location and modified according to the config file. This means that any relative paths in the flow or in the config file will be relative to this temporary location instead of being relative to the original workflow. So when using relative paths in conjunction with config files you should always add an output workflow filename to the command:

> RunSympathyGUI.exe flow.syx -C rel_paths.cfg output_flow.syx

Then the workflow flow.syx will be copied to output_flow.syx instead of a default temporary location and you can use paths relative to the output workflow path. Note that the output workflow will be mercilessly overwritten each time you run the command above.