質問編集履歴
3
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -25,35 +25,5 @@
|
|
25
25
|
|
26
26
|
``python
|
27
27
|
|
28
|
-
#!/usr/bin/python
|
29
|
-
# -*- coding: utf-8 -*-
|
30
|
-
import gspread
|
31
|
-
import MyPyDHT
|
32
|
-
import datetime
|
33
|
-
from oauth2client.service_account import ServiceAccountCredentials
|
34
28
|
|
35
|
-
humidity, temperature = MyPyDHT.sensor_read(MyPyDHT.Sensor.DHT22, 15)
|
36
|
-
|
37
|
-
dt_now = datetime.datetime.now()
|
38
|
-
print(dt_now.strftime('%Y年%m月%d日 %H:%M:%S'))
|
39
|
-
|
40
|
-
# 結果の表示
|
41
|
-
print("Temp=" + str(temperature) + "*C, Humidity = " + str(humidity) + "%")
|
42
|
-
|
43
|
-
|
44
|
-
key_name = ''
|
45
|
-
sheet_name = ''
|
46
|
-
|
47
|
-
#APIにログイン
|
48
|
-
scope = []
|
49
|
-
|
50
|
-
workbook = gc.open_by_key('')
|
51
|
-
worksheet = workbook.sheet1
|
52
|
-
|
53
|
-
datas = [dt_now.strftime('%Y年%m月%d日 %H:%M:%S'), str(temperature) + "*C",str(humidity) + "%" ]
|
54
|
-
worksheet.append_row(datas)
|
55
|
-
|
56
|
-
for row_data in datas:
|
57
|
-
worksheet.append_row(row_data)
|
58
|
-
|
59
29
|
```
|
2
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,9 +23,8 @@
|
|
23
23
|
|
24
24
|
### 該当のソースコード
|
25
25
|
|
26
|
-
``
|
26
|
+
``python
|
27
|
-
|
27
|
+
|
28
|
-
```
|
29
28
|
#!/usr/bin/python
|
30
29
|
# -*- coding: utf-8 -*-
|
31
30
|
import gspread
|
@@ -55,4 +54,6 @@
|
|
55
54
|
worksheet.append_row(datas)
|
56
55
|
|
57
56
|
for row_data in datas:
|
58
|
-
worksheet.append_row(row_data)
|
57
|
+
worksheet.append_row(row_data)
|
58
|
+
|
59
|
+
```
|
1
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
gspreadのappend_rowを使用した時に
|
1
|
+
gspreadのappend_rowを使用した時に発生するエラーについて
|
body
CHANGED
File without changes
|