eric6/MicroPython/MicroPythonCommandsInterface.py

branch
micropython
changeset 7115
fe89c98430b6
parent 7113
04ac3f9a87e6
child 7124
1965daf1a14b
equal deleted inserted replaced
7114:f416440c8be1 7115:fe89c98430b6
588 " result = r(32)", 588 " result = r(32)",
589 " if result:", 589 " if result:",
590 " u.write(result)", 590 " u.write(result)",
591 " f.close()", 591 " f.close()",
592 ]), 592 ]),
593 "send_data()", 593 "send_data()",
594 ] 594 ]
595 out, err = self.execute(commands) 595 out, err = self.execute(commands)
596 if err: 596 if err:
597 raise IOError(self.__shortError(err)) 597 raise IOError(self.__shortError(err))
598 598
773 commands = [ 773 commands = [
774 "import time as __time_", 774 "import time as __time_",
775 "\n".join([ 775 "\n".join([
776 "try:", 776 "try:",
777 " print(__time_.strftime('%Y-%m-%d %H:%M:%S'," 777 " print(__time_.strftime('%Y-%m-%d %H:%M:%S',"
778 # __IGNORE_WARNING_M601__
778 " __time_.localtime()))", 779 " __time_.localtime()))",
779 # __IGNORE_WARNING_M601__
780 "except AttributeError:", 780 "except AttributeError:",
781 " tm = __time_.localtime()", 781 " tm = __time_.localtime()",
782 " print('{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}'" 782 " print('{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}'"
783 ".format(tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour," 783 ".format(tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour,"
784 " tm.tm_min, tm.tm_sec))", 784 " tm.tm_min, tm.tm_sec))",

eric ide

mercurial