在文件"最前方"加上
#coding=utf-8
2015年6月7日 星期日
樹莓派顯示讀取Arduino
$ nano readline.py
#!/usr/bin/env python
import serial
import time
def readlineCR(port):
rv = ""
while True:
ch = port.read()
rv += ch
if ch=='\r' or ch=='':
return rv
port = serial.Serial("/dev/ttyACM0", baudrate=38400, timeout=3.0)
while True :
rcv = readlineCR(port)
print(rcv)
#!/usr/bin/env python
import serial
import time
def readlineCR(port):
rv = ""
while True:
ch = port.read()
rv += ch
if ch=='\r' or ch=='':
return rv
port = serial.Serial("/dev/ttyACM0", baudrate=38400, timeout=3.0)
while True :
rcv = readlineCR(port)
print(rcv)
Python 連接 MySQL 設定、安裝與一些智障錯誤
安裝 MySQLdb
Download (官方網站下載 最新版)
MySQL-python-1.2.4b4.tar.gz Download (官方網站下載 版本:1.2.4b4)
MySQL-python-1.2.4b4.tar.gz Download (ge.tt下載 版本:1.2.4b4)
Download (官方網站下載 最新版)
MySQL-python-1.2.4b4.tar.gz Download (官方網站下載 版本:1.2.4b4)
MySQL-python-1.2.4b4.tar.gz Download (ge.tt下載 版本:1.2.4b4)
訂閱:
文章 (Atom)