IMP  2.2.0
The Integrative Modeling Platform
flags.py
1 ## \example base/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.base
6 import sys
7 
8 IMP.base.add_string_flag("hello", "Hello world", "How to say hello")
9 
10 IMP.base.setup_from_argv(sys.argv, "An example for using flags in python.")
11 
12 if IMP.base.get_string_flag("hello") == "":
14  exit(1)
15 
16 print IMP.base.get_string_flag("hello")
See IMP.base for more information.
Definition: base/Array.h:20
std::string get_string_flag(std::string name)
void add_string_flag(std::string name, std::string default_value, std::string description)
void write_help(std::ostream &out=std::cerr)
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)