python_basics
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| python_basics [2015/01/01 12:53] – created 192.168.1.61 | python_basics [2022/01/09 14:41] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Python Basics ====== | ====== Python Basics ====== | ||
| + | |||
| + | |||
| + | ===== debug python ===== | ||
| + | |||
| + | linux | ||
| + | ==== idle ==== | ||
| + | |||
| + | idle [[https:// | ||
| + | ==== PUDB debug==== | ||
| + | |||
| + | * Doku [[https:// | ||
| + | * Install pudb debug | ||
| + | * < | ||
| + | |||
| + | * identity tty ID: < | ||
| + | * call < | ||
| + | * batch file | ||
| + | * < | ||
| + | | ||
| + | | ||
| + | echo "Call with name of file to be debugged" | ||
| + | echo "Call in window used for debugging" | ||
| + | | ||
| + | |||
| + | |||
| + | < | ||
| + | puDB commands | ||
| + | n – step over (“next”) | ||
| + | s – step into | ||
| + | c – continue | ||
| + | r/f – finish current function | ||
| + | t – run to cursor | ||
| + | o – show console/ | ||
| + | b – toggle breakpoint | ||
| + | m – open module | ||
| + | ! – Jump into interactive shell (most useful) | ||
| + | / – text search | ||
| + | </ | ||
| + | |||
| ===== Online Manual ===== | ===== Online Manual ===== | ||
| Zeile 5: | Zeile 44: | ||
| Python 3 [[https:// | Python 3 [[https:// | ||
| + | ==== Tutorial ==== | ||
| + | [[http:// | ||
| + | |||
| + | ==== Examples ==== | ||
| + | === Case Statement === | ||
| + | < | ||
| + | def gpio_OK(): return (True) | ||
| + | |||
| + | def gpio_ground(): | ||
| + | |||
| + | def gpio_3v(): return (3) | ||
| + | |||
| + | def gpio_5v(): return (5) | ||
| + | |||
| + | def gpio_I2C(): return (10) | ||
| + | |||
| + | gpio_board= { | ||
| + | 1: gpio_3v, 2: gpio_5v, | ||
| + | 3: gpio_OK, 4: gpio_5v, | ||
| + | 5: gpio_OK, 6: gpio_ground, | ||
| + | 7: gpio_OK, 8 : | ||
| + | 9 : gpio_ground, | ||
| + | 11: gpio_OK, 12: gpio_OK, | ||
| + | 13: gpio_OK, 14: gpio_ground, | ||
| + | 15: gpio_OK, 16: gpio_OK, | ||
| + | 17: gpio_3v, 18: gpio_OK, | ||
| + | 19: gpio_OK, 20: gpio_ground, | ||
| + | 21: gpio_OK, 22: gpio_OK, | ||
| + | 23: gpio_OK, 24: gpio_OK, | ||
| + | 25: gpio_ground, | ||
| + | 27: gpio_I2C, 28: gpio_I2C, | ||
| + | 29: gpio_OK, 30: gpio_ground, | ||
| + | 31: gpio_OK, 35: gpio_OK, | ||
| + | 33: gpio_OK, 34: gpio_ground, | ||
| + | 35: gpio_OK, 36: gpio_OK, | ||
| + | 37: gpio_OK, 38: gpio_OK, | ||
| + | 39: gpio_ground, | ||
| + | } | ||
| + | |||
| + | gpio_board[2]() | ||
| + | |||
| + | </ | ||
python_basics.1420113237.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
