rename globals. call to globalVars.

This commit is contained in:
Bastian Schroll 2016-10-03 12:02:18 +02:00
parent f8fcda94b6
commit e938cdcd6d
27 changed files with 300 additions and 300 deletions

View file

@ -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
```