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

Python script output doesn't print until script execution finished #349

Closed
Alonel opened this issue Oct 9, 2020 · 3 comments
Closed

Python script output doesn't print until script execution finished #349

Alonel opened this issue Oct 9, 2020 · 3 comments

Comments

@Alonel
Copy link

Alonel commented Oct 9, 2020

I'm running Python scripts which can take a long time to finish running, due to that during the Python execution, print out to the screen the script stages so the users won't need to wait until the end without knowing what's going on. when I'm running vi Script-Server only when Python execution ends I get the complete STDOUT printed to the screen.

I found an ugly workaround which instead of printing out with print(), I'm printing using input() with Timeout of 1 sec before continuing before the user will able to prompt in, and then it prints out the messages in "real-time"

is this a bug or by design?

@bugy
Copy link
Owner

bugy commented Oct 10, 2020 via email

@Alonel
Copy link
Author

Alonel commented Oct 13, 2020

Thanks that fix the issue for me.

@Alonel Alonel closed this as completed Oct 13, 2020
@bugy bugy reopened this Jul 24, 2021
@bugy bugy added the feature label Jul 24, 2021
@bugy bugy added this to the 1.17.0 milestone Jul 24, 2021
@bugy
Copy link
Owner

bugy commented Jul 24, 2021

I stumbled upon this inconvenience during testing again and decided to disable python buffering for called scripts (using PYTHONUNBUFFERED env variable). Hopefully, it won't break existing functionality and no one relies on buffering

@bugy bugy added the resolved label Jul 24, 2021
@bugy bugy closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants