mirror of
https://github.com/micropython/micropython.git
synced 2025-07-21 21:11:12 +02:00
This adds a separate `AdvancedTimer` class that demonstrates a few more advanced concepts usch as custom handlers for printing and attributes. Signed-off-by: Laurens Valk <laurens@pybricks.com>
18 lines
269 B
Python
18 lines
269 B
Python
# test custom builtin module
|
|
|
|
try:
|
|
import cexample
|
|
except ImportError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
print(cexample)
|
|
print(cexample.__name__)
|
|
|
|
d = dir(cexample)
|
|
d.index("add_ints")
|
|
d.index("Timer")
|
|
d.index("AdvancedTimer")
|
|
|
|
print(cexample.add_ints(1, 3))
|