cli
- Name: cognitivefactory.interactive_clustering_gui.cli
- Description: Module that contains the command line application.
- Author: Erwan Schild
- Created: 22/10/2021
- Licence: CeCILL-C License v1.0 (https://cecill.info/licences.fr.html)
Why does this file exist, and why not put this in __main__
?
You might be tempted to import things from __main__
later, but that will cause problems: the code will get executed twice:
- When you run python -m cognitivefactory.interactive_clustering_gui
python will execute __main__.py
as a script. That means there won't be any cognitivefactory.interactive_clustering_gui.__main__
in sys.modules
.
- When you import __main__
it will get executed again (as a module) because there's no cognitivefactory.interactive_clustering_gui.__main__
in sys.modules
.
get_parser()
¶
Define possible arguments of the CLI argument parser.
Returns:
Type | Description |
---|---|
ArgumentParser
|
An argparse parser. |
Source code in src\cognitivefactory\interactive_clustering_gui\cli.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
main(args=None)
¶
Run the main program.
This function is executed when you type cognitivefactory-interactive-clustering-gui
or python -m cognitivefactory.interactive_clustering_gui
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
Optional[List[str]]
|
Arguments passed from the command line. |
None
|
Returns:
Type | Description |
---|---|
int
|
A default exit code. |
Source code in src\cognitivefactory\interactive_clustering_gui\cli.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|