1
0
Fork 0

Datum hinzugfügt

* grobe Datumsfunktion
* noch keine Benutzereingebe
* noch keine Nutzung in mathe.py
This commit is contained in:
Findus23 2014-02-12 19:48:49 +01:00
parent d5ff5bf876
commit d4dd6ec354
4 changed files with 1454 additions and 0 deletions

View file

@ -0,0 +1 @@
Der Messwert geht von Zeile 9 bis Zeile 1001 und über folgenden Zeitraum: 3:48:18

1427
Endauswertung/datum.csv Normal file

File diff suppressed because it is too large Load diff

25
Endauswertung/datum.py Executable file
View file

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from datetime import datetime # aus dem Modul datetime Datentyp datetime (Datum und Zeit) importieren
format = "%Y/%m/%d %H:%M:%S"
von_roh = "2014/02/01 18:12:42"
von = datetime.strptime(von_roh, format)
bis_roh = "2014/02/01 22:1:00"
bis = datetime.strptime(bis_roh, format)
datei = open("datum.csv", "r")
inhalt = datei.readlines()
datei.close()
start_gefunden = False
stop_gefunden = False
for datum in inhalt:
datum_py = datetime.strptime(datum.rstrip(), format)
if (datum_py > von) and (start_gefunden == False):
start = inhalt.index(datum)
start_gefunden = True
if (start_gefunden == True) and (datum_py > bis) and (stop_gefunden == False):
stop = inhalt.index(datum) - 1
stop_gefunden = True
break
print("Der Messwert geht von Zeile " + str(start) + " bis Zeile " + str(stop) + " und über folgenden Zeitraum: " + str(bis - von))

View file

@ -1,2 +1,3 @@
#!/bin/bash
cut -d ',' -f '2-' dygraph.csv > vorbereitet.csv
cut -d ',' -f '1' dygraph.csv > datum.csv