Benutzer-Werkzeuge

Webseiten-Werkzeuge


python_basics

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
python_basics [2015/01/11 08:35] 192.168.1.61python_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://en.wikipedia.org/wiki/IDLE]]
 +==== PUDB debug====
 +
 +  * Doku [[https://documen.tician.de/pudb/]]
 +  * Install pudb debug
 +  * <code> sudo pip install pudb </code>
 +
 +  * identity tty ID: <code> tty </code>
 +  * call <code> PUDB_TTY=/dev/pts/0 pudb sensor.py </code>
 +  * batch file
 +  * <code>
 +       pudebug
 +       PUBTTY=`tty` echo "puDB- start in dir with source files"
 +       echo "Call with name of file to be debugged"
 +       echo "Call in window used for debugging"
 +       PUDB_TTY=`tty`  pudb $1 </code>
 +
 +
 +<code>
 +puDB commands
 +n – step over (“next”)
 +s – step into
 +c – continue
 +r/f – finish current function
 +t – run to cursor
 +o – show console/output screen
 +b – toggle breakpoint
 +m – open module
 +! – Jump into interactive shell (most useful)
 +/ – text search
 +</code>
 +
  
 ===== Online Manual ===== ===== Online Manual =====
Zeile 11: Zeile 50:
 === Case Statement === === Case Statement ===
 <code> <code>
-gpio_board = {1: gpio_3v, 2: gpio_5v, +def gpio_OK(): return (True) 
 + 
 +def gpio_ground(): return (-1) 
 + 
 +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,                3: gpio_OK, 4: gpio_5v, 
               5: gpio_OK, 6: gpio_ground,               5: gpio_OK, 6: gpio_ground,
               7: gpio_OK, 8 :gpio_OK,                7: gpio_OK, 8 :gpio_OK, 
               9 : gpio_ground, 10: gpio_OK,                9 : gpio_ground, 10: gpio_OK, 
-              11: gpio_OK, +              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, 26: gpio_OK, 
 +              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, 40: gpio_OK 
 +            } 
 + 
 +gpio_board[2]()  
 </code> </code>
  
python_basics.1420961735.txt.gz · Zuletzt geändert: (Externe Bearbeitung)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki