나는 webiopi로 데이터베이스 작업에 문제가있다. 나는 이미 sqlite3을 가져오고 폴더 권한을 변경하지만 webiopi를 실행하면 아무것도 생성되지 않았습니다. 그러나 f.write('This is a test\n')
이후의 다른 모든 기능은 정상적으로 작동하고 루프를 반복합니다. 너 내가 도와 줄 수 있길 바래? Webiopi (Raspberry pi) with sql or sqlite
def loop():
db = sqlite3.connect('schedule.db')
db.execute('DROP TABLE IF EXISTS schedule')
db.execute('CREATE TABLE schedule (hour int, minute int, second int, status text)')
db.execute('INSERT INTO schedule (hour,minute,second,status) VALUES (?,?,?,?)',(sche.get('hour'),sche.get('minute'),sche.get('second'),"yes"))
db.commit()
f = open('workfile', 'w')
f.write('This is a test\n')
loop1=1
while ((now.minute >= minute_ON) and (now.minute < minute_OFF) and (loop1<stepping)):
step()
loop1=loop1+1
는
아무 것도 만들지 않았다는 것을 의미합니까? 파일 workfile 또는 schedule.db 파일? –
둘 다. 스테핑 모터를 제어하는 데 사용하는 단계()는 잘 작동하므로 데이터베이스 또는 텍스트 파일이 생성되지 않은 이유를 정말로 혼동합니다. – Pound19