Mehr Pep8 kompatibel
This commit is contained in:
10
Datenbank.py
10
Datenbank.py
@@ -1,5 +1,6 @@
|
||||
import sqlite3
|
||||
|
||||
|
||||
def datenbank_erstellen():
|
||||
try:
|
||||
conn = sqlite3.connect('einsatz.db')
|
||||
@@ -33,7 +34,10 @@ def datenbank_erstellen():
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def daten_einfuegen(vorname, nachname, strasse, plz, ort, geburtsdatum, geschlecht, nationalitaet, hiorg, start_datum, start_uhrzeit, ende_datum, ende_uhrzeit, position, qrcode):
|
||||
|
||||
def daten_einfuegen(
|
||||
vorname, nachname, strasse, plz, ort, geburtsdatum, geschlecht, nationalitaet, hiorg, start_datum,
|
||||
start_uhrzeit, ende_datum, ende_uhrzeit, position, qrcode):
|
||||
try:
|
||||
conn = sqlite3.connect('einsatz.db')
|
||||
cursor = conn.cursor()
|
||||
@@ -61,6 +65,7 @@ def daten_einfuegen(vorname, nachname, strasse, plz, ort, geburtsdatum, geschlec
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
|
||||
def main():
|
||||
datenbank_erstellen()
|
||||
daten_einfuegen(
|
||||
@@ -70,7 +75,6 @@ def main():
|
||||
"Sanitäter", "ABC123"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -27,33 +27,34 @@ def input_code():
|
||||
|
||||
if ';' in scancode:
|
||||
kompletter_qrcode = scancode
|
||||
nachname, vorname, geburtsdatum, geschlecht, plz, ort, nationalitaet, strasse, helferid, null, hiorg, null, null, null,null = kompletter_qrcode.split(";")
|
||||
nachname, vorname, geburtsdatum, geschlecht, plz, ort, nationalitaet, strasse, helferid, null, hiorg, null, null, null, null = kompletter_qrcode.split(";")
|
||||
kompletter_name = nachname + ", " + vorname
|
||||
|
||||
print("AUSGABE DER DATEN")
|
||||
print("-----------------\n")
|
||||
print("Kompletter Name: " + kompletter_name)
|
||||
print(f"Kompletter Name: {kompletter_name}")
|
||||
print("Vorname: " + vorname)
|
||||
print("Nachname: " + nachname)
|
||||
print("Straße: " + strasse)
|
||||
print("Postleitzzahl + Ort: " + plz + " " + ort)
|
||||
print(f"Postleitzzahl + Ort: {plz} {ort}")
|
||||
print("Geburtsdatum: " + geburtsdatum)
|
||||
print("Geschlecht: " + geschlecht)
|
||||
print("Nationalität: " + nationalitaet)
|
||||
print("Hilfsorganisation: " + hiorg)
|
||||
start_datum = time.strftime("%d.%m.%Y")
|
||||
start_uhrzeit = time.strftime("%H:%M:%S")
|
||||
print (start_datum + " " + start_uhrzeit)
|
||||
print(start_datum + " " + start_uhrzeit)
|
||||
else:
|
||||
print("Code: " + scancode)
|
||||
|
||||
|
||||
def make_qrcode():
|
||||
dateinname_qrcode = input("Dateiname: ").strip()
|
||||
img = qrcode.make('Daniel')
|
||||
type(img)
|
||||
img.save(dateinname_qrcode + ".png")
|
||||
print("QR-Code " + dateinname_qrcode + ".png" + " wurde erstellt.")
|
||||
|
||||
|
||||
def main():
|
||||
print("""Menü
|
||||
----
|
||||
@@ -85,4 +86,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import openpyxl
|
||||
from openpyxl.styles import Font
|
||||
|
||||
def make_tabellen_ueberschrift():
|
||||
|
||||
def make_tabellen_ueberschrift():
|
||||
workbook = openpyxl.Workbook()
|
||||
|
||||
tabelle1 = workbook.active
|
||||
@@ -29,9 +29,10 @@ def make_tabellen_ueberschrift():
|
||||
|
||||
workbook.save('Registrierliste.xlsx')
|
||||
|
||||
def main():
|
||||
|
||||
def main():
|
||||
make_tabellen_ueberschrift()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user