質問編集履歴

2

インデントを適切にした

2019/10/11 03:12

投稿

mahc
mahc

スコア33

test CHANGED
File without changes
test CHANGED
@@ -22,25 +22,25 @@
22
22
 
23
23
  (import+ssh接続+sql接続)
24
24
 
25
- Z_1 = np.array(3.6515*(-2)*(X_1)*(np.cos(data_1))+450.55*(np.cos(data_1)))
25
+ Z_1 = np.array(3.6515*(-2)*(X_1)*(np.cos(data_1))+450.55*(np.cos(data_1)))
26
26
 
27
27
 
28
28
 
29
- sql2 = 'INSERT INTO *** (A,B,C,D,E,F,G,H,I,J,K,L) VALUE (1,1,1,1,1,1,1,1,'+str(Z_1)+',12,1,NOW()))';
29
+ sql2 = 'INSERT INTO *** (A,B,C,D,E,F,G,H,I,J,K,L) VALUE (1,1,1,1,1,1,1,1,'+str(Z_1)+',12,1,NOW()))';
30
30
 
31
31
 
32
32
 
33
- try:
33
+ try:
34
34
 
35
- with cnn.cursor() as cursor:
35
+ with cnn.cursor() as cursor:
36
36
 
37
- cursor.execute(sql2)
37
+ cursor.execute(sql2)
38
38
 
39
- cnn.commit()
39
+ cnn.commit()
40
40
 
41
- except:
41
+ except:
42
42
 
43
- True
43
+ True
44
44
 
45
45
 
46
46
 

1

追記した

2019/10/11 03:12

投稿

mahc
mahc

スコア33

test CHANGED
File without changes
test CHANGED
@@ -50,6 +50,8 @@
50
50
 
51
51
  finally:
52
52
 
53
+ cnn.commit()
54
+
53
55
  cnn.close()
54
56
 
55
57
  server.stop()