Closed spuliaiev-sfdc closed 1 year ago
Not sure if it need to be extracted into a different file like readchar_mac.py Please advise @magmax
============================================= test session starts ==============================================
platform darwin -- Python 3.9.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /Users/spuliaiev/work/py/python-readchar, configfile: setup.cfg
plugins: cov-3.0.0
collected 9 items
tests/unit/test_key.py .... [ 44%]
tests/unit/test_readkey.py ..... [100%]
---------- coverage: platform darwin, python 3.9.9-final-0 -----------
Name Stmts Miss Cover Missing
------------------------------------------------------------
readchar/__init__.py 3 0 100%
readchar/key.py 59 0 100%
readchar/readchar.py 38 20 47% 8, 11-17, 30-80
readchar/readchar_linux.py 11 7 36% 11-18
readchar/readchar_windows.py 12 12 0% 5-27
------------------------------------------------------------
TOTAL 123 39 68%
============================================== 9 passed in 0.07s ===============================================
hmm ..if this fixes https://github.com/magmax/python-readchar/issues/51 , please merge.
@AndKe I have no permissions to do that.
Only those with write access to this repository can merge pull requests.
I hoped to get the attention of one of those who can.
@andreatulimiero @magmax @jhonatan-lopes Could you please take a look?
@magmax Would you please take a look?
HI @spuliaiev-sfdc, I'm not a maintainer on this repo. I'm afraid that @magmax is the person you're looking for to review and close the PR.
@spuliaiev-sfdc @AndKe
is anyone still interested in this? is the behaviour still the same with the new v4.0.0
that is currently in pre-release?
Yes
On Sun, Jul 31, 2022 at 12:12 PM Jan Wille @.***> wrote:
@spuliaiev-sfdc https://github.com/spuliaiev-sfdc @AndKe https://github.com/AndKe
is anyone still interested in this?
— Reply to this email directly, view it on GitHub https://github.com/magmax/python-readchar/pull/70#issuecomment-1200454105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3BL5OP3ERL6VNXPCY7LG3VW2QVXANCNFSM5MOEINDQ . You are receiving this because you were mentioned.Message ID: @.***>
-- Sergii Puliaiev Workspace Engineering Team Lead Software Engineer
OK, so than I need some information to properly understand this.
First of all, is the behavior still the same with the current code from v4.0.0-dev
? (should be same but still..)
Than, using sys.stdin.readline(1)
instead or read(1)
should mean that readchar no waits until enter is pressed instead of imeadiadly processing the keypress.
Is that the case? How is it behaving? Please test with the script found in tests/manual-test.py
:
a
, 0
, UP
, etc..
python yourScript.py
readline(1)
? What happens if you press a
, 0
, UP
, etc..
python yourScript.py
Screenshots would help a lot :+1:
@Cube707 - This is what I am getting now:
@AndKe I can not reproduce. This works as expected on Linux/Windows:
import readchar
k = readchar.readkey()
print(k)
If you don't find an issue on your end, please open a seperate issue with more details.
Just a thought: the prolem might come from your file beeing named readchar.py
. This doesn't pose problems for me, but might explain the circular import.
@AndKe I just found the problem. it is indeed the filename readchar.py
. Naming the file the same as a imported module will result in a circular import.
closing due to inactivity.
I notices that when we use this library with enabled debug with PyCharm on MacOS it hangs while requesting the input. Does not matter if the script run in the PyCharm internal terminal, iTerm2 terminal or native MacOS terminal app.