Dies sollte Funktionieren:
Code: Alles auswählen
import os
import time
path = "/home/pi/abc.pid"
if not os.path.exists(path):
pid = open(path, "w")
pid.write(time.strftime("%d.%m.%Y %H:%M:%S"))
pid.close()

Code: Alles auswählen
import os
import time
path = "/home/pi/abc.pid"
if not os.path.exists(path):
pid = open(path, "w")
pid.write(time.strftime("%d.%m.%Y %H:%M:%S"))
pid.close()