Hi Johannes,
To use verdi commands directly from python, you have several options:
1. In python you can use the subprocess module (see
https://docs.python.org/3/library/subprocess.html) to call external programs and thus also verdi commands. This module also allows you to capture the output anywhere you like.
2. in a notebook and ipython execute `!verdi command >> filename`" (notice the '!' ) here you could pipe the output to a file, which you can read afterwards.
----------------------------------------------------------
Jens Bröder
Research fellow at PGI-1/IAS-1
Peter Grünberg Institut (PGI) und Institute for Advanced Simulation (IAS) Forschungszentrum Jülich
D-52425 Jülich
Tel.: 02461-61-9385
E-Mail: j.br...@fz-juelich.de
import clickThis will now print the usual output.
from aiida.cmdline.commands.cmd_process import process_list
click.Context(process_list).invoke(process_list)
click.Context(process_list).invoke(process_list, all_entries=True, past_days=5)Note, however, that the translation of flag names to function arguments are not always 1-to-1, as here with `--all` -> `all_entries`.
To view this discussion on the web visit https://groups.google.com/d/msgid/aiidausers/59906ea12565495ba2a0acb04f518e6f%40fz-juelich.de.