diff --git a/test.py b/test.py index d3349fd..ddaecde 100644 --- a/test.py +++ b/test.py @@ -5,10 +5,18 @@ from urllib.request import urlopen from datetime import datetime from fints.client import FinTS3PinTanClient +# Konfiguration laden # Konfiguration laden config = {} -with open(Path.home() / ".ing.conf") as f: +# Zuerst Home-Verzeichnis prüfen +config_file = Path.home() / ".ing.conf" + +# Falls nicht vorhanden, Datei neben dem Skript verwenden +if not config_file.exists(): + config_file = Path(__file__).parent / ".ing.conf" + +with open(config_file, encoding="utf-8") as f: for line in f: line = line.strip() @@ -21,7 +29,6 @@ with open(Path.home() / ".ing.conf") as f: key, value = line.split("=", 1) config[key] = value - # ING USER = config["ING_USER"] PIN = config["ING_PIN"]