python_basics
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| python_basics [2015/01/11 08:37] – 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 11: | Zeile 50: | ||
| === Case Statement === | === Case Statement === | ||
| < | < | ||
| - | # ------------- getRevision of Rasperry Board ------------- | ||
| - | def getrRevision(): | ||
| - | # Extract board revision from cpuinfo file | ||
| - | # 16 = B+ | ||
| - | myrevision = 0 | ||
| - | try: | ||
| - | f = open('/ | ||
| - | for line in f: | ||
| - | if line[0: | ||
| - | length=len(line) | ||
| - | myrevision = str(int(line[11: | ||
| - | f.close() | ||
| - | except: | ||
| - | myrevision = 0 | ||
| - | return myrevision | ||
| - | |||
| - | # ------------------- GPIO Check routines ----------------- | ||
| def gpio_OK(): return (True) | def gpio_OK(): return (True) | ||
| Zeile 61: | Zeile 83: | ||
| } | } | ||
| - | def check_GPIO(pin): | + | gpio_board[2]() |
| - | if getRevision < 16 and pin > 26: return False | + | |
| - | else return (gpio_board[pin]()) | + | |
| </ | </ | ||
python_basics.1420961871.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
