经典方法:
https://docs.python.org/3/library/configparser.html
最简单的方法:
新建一个.py文件例如:input_keyword.py
# test/input_keyword.py# python的配置文件# 形式:key=valuename='知识图谱'startTime=2010endTime=2019currentpage=2
在另一个.py文件(test_properties.py)中import,文件:input_keyword.py ```python
test/test_properties.py
引入python配置文件input_keyword.py
import input_keyword
直接通过input_keyword.key的方式获取value值
print(input_keyword.name)
3. 显示结果:```bashF:\MyCode\git_repositories\spider\fund_from_LetPub\venv\Scripts\python.exe F:/MyCode/git_repositories/spider/fund_from_LetPub/test/test_properties.py知识图谱Process finished with exit code 0
附录
input_keyword.py文件
test_properties.py文件及结果

