Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The confusion of running Python script on tagui - try this #1417

Closed
KennGuo opened this issue Dec 12, 2024 · 4 comments
Closed

The confusion of running Python script on tagui - try this #1417

KennGuo opened this issue Dec 12, 2024 · 4 comments
Labels

Comments

@KennGuo
Copy link

KennGuo commented Dec 12, 2024

hey, I have a Python script(ocr.py), as shown in the picture below. When it runs alone, there is no problem at all. It will call local OCR to recognize the verification code and then return it to the clipboard.
Snipaste_2024-12-12_15-53-55
When I combine it with tagui, it doesn't work. I have tried wrapping it with pybegin and pyfinish. But every time it reaches the position shown in the picture, it completely stops.
Snipaste_2024-12-12_15-56-39
I have also tried using the following commands to call it.
run python37 ocr.py
run cmd python37 ocr.py
run ocr.bat
etc
Either it will also get stuck, or it will be executed without any feedback. I really don't know where the problem lies. If it's convenient, please help me. Thank you very much

@KennGuo
Copy link
Author

KennGuo commented Dec 12, 2024

I noticed a GBK encoding issue in tagui_py.log, so I deleted the Chinese comments in the Python script and it can continue. However, there are still issues. I'm wondering if this is related to the presence of multiple Python scripts on my computer at the same time. The default is python313, but my local OCR is all using python37

@KennGuo
Copy link
Author

KennGuo commented Dec 12, 2024

I think it's indeed the Python version that caused trouble. If that's indeed the case. How to quickly modify the source code to support multiple versions? Sorry, I haven't fully understood these codes yet, and I can't uninstall other versions of Python

@kensoh
Copy link
Member

kensoh commented Dec 13, 2024

Hi @KennGuo look for the tagui/src folder there is the tagui.cmd file. Inside there are references of python command. I think u just need to modify it to invoke the right python.

@kensoh kensoh changed the title The confusion of running Python script on tagui The confusion of running Python script on tagui - try this Dec 13, 2024
@kensoh kensoh added the query label Dec 13, 2024
@KennGuo
Copy link
Author

KennGuo commented Dec 13, 2024

Yes~I find it.
rem start python process if integration file is created during parsing if exist "tagui_py\tagui_py.in" ( start "Python Engine" /min cmd /c python -u tagui_py\tagui_py.py 2^>^&1 ^| tee -a tagui_py\tagui_py.log )
Change python to python37. Thanks a lot.

@KennGuo KennGuo closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants