1 if __name__ == '__main__':
2 startime = time.strftime('%H:%M:%S')
3 print("Start time is: %s" % startime)
4 # Test path
5 test_dir = '. /t/test_case'
6 # Report path
7 report_dir = '. /t/report/'
8
9 now = time.strftime('%Y-%m-%d_%H:%M:%S')
10 # Create the full report file
11 filename = report_dir + now + '_report.html'
12 fp = open(filename,'wb')
See!! Look at the ninth line, there is a problem with the acquisition time of now!!! Can’t use colon: can’t use colon: can’t use colon: can’t use colon: important things say three times
It is amended as follows:
1 if __name__ == '__main__':
2 startime = time.strftime('%H:%M:%S')
3 print("Start time is: %s" % startime)
4 # Test path
5 test_dir = '. /t/test_case'
6 # Report path
7 report_dir = '. /t/report/'
8
9 now = time.strftime('%Y-%m-%d_%H_%M_%S')
10 # Create the full report file
11 filename = report_dir + now + '_report.html'
12 fp = open(filename,'wb')
Similar Posts:
- Python OSError: [errno 22] invalid argument: [How to Solve]
- [Solved] HTTP Error 301: The HTTP server returned a redirect error that would lead to an infinite loop.
- Python TypeError: unbound method a() must be called with A instance as first argument (go…
- Python3.x Run Python2.x Codes syntax error: “Missing parentheses in call to ‘print’
- [Solved] scheduler Error: maximum number of running instances reached
- [Solved] UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa5 in position 1508: illegal multibyte sequence
- Fast locating nonetype ‘object is not Iterable in Python
- The bilibilibili cache video cache batch converted to MP4 format Python code
- How to Solve Libpng warning ICCP error
- AttributeError: ‘list’ object has no attribute ‘keys’