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:37] 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>
-# ------------- getRevision of Rasperry Board ------------- 
-def getrRevision(): 
-  # Extract board revision from cpuinfo file 
-  # 16 = B+ 
-  myrevision = 0 
-  try: 
-    f = open('/proc/cpuinfo','r') 
-    for line in f: 
-      if line[0:8]=='Revision': 
-        length=len(line) 
-        myrevision = str(int(line[11:length-1], 16)) 
-    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]()+
  
 </code> </code>
  
python_basics.1420961871.txt.gz · Zuletzt geändert: (Externe Bearbeitung)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki