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

keyboard_and_audio not working in notebook #13

Open
thorwhalen opened this issue Oct 19, 2021 · 1 comment
Open

keyboard_and_audio not working in notebook #13

thorwhalen opened this issue Oct 19, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@thorwhalen
Copy link
Member

thorwhalen commented Oct 19, 2021

Running keyboard_and_audio in terminal works, but
when in (DataSpell) notebook, I get the following error.

from stream2py.examples.usage.keyboard_and_audio import keyboard_and_audio

keyboard_and_audio()

Gets me too...

Exception in thread Thread-8:
Traceback (most recent call last):
  File "/Users/Thor.Whalen/Dropbox/dev/p3/proj/i/stream2py/stream2py/utility/getch.py", line 11, in __init__
    self.impl = _GetchWindows(is_blocking)
  File "/Users/Thor.Whalen/Dropbox/dev/p3/proj/i/stream2py/stream2py/utility/getch.py", line 75, in __init__
    import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Thor.Whalen/.pyenv/versions/3.8.6/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Users/Thor.Whalen/Dropbox/dev/p3/proj/i/stream2py/stream2py/sources/keyboard_input.py", line 61, in run
    from stream2py.utility.getch import getch
  File "/Users/Thor.Whalen/Dropbox/dev/p3/proj/i/stream2py/stream2py/utility/getch.py", line 100, in <module>
    getch = _Getch()
  File "/Users/Thor.Whalen/Dropbox/dev/p3/proj/i/stream2py/stream2py/utility/getch.py", line 13, in __init__
    self.impl = _GetchUnix(is_blocking)
  File "/Users/Thor.Whalen/Dropbox/dev/p3/proj/i/stream2py/stream2py/utility/getch.py", line 27, in __init__
    self.old_settings = termios.tcgetattr(self.fd)
termios.error: (25, 'Inappropriate ioctl for device')

┆Issue is synchronized with this Asana task by Unito

@andeaseme
Copy link
Member

The same problem occurs when using in Pycharm IDE's built in terminal.
stream2py/utility/getch.py only supports windows and unix terminals that support character captures with msvcrt or termios modules . _Getch can be extended to support more if you want to look into it. I don't know how much effort it will take.

@andeaseme andeaseme added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 20, 2021
@andeaseme andeaseme removed their assignment Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants