Hallo,
jedes mal wenn ich mich mit Putty einlogge bekomme ich eine Meldung. You have new mail.
Wenn ich in /var/mail/pi nachschaue, steht da, sh: 21: kill: No such process
Kann es sein dass im code ein Fehler ist und diese Meldung von daher kommt???
Koennte mal jemand von euch Cracks den code kontrollieren ob der so richtig programmiert ist??
Danke und
Gruss
gwaag
Python
#!/usr/bin/python
#Dieses script startet "Zone1-4" beim einschalten und stoppt beim ausschalten script "AusvonAlarm.py" .
import subprocess
from subprocess import Popen
import pifacedigitalio
from time import sleep
pfd = pifacedigitalio.PiFaceDigital() # creates a PiFace Digital object
testprocess = None
while(True):
if pfd.input_pins[0].value ==1 and not testprocess:
for x in range(10): # blinken
pfd.leds[7].toggle()
sleep(.1)
pfd.output_port.all_off() # alle leds aus
sleep(.1)
if not testprocess:
testprocess = Popen(["/bin/Zone1-4"])
sleep(1)
if pfd.input_pins[0].value ==0:
if testprocess:
testprocess.kill()
testprocess = None
Popen(["/bin/AusvonAlarm.py"])
sleep(1)
Alles anzeigen