From 9048cb59959142d0c2ca340dc1ec123f96cd4457 Mon Sep 17 00:00:00 2001 From: qqhsx <56535272+qqhsx@users.noreply.github.com> Date: Sat, 25 May 2024 16:26:43 +0800 Subject: [PATCH] Update popularity.py --- popularity.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/popularity.py b/popularity.py index fc24cd43..22b82362 100644 --- a/popularity.py +++ b/popularity.py @@ -1,4 +1,12 @@ import pywencai -res = pywencai.get(question='退市股票', loop=True) -res.to_csv('问财.csv', index=False, encoding='utf-8-sig') + +# 定义变量 +query = '退市股票' +filename = f'{query}.csv' + +# 使用变量进行查询和保存结果 +res = pywencai.get(question=query, loop=True) +res.to_csv(filename, index=False, encoding='utf-8-sig') + +# 打印结果 print(res)