Jan-31-2018, 03:20 PM
(This post was last modified: Jan-31-2018, 03:30 PM by Python4Mike.)
Hi Unladen Swallow
Section of code which creates error message is below:
The EOF error traces to the section marked as XXXXX, immediately after entering * at keyboard.
Hi unladen Swallow
Sorry re code supplied, all the indents seem to have disappeared during cut and paste
Hi DeaD_EyE
Sorry I sent reply to "Unladen Swallow instead of to you.
This is my first time use of this python problem system so I may get the protocols wrong!
Section of code which creates error message is below:
The EOF error traces to the section marked as XXXXX, immediately after entering * at keyboard.
#Select required action using the selected Trap Release Table defined in mgc_start( ) def pull( ): while True: global table print ("Table " + (table)) #de-bug code arm1 = ( ) arm2 = ( ) arm3 = ( ) arm4 = ( ) arm1 = 1 #1 = Trap not armed, 0 = Trap armed arm2 = 1 #1 = Trap not armed, 0 = Trap armed arm3 = 1 #1 = Trap not armed, 0 = Trap armed arm4 = 1 #1 = Trap not armed, 0 = Trap armed pull = ( ) pull = input ("\nPRESS '*' TO START SELECTED RELEASE TYPE" "\nPRESS '/' TO RETURN TO 'SELECT RELEASE' " "\nPRESS '-' TO FINISH AND SHUTDOWN SYSTEM\n") XXXXX if pull == ("*"): #Start Trap Release Sequence when PB pressed arm1 = GPIO.input(32) arm2 = GPIO.input(36) arm3 = GPIO.input(38) arm4 = GPIO.input(40) print ("TRAP ARM STATUS = " + str(arm1) + str(arm2) + str(arm3) + str(arm4)) print ("RELEASE TABLE SELECTED = " + str(table)) if not (arm1) and not (arm2) and (str(table) == "1" or str(table) == "2" \ or str(table) == "3"): print ("A") #de-bug code print ("\nPRESS BUTTON TO FIRE 1st Release FROM TABLE " + str(table)) flush_random( ) #go to check if flush selected #mgc_start( ) #de-bug code elif not (arm1) and not (arm2) and not (arm3) and (str(table) == "4" \ or str(table) == "5" or str(table) == "6" or str(table) == "10" \ or str(table) == "12"): print ("B") #de-bug code print ("\nPRESS FIRE BUTTON TO FIRE 1st FROM TABLE " + str(table)) flush_random( ) #go to check if flush selected #mgc_start( ) #de-bug code elif not (arm1) and not (arm2) and not (arm3) and not (arm4) \ and (str(table) == "7" or str(table) == "8" or str(table) == "9" \ or str(table) == "11" or str(table) == "13" or str(table) == "14"): print("C") #de-bug code print ("\nPRESS FIRE BUTTON TO FIRE 1st release FROM TABLE " + str(table)) flush_random( ) #go to check if flush selected #mgc_start( ) #de-bug code else: #Invalid selected release type re number of traps armed and ready print ("INVALID RELEASE TYPE RE TRAPS ARMED AND READY") print ("ARM REQUIRED TRAPS & RESELECT RELEASE TYPE") mgc_start() elif pull == ("/"): #Change request clay release type from previous choice print ("\nRETURNING TO 'SELECT RELEASE TYPE' ") mgc_start( ) #Runs mgc_start( ) code again elif pull == ("-"): #Finished with Trap Control Box, Shut Down System print("\nSHUTING SYSTEM DOWN") print("WAIT UNTIL RUN LIGHT IS OFF BEFORE UNPLUGING POWER") GPIO.output(7, 0) #Trap 1 = 0 GPIO.output(11, 0) #Trap 2 = 0 GPIO.output(13, 0) #Trap 3 = 0 GPIO.output(15, 0) #Trap 4 = 0 GPIO.output(29, 0) #System Ready LED = OFF GPIO.output(31, 0) #Fire Pushbutton Disabled (Safety feature) GPIO.output(33, 0) #Flush Pushbutton Disabled (Safety feature) GPIO.cleanup( ) sys.exit( ) #Finished with Trap Control Box, Shut Down System else: #Invalid request, therefore try again print("\nINVALID INPUT, PRESS '*' OR '/' OR '-' TO CONTINUE") continue #Returns to beginning of pull( ) loop
Hi unladen Swallow
Sorry re code supplied, all the indents seem to have disappeared during cut and paste
Hi DeaD_EyE
Sorry I sent reply to "Unladen Swallow instead of to you.
This is my first time use of this python problem system so I may get the protocols wrong!