I use my pi Model b to turn a pump on and off. It boots to the script and requires an input that it processes. So far it works very well. What I need is to send an input that will get me out of the script but to the command line, now as soon as I send the input to get out of the script it goes to the GUI.
this is the script and it runs on boot as it was added to the .bash_profile. the inittab was edited so as to not require login. When it boots it comes to the 'Amount of litres to be treated? ' and expects an input. When I send '0' I want it to go to the command line (pi@raspberrypi:~$) instead of the GUI that it now goes.
import time while True: Quantity = input('Amount of litres to be treated? ') fuel = float(Quantity) * 0.1269 sum2 = float(Quantity) * 0.4 print ('Catalyst to be added= ', sum2) print ('Pump ON') print ('..................') #gpio on time #GPIO.output(7,True) time.sleep(fuel) print ('Pump Off') #GPIO.output(7,False) if sum2 == 0: break