質問編集履歴
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -76,6 +76,8 @@
|
|
76
76
|
|
77
77
|
### コード挿入
|
78
78
|
|
79
|
+
```python
|
80
|
+
|
79
81
|
import gspread
|
80
82
|
|
81
83
|
|
@@ -144,6 +146,10 @@
|
|
144
146
|
|
145
147
|
|
146
148
|
|
149
|
+
```
|
150
|
+
|
151
|
+
|
152
|
+
|
147
153
|
### 試したこと
|
148
154
|
|
149
155
|
pythonと連携させてexcelからスプレッドシートにとってくる方法を選びました
|
2
情報不足のため
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,9 +4,77 @@
|
|
4
4
|
|
5
5
|
### 発生している問題・エラーメッセージ
|
6
6
|
|
7
|
+
Traceback (most recent call last):
|
8
|
+
|
9
|
+
File "c:/Users/y-shimoda/Desktop/python 試し/copy01.py", line 29, in <module>
|
10
|
+
|
11
|
+
wks.update_cell(row=1,col=2,value=copy)
|
12
|
+
|
13
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\gspread\models.py", line
|
14
|
+
|
15
|
+
data = self.spreadsheet.values_update(
|
16
|
+
|
17
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\gspread\models.py", line
|
18
|
+
|
19
|
+
r = self.client.request('put', url, params=params, json=body)
|
20
|
+
|
21
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\gspread\client.py", line
|
22
|
+
|
23
|
+
response = getattr(self.session, method)(
|
24
|
+
|
25
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", li
|
26
|
+
|
27
|
+
return self.request('PUT', url, data=data, **kwargs)
|
28
|
+
|
29
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\google\auth\transport\req
|
30
|
+
|
31
|
+
response = super(AuthorizedSession, self).request(
|
32
|
+
|
33
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", li
|
34
|
+
|
35
|
+
prep = self.prepare_request(req)
|
36
|
+
|
37
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", li
|
38
|
+
|
39
|
+
p.prepare(
|
40
|
+
|
41
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line
|
42
|
+
|
43
|
+
self.prepare_body(data, files, json)
|
44
|
+
|
45
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line
|
46
|
+
|
47
|
+
body = complexjson.dumps(json)
|
48
|
+
|
49
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\simplejson\__init__.py",
|
50
|
+
|
51
|
+
return _default_encoder.encode(obj)
|
52
|
+
|
53
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\simplejson\encoder.py", l
|
54
|
+
|
55
|
+
chunks = list(chunks)
|
56
|
+
|
57
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\simplejson\encoder.py", l
|
58
|
+
|
59
|
+
for chunk in _iterencode_dict(o, _current_indent_level):
|
60
|
+
|
61
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\simplejson\encoder.py", l
|
62
|
+
|
63
|
+
for chunk in chunks:
|
64
|
+
|
65
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\simplejson\encoder.py", l
|
66
|
+
|
67
|
+
o = _default(o)
|
68
|
+
|
69
|
+
File "C:\Users\y-shimoda\AppData\Local\Programs\Python\Python38\lib\site-packages\simplejson\encoder.py", line 272, in default
|
70
|
+
|
71
|
+
raise TypeError('Object of type %s is not JSON serializable' %
|
72
|
+
|
7
|
-
TypeError: Object of type Cell is not JSON serializable
|
73
|
+
TypeError: Object of type Cell is not JSON serializable
|
8
|
-
|
74
|
+
|
75
|
+
|
76
|
+
|
9
|
-
###
|
77
|
+
### コード挿入
|
10
78
|
|
11
79
|
import gspread
|
12
80
|
|
@@ -26,7 +94,7 @@
|
|
26
94
|
|
27
95
|
#スプレッドシート選択
|
28
96
|
|
29
|
-
credentials = ServiceAccountCredentials.from_json_keyfile_name('
|
97
|
+
credentials = ServiceAccountCredentials.from_json_keyfile_name('2020.json', scope)
|
30
98
|
|
31
99
|
gc = gspread.authorize(credentials)
|
32
100
|
|
@@ -50,7 +118,7 @@
|
|
50
118
|
|
51
119
|
#コピーするワークシート選択
|
52
120
|
|
53
|
-
wb=load_workbook('
|
121
|
+
wb=load_workbook('管理表 (5).xlsx')
|
54
122
|
|
55
123
|
ws1=wb['id']
|
56
124
|
|
1
誤字訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
### 発生している問題・エラーメッセージ
|
6
6
|
|
7
|
-
TypeError: Object of type Cell is not JSON serializable
|
7
|
+
TypeError: Object of type Cell is not JSON serializableエラーが出て困っています
|
8
8
|
|
9
9
|
### 該当のソースコード
|
10
10
|
|
@@ -80,9 +80,9 @@
|
|
80
80
|
|
81
81
|
pythonと連携させてexcelからスプレッドシートにとってくる方法を選びました
|
82
82
|
|
83
|
-
しかしpythonからexcel操作、pythonからスプレッドシートならうまく動くのですがまとめるとどうもうまく作動しません
|
83
|
+
しかしpythonからexcel操作、pythonからスプレッドシートならうまく動くのですがまとめるとどうもうまく作動しません.
|
84
84
|
|
85
|
-
|
85
|
+
|
86
86
|
|
87
87
|
|
88
88
|
|