diff --git a/Droplister/Droplister_v2.py b/Droplister/Droplister_v2.py index 05305e2..956de95 100644 --- a/Droplister/Droplister_v2.py +++ b/Droplister/Droplister_v2.py @@ -109,15 +109,16 @@ # ## Tilgang oracle username = getpass.getuser() -password = getpass.getpass(prompt='Oracle-passord: ') dsn = "DB1P" - -# + -engine = create_engine(f"oracle+cx_oracle://{username}:{password}@{dsn}") +try: + engine = create_engine(f"oracle+cx_oracle://{username}:{password}@{dsn}") +except: + print("Passord ikke skrevet inn") + password = getpass.getpass(prompt='Oracle-passord: ') + engine = create_engine(f"oracle+cx_oracle://{username}:{password}@{dsn}") # Opprett en tilkobling fra motoren conn = engine.connect() -# - # # Henter data