我試圖計算那些打破激光束(硬件工作)然后發(fā)布到谷歌表格的人。法典:############################################################ People Counter v1-1 ##################################################################################################Setting up Python Modules####################################import RPi.GPIO as GPIOimport os, time##################################### Setting up GPIO pins #####################################RECEIVER_PIN = 23######################################Setting up Counters ######################################peoplecount = 0uploadcount = 0door = 1 # <- Use this to designate multiple doors for trackinglocation = 'Entry' # <- Use this to designate multiple locations for tracking in one formrpitemp = 'vcgencmd measure_temp | cut -c6-7' # Temperatur vom RPidef callback_func(channel): if GPIO.input(channel): print("Lichtschranke wurde unterbrochen")## This waits for a specified minute of the hour, checks if anyone has been detected since the last upload, then uploads the data to a Google Form.變量似乎不發(fā)送任何數據。如果我不發(fā)送表格,它的工作原理。任何人都可以幫助我,或者有更好的方法嗎?%s
1 回答

汪汪一只貓
TA貢獻1898條經驗 獲得超8個贊
我認為您正在使用瀏覽器模塊打開URL。如果是這樣,您尚未導入瀏覽器模塊。因此,這就是為什么它拋出異常并且打印無法訪問頁面的原因
from mechanize import Browser br = Browser()
使用 PIP 安裝模塊,并在代碼開頭添加此模塊。這應該會有所幫助
添加回答
舉報
0/150
提交
取消