Skip to content

Simple, cross-platform, pure Python way of reading stdin without blocking

Notifications You must be signed in to change notification settings

damionmounts/py_nonblocking_input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

py_nonblocking_input

Simple, cross-platform, pure Python way of reading stdin without blocking


Pros

  • Single file
  • Single class
  • Single thread
  • Documented
  • Simple to use
  • Typed - as it brings more light to dynamic typed returns
  • Cross-platform (any platform that can run a 2nd thread)
  • Pure Python

Cons

  • Requires setup at start of program (simple)
u = NonBlockingStdIn()
  • Requires teardown at end of program (simple)
u.kill()
  • Does not enforce the fact that only a single instance should ever exist (at once)
    • Properly killing an old instance and then creating a new one is fine
    • Its singleton nature may be realized in code in a future commit
a = NonBlockingStdIn()
b = NonBlockingStdIn()
# This is a journey of pain that leads to multiple threads fighting over stdin using input()

About

Simple, cross-platform, pure Python way of reading stdin without blocking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages