Console Standard
console_std - Console IO implementation using stdin/stdout.
This module implements the following functions for console IO using sys.stdin and sys.stdin. Select polling is used for non-blocking input.
- console_init
- console_write
- console_writeln
- console_read
If you import this module using from console_std import *
then you can
get these function names directly into the namespace and will not need to
use the module.fn notation.
console_init()
Initialize serial IO console.
This should be called once at the start of the application. It performs any initialization needed for this implementation of a serial console.
Source code in ledstrip/console_std.py
37 38 39 40 41 42 43 44 45 |
|
console_read() -> str
Read available characters from the console input.
Returns a string with any characters that were read from the console input,
or None
if there was nothing available.
Returns:
Type | Description |
---|---|
str
|
string of one or more characters, or None. |
Source code in ledstrip/console_std.py
69 70 71 72 73 74 75 76 77 78 79 80 |
|
console_write(printstr: str) -> None
Write a string to the console.
Tha string parameter is written to the console without interpretation or adding any line terminators.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
printstr
|
str
|
the string to be printed to the console |
required |
Source code in ledstrip/console_std.py
47 48 49 50 51 52 53 54 55 |
|
console_writeln(printstr: str) -> None
Write a string to the console with line terminator.
This performs the same function as console_write
except that it also
add a line ending.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
printstr
|
str
|
the string to be printed to the console |
required |
Source code in ledstrip/console_std.py
58 59 60 61 62 63 64 65 66 67 |
|