eric6/MicroPython/MicroPythonGraphWidget.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7836
2f0d208b8137
equal deleted inserted replaced
7784:3257703e10c5 7785:9978016560ec
315 315
316 # save the raw data as a CSV file 316 # save the raw data as a CSV file
317 fileName = "{0}.csv".format(time.strftime("%Y%m%d-%H%M%S")) 317 fileName = "{0}.csv".format(time.strftime("%Y%m%d-%H%M%S"))
318 fullPath = os.path.join(dataDir, fileName) 318 fullPath = os.path.join(dataDir, fileName)
319 try: 319 try:
320 csvFile = open(fullPath, "w") 320 with open(fullPath, "w") as csvFile:
321 csvWriter = csv.writer(csvFile) 321 csvWriter = csv.writer(csvFile)
322 csvWriter.writerows(self.__rawData) 322 csvWriter.writerows(self.__rawData)
323 csvFile.close()
324 323
325 self.__dirty = False 324 self.__dirty = False
326 return True 325 return True
327 except (IOError, OSError) as err: 326 except (IOError, OSError) as err:
328 E5MessageBox.critical( 327 E5MessageBox.critical(

eric ide

mercurial