-
Notifications
You must be signed in to change notification settings - Fork 1
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
100% cpu use #4
Comments
No idea if this is the right way of fixing this, but adding a tiny time.sleep in the outer loop of while True:
if ch_str != "":
break
while True:
ch_stri = sys.stdin.read(1)
if ch_stri == "":
break
ch_str += ch_stri
sleep(.02) Just my 2¢... |
@amiguet thank you very much for looking into this. I will investigate a little bit, as I'd like to avoid an explicit If no better option offers itself, I am going to go for this. If you are so inclined, feel free to open a pull request containing this change. |
Wow that was quick! I didn't know about This works very well for me, many thanks! :-) |
I only learned about it yesterday too. Curiously it popped out as a first result, despite the fact I've spent several hours researching how Glad to be of help! |
Hello,
This is a followup to a beaupy issue.
I noticed that
get_key()
uses 100% of my cpu. To reproduce, use the code provided in the README:Python 3.11.5 on Linux, python-yakh==0.3.1 installed in a venv via pip as a dependency for beaupy.
The text was updated successfully, but these errors were encountered: