简体   繁体   English

有没有办法在 excel 中运行 python 脚本来更新单元格范围?

[英]Is there a way to run a python script to in excel to update a cell range?

I have a web scraper script in python that clicks and downloads a csv file from a website.我在 python 中有一个 web刮板脚本,它点击并从网站下载 csv 文件。

I would like to:我想:

  1. Pass a parameter from excel to trigger the python script based on user selection从 excel 传递一个参数以根据用户选择触发 python 脚本

  2. trigger the download/web scraper script from Excel and then populate the cell range concerned based on the downloaded fileExcel触发下载/网络爬虫脚本,然后根据下载的文件填充相关的单元格范围

Welcome to other solutions other than what I have now.欢迎使用我现在拥有的其他解决方案。

Maybe your python code should read your excel spreadsheet and act upon the changes.也许您的 python 代码应该阅读您的 excel 电子表格并根据更改采取行动。 Might want to check https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html .可能要检查https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html A more straightforward solution might exist, thou.你可能存在更直接的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM