質問編集履歴

1

エラー内容を修正しました。

2019/10/09 02:05

投稿

raspypy
raspypy

スコア247

test CHANGED
File without changes
test CHANGED
@@ -22,11 +22,11 @@
22
22
 
23
23
  Traceback (most recent call last):
24
24
 
25
- File "5_BME280GDV.py", line 157, in <module>
25
+ File "5_BME280GDV.py", line 178, in <module>
26
-
26
+
27
- column_datas.append(datetime.now().strftime("%Y/%m/%d %H:%M:%S"))
27
+ column_datas.append("%7.2f" % (pressure/100))
28
-
28
+
29
- NameError: name 'datetime' is not defined
29
+ NameError: name 'pressure' is not defined
30
30
 
31
31
  ```
32
32
 
@@ -338,6 +338,10 @@
338
338
 
339
339
 
340
340
 
341
+ from datetime import datetime
342
+
343
+
344
+
341
345
  column_datas = []
342
346
 
343
347
 
@@ -358,7 +362,7 @@
358
362
 
359
363
  global column_datas
360
364
 
361
- filename = '/home/pi/abc/xxx.json'
365
+ filename = '/home/pi/xxx/abcde.json'
362
366
 
363
367
  client_email = "abcdef@gmail.com"
364
368
 
@@ -370,9 +374,9 @@
370
374
 
371
375
  gs = gspread.authorize(credentials)
372
376
 
373
- doc = gs.open('bme280_thp')
377
+ doc = gs.open('BME280')
374
-
378
+
375
- sheet = doc.worksheet("bme280")
379
+ sheet = doc.worksheet("BME280")
376
380
 
377
381
  sheet.append_row(column_datas)
378
382