首先就是 工程中的目录非常多.不能使用绝对路径. 只能使用相对路径.

 

我工程的目录:

 

 

python 在工程中处理相对路径的思考

root_dir = os.path.dirname(os.path.abspath('.')) ## 获取相对目录
  

 

 

  fundpool_path = root_dir + '/stock/st_pool/get_fund_data/基金池.csv'
这是组合成的相对路径.

相关文章:

  • 2021-11-22
  • 2022-02-18
  • 2022-12-23
  • 2021-11-13
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-07-07
  • 2021-08-07
  • 2022-12-23
相关资源
相似解决方案