home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
doc
examples
kernel
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
5
import
IMP
6
import
sys
7
8
IMP.add_string_flag
(
"hello"
,
"Hello world"
,
"How to say hello"
)
9
10
IMP.setup_from_argv
(sys.argv,
"An example for using flags in python."
)
11
12
if
IMP.get_string_flag
(
"hello"
) ==
""
:
13
IMP.write_help
()
14
exit(1)
15
16
print(
IMP.get_string_flag
(
"hello"
))
IMP::write_help
void write_help(std::ostream &out=std::cerr)
IMP::setup_from_argv
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.
IMP::get_string_flag
std::string get_string_flag(std::string name)
IMP::add_string_flag
void add_string_flag(std::string name, std::string default_value, std::string description)