# import pifacecad import sys try: ## Original code # text_splited = sys.argv[1].split(":") # rowcol = text_splited[0].split(",") # # print rowcol # text = text_splited[1] # print text # text = text.replace("#/@$%", " ") ## End of original code # print ("========= START =========") # print (sys.argv[1]) x = sys.argv[1].split(",") # print (x[0]) y = x[1].split("@") # print (y[0]) # print (y[1]) # print (y[2]) # print ("============END============") except: raise TypeError("The entered text is not correct") cad = pifacecad.PiFaceCAD() cad.lcd.backlight_on() cad.lcd.cursor_off() ## Pick one of the two lines. #cad.lcd.set_cursor (int(rowcol[1]), int(rowcol[0])) # This one is better. ## Old code #cad.lcd.set_cursor (int(rowcol[1])-1, int(rowcol[0])-1) cad.lcd.set_cursor (int(x[0])-1, int(y[0])-1) if (y[1]): cad.lcd.write(y[1]) ## Old code #if (text): # cad.lcd.write(text) # cad.lcd.write(unicode(text)) # cad.lcd.write(text) # cad.lcd.move_right() # cad.lcd.move_left() # cad.lcd.see_cursor() cad.lcd.blink_off() # cad.lcd.write(unicode(text)) #else: # cad.lcd.clear()