-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
executable file
·44 lines (33 loc) · 979 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## Standard libraries
import sys
import logging
## Internal modules
from my_module01 import MyClass
logger = logging.getLogger(__name__)
def main() -> None:
logging.basicConfig(
stream=sys.stdout,
level=logging.INFO,
datefmt="%Y-%m-%d %H:%M:%S %z",
format="[%(asctime)s | %(levelname)s | %(filename)s:%(lineno)d]: %(message)s",
)
# Pre-defined variables (for customizing and testing)
_items = [0.1, 0.2, 0.3, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
_config = {
"min_length": 4,
"max_length": 10,
"min_value": 0.0,
"max_value": 1.0,
"threshold": 0.7,
}
# Main example code
logger.info(f"Items before cleaning: {_items}")
_my_object = MyClass(items=_items, config=_config)
_items = _my_object()
logger.info(f"Items after cleaning: {_items}")
logger.info("Done!\n")
return
if __name__ == "__main__":
main()