TypeError: write() argument must be str, not bytes

ModuleNotFoundError: No module named ‘jsonpath’

The new situation after the last blog about no jsonpath solution

During execution, the console prompts the following error code:

TypeError: write() argument must be str, not bytes

As a beginner, I didn’t understand many copies on CSDN. Then I found the answer I wanted and solved my problem on stackoverflow

Link: typeerror: must be STR, not bytes

The question is like this, cut a picture

The answer is also to the point, cut a picture

The output file should be in binary mode

There is no problem with the console execution after modification

Then I found out from the python document query:

Python: open/file operation
F = open (‘/ TMP/Hello’,’w ‘)
#open (path + file name, read-write mode)
#read-write mode: R read-only, R + read-write, w New (will cover the original file), a append, B binary file. Common modes


Similar Posts: