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)