13.2 Changing the default behavior via command-line options

##
13.2 Changing the default behavior via command-line options

The variables in the `theme` module can also be set from the command line. To do this, the program that imports PyChart must call `theme.get_options` in the beginning, because PyChart itself is just a library. Below is an example.

`get_options`( | ARGV = sys.argv[1:])

  This procedure takes a list of command line arguments in argv and parses options. It returns the non-parsed portion of argv. Parameter argv can be omitted, in which case its value defaults to `sys.argv[1:]`. The options supported are: "`--format=[ps,png,pdf,x11,svg]`", "`--output=`file", "`--color=[yes,no]`" "`--scale=`X", "`--font-family=`name", "`--font-size=`X", "`--line-width=`X", "`--debug-level=`N", "`bbox=`left,bottom,right,top". The below code shows an example.

      #!/usr/bin/python2
      from pychart import *
      args = theme.get_options()
      ar = area.T(...)
      ...