An small error for the function "image to txt" and the work function for "image to image" change in order to work on python 3.8 or later#52
Open
QianziTech wants to merge 9 commits intovietnh1009:masterfrom
Conversation
… the 'r' in start of the 'CHAR_LIST',which could course error because of the"\".
Author
|
Sorry.I use python 3.12 when i found the error. |
Closed
njzjz
reviewed
Nov 23, 2024
| CHAR_LIST = '@%#*+=-:. ' | ||
| else: | ||
| CHAR_LIST = "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. " | ||
| CHAR_LIST = r"$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. " |
There was a problem hiding this comment.
I think this is not correct, considering
>>> len(r"\"")
2
>>> r"\""[0]
'\\'
>>> r"\""[1]
'"'So there will be two \ in CHAR_LIST (previously there is zero).
My suggestion is
Suggested change
| CHAR_LIST = r"$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. " | |
| CHAR_LIST = r"""$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,"^`'. """ |
Author
|
By the way,I also change the work function on "image to image",so it could work correctly on python 3.8 or later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As the default setting with the 'complex' mode,the source didn't have the 'r' in start of the 'CHAR_LIST',which could course error because of the"\".

The following screenshoot show the error for your origin code: