mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-06 15:04:06 +00:00
rename globals. call to globalVars.
This commit is contained in:
parent
f8fcda94b6
commit
e938cdcd6d
27 changed files with 300 additions and 300 deletions
|
|
@ -64,20 +64,20 @@ test2 = 123456
|
|||
```
|
||||
|
||||
#### 3.2 Read data from config.ini
|
||||
To read yout configuration data you must import the `globals.py` where the global config-object is located:
|
||||
To read yout configuration data you must import the `globalVars.py` where the global config-object is located:
|
||||
```python
|
||||
from includes import globalVars # Global variables
|
||||
```
|
||||
|
||||
Now you can get your configuration data with:
|
||||
```python
|
||||
VALUE = globals.config.get("SECTION", "OPTION") #Gets any value
|
||||
VALUE = globalVars.config.get("SECTION", "OPTION") #Gets any value
|
||||
```
|
||||
or better, use this:
|
||||
```python
|
||||
VALUE = globals.config.getint("SECTION", "OPTION") #Value must be an Integer
|
||||
VALUE = globals.config.getfloat("SECTION", "OPTION") #Value must be an Float
|
||||
VALUE = globals.config.getboolean("SECTION", "OPTION") #Value must be an Boolean
|
||||
VALUE = globalVars.config.getint("SECTION", "OPTION") #Value must be an Integer
|
||||
VALUE = globalVars.config.getfloat("SECTION", "OPTION") #Value must be an Float
|
||||
VALUE = globalVars.config.getboolean("SECTION", "OPTION") #Value must be an Boolean
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue