ich bin noch recht neue in Sachen Python. Mein aktuelles großes Problem:
Ich lese aus einer CSV Datei zwei Datumswerte (beide im Format DD.MM.YYY) und will sie in ein Date- und ein Timestamp-Feld einer MySQL Db schreiben.
Mein Versuch:
Code: Alles auswählen
.....
File = csv.reader(open('I:\test.csv', 'rb'))
for row in File:
Doc_Date = time.strptime(row[6],"%d.%m.%Y")
Valid_From = time.strptime(row[10],"%d.%m.%Y")
cursor.execute ( """INSET INTO Test (Datum) VALUES (%s, %s)""", ( Doc_Date, Valid_From ) )
.....
Gruß