IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
flags.py
1## \example kernel/flags.py
2# A simple example of how to use IMP flags support in a Python
3# executable. Run with "--help" to see all available flags.
4
5import IMP
6import sys
7
8IMP.add_string_flag("hello", "Hello world", "How to say hello")
9
10IMP.setup_from_argv(sys.argv, "An example for using flags in python.")
11
12if IMP.get_string_flag("hello") == "":
14 exit(1)
15
16print(IMP.get_string_flag("hello"))
void write_help(std::ostream &out=std::cerr)
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.
std::string get_string_flag(std::string name)
void add_string_flag(std::string name, std::string default_value, std::string description)