PyXLL creates some configuration substitution variables that can be used in any config values.
Variable substitution in the config file follows the same format as Python’s configparser
module,
which is %(name)s
, where name
is the variable name.
For example, including today’s date in the log file name would be specified as:
[LOG]
file = pyxll-log-%(date)s.txt
The following sustitution variables are available:
Variable Name |
Format |
Description |
PyXLL Version |
---|---|---|---|
pid |
|
Process id |
All |
date |
|
Current date in YYYYMMDD format |
All |
time |
|
Current time in HHMMSS format |
>= 5.6 |
xl_version [1] |
|
Excel version |
All |
py_version |
|
Python version |
>= 5.2 |
pyxll_version |
|
PyXLL version |
>= 5.2 |
xll_path |
|
Full path of the pyxll.xll add-in |
>= 5.6 |
xll_dir |
|
Directory containing the pyxll.xll add-in |
>= 5.6 |
cfg_path |
|
Full path of the config file being processed |
>= 5.6 |
cfg_dir |
|
Directory containing the config file being processed |
>= 5.6 |
basecfg_path [2] |
|
Full path of the base config file |
>= 5.6 |
basecfg_dir [2] |
|
Directory containing the base config file |
>= 5.6 |
In addition to these standard substition variables, environment variables can also be used as substitution variables in the config. See Environment Variables for more details about using environment variables in the config file.
Footnotes