質問編集履歴

1

最終コード追加

2021/05/18 15:12

投稿

yujin1202
yujin1202

スコア61

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,44 @@
54
54
 
55
55
 
56
56
 
57
+ <後日の解決策>
58
+
59
+ ppaulさんのコメントの通り、Pythonの標準機能のf文字列で処理できました。
60
+
61
+ エクセル上で、TEXTJOIN関数を使い、["ck1","ck2","ck3","ck4",・・・・・ck18","ck19","ck20"]とかを編集する必要はありましたが。。。
62
+
63
+
64
+
65
+ 下記が、Pythonコードになります。(これを走らせると、テキストファイルが自動で量産できます。)
66
+
67
+ ```ここに言語を入力
68
+
69
+ i=0
70
+
71
+ for i in range(20):
72
+
73
+ id = ["ck1","ck2","ck3","ck4","ck5","ck6","ck7","ck8","ck9","ck10","ck11","ck12","ck13","ck14","ck15","ck16","ck17","ck18","ck19","ck20"]
74
+
75
+ country = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua & Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize"]
76
+
77
+ pattern = '''
78
+
79
+ <div>
80
+
81
+ <label for={}>{}:</label>
82
+
83
+ <input type="checkbox" id="{}" name="checkbox" value="{}">
84
+
85
+ </div>'''
86
+
87
+
88
+
89
+ print(pattern.format(id[i], country[i], id[i], country[i]))
90
+
91
+ i=i+1
92
+
93
+ ```
94
+
57
95
 
58
96
 
59
97