OSError: [Errno 22] Invalid argument: OSError: error solution under Windows (an error is reported when python3 generates a new file)

In the generated file name, the time used to generate the file name
ti = time.strftime('%Y%m%d:%H:%M:%S') The
query found that the characters that are not allowed in Windows file names are: <> / \ |: "*?
Change to ti = time.strftime('%Y%m%d_%H%M%S')

Guess you like

Origin blog.csdn.net/qq_14920377/article/details/103720214