def writeToLogFile(self, content): self.logFile = open(self.logFileName, "a") self.logFile.write(Func.getTimeStamp() + " " + content + '\n') self.logFile.close()
def __init__(self, name='log'): self.name = 'log' self.logFileName = name + ' ' + Func.getTimeStamp("%d-%b-%Y %H-%M-%S") + ".log" self.logFile = open(self.logFileName, "w+") self.logFile.write(Func.getTimeStamp() + " " + "Start" + "\n") self.logFile.close()
def safeScreenshot(self): # safes a screenshot, but without function success, img = self.vcap.read() filename = "screenshot " + Func.getTimeStamp( "%d-%b-%Y %H-%M-%S") + ".jpg" cv2.imwrite(filename, img) self.frame.frame.writeToInfo("Screenshot saved")