python_basics
Inhaltsverzeichnis
Python Basics
debug python
linux
idle
PUDB debug
- Install pudb debug
sudo pip install pudb
- identity tty ID:
tty
- call
PUDB_TTY=/dev/pts/0 pudb sensor.py
- batch file
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
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
Online Manual
Python 2.7 https://docs.python.org/2/
Python 3 https://docs.python.org/3/
Tutorial
Examples
Case Statement
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,
5: gpio_OK, 6: gpio_ground,
7: gpio_OK, 8 :gpio_OK,
9 : gpio_ground, 10: 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]()
python_basics.txt · Zuletzt geändert: von 127.0.0.1
