commit message from python script

This commit is contained in:
2023-12-05 15:36:41 +01:00
parent ec9fb118f1
commit 1214405b27
2 changed files with 12 additions and 5 deletions

View File

@@ -46,13 +46,14 @@ INSERT INTO filmgenres(genre, beschreibung)
cursor = con_db.cursor()
while True:
##Abfrage Name
name = input("Name des Films: ").lower
name = input("Name des Films: ")
if not name:
break
##Abfrage Genre
while True:
movie_genre = input("Genre: ").lower
while True:
movie_genre = input("Genre: ")
sql = """Select * from filmgenres where genre = '{genre}'""".format(genre=movie_genre)
cursor.execute(sql)
if cursor.fetchone():
@@ -65,10 +66,16 @@ INSERT INTO filmgenres(genre, beschreibung)
self.ausgabe_abfrage(sql_abfrage="""Select genre from filmgenres""")
#Abfrage Jahr
movie_year = input("Jahr: ").lower()
while True:
movie_year = input("Jahr: ")
if len(str(movie_year)) == 4 and movie_year.isdigit() is True:
break
else:
print("Das Jahr muss 4 Zeichen haben und aus Zahlen bestehen.")
#Abfrage Format
while True:
format = input("Format :").lower()
format = input("Format :")
if format == "blue-ray" or format == "dvd" or format == "platte" or format == "sd":
break
else: