Skip to content

Commit

Permalink
Passordsjekk i try-except
Browse files Browse the repository at this point in the history
  • Loading branch information
mfmssb committed Nov 21, 2023
1 parent 31777c3 commit 592a36c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Droplister/Droplister_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 592a36c

Please sign in to comment.