我正在尝试创建一个excel文件,并使用automagica
自动填充数据,但它不起作用。请帮我解决这个问题
这是我的代码:
from automagica import *
excel = Excel()
# Write to cell A1, this is column 1, row 1
excel.write_cell(1, 1, "Name")
# Write to cell, B1, this is column 2, row 1
excel.write_cell(2, 1, "Address")
# Write to cell, B1, this is column 3, row 1
excel.write_cell(3, 1, "Company")
# Write to cell A2, this is column 1, row 2
excel.write_cell(1, 2, generate_random_name())
# Write to cell A3, this is column 1, row 3
excel.write_cell(1, 3, generate_random_name())
# Write to cell A4, this is column 1, row 4
excel.write_cell(1, 4, generate_random_name())
# Write to cell A5, this is column 1, row 5
excel.write_cell(1, 5, generate_random_name())
# Write to cell A6, this is column 1, row 6
excel.write_cell(1, 6, generate_random_name())
# Write to cells B2, B3, B4, B5 and B6. This is row 2, cells 2 to 6
for i in range(2,7):
excel.write_cell(2,i,generate_random_address())
# Write to cell range C2:C6. This is row 3, cells 2 to 6
excel.write_range('C2:C6', "Example Company")
# Declare path to save it to, in this case in the homedir with the name "awesome_excel.xlsx"
excel_save_path = home_path(r'D:\suneel\WFH work\Automagica\awesome_excel.xlsx')
# Save the worksheet, by default this is in the homedir
excel.save_as(excel_save_path)
excel.quit()
open_file(excel_save_path)
错误:
提前谢谢
似乎内部的PIP存储库包被Netcall公司删除了,可能是他们让这个产品成为非免费的,并删除了它的源代码
只剩下空的pip包,这就是为什么模块仍然可以安装pip,但内部不包含任何源代码。据this history报道,10月16日,该包裹被拆除
但是这个PIP模块仍然有github项目,here。其来源也于10月13日被删除。但git历史记录并没有被删除,我将展示下一步如何从git以前的历史记录中安装pip模块
在命令行内(临时或可写目录中的某个位置)执行以下步骤:
这将最迟在源代码删除之前(ae8a184)提交git存储库
现在执行下一个命令(在签出的git存储库(文件夹
automagica
)中):这将从github存储库安装pip模块。完成了
注意。您可能还想将这个签出的git存储库(文件夹
automagica
)保存在您的归档文件中的某个地方,我相信,如果他们真的想关闭项目的源代码,公司很快也会删除这个git存储库如果上面的最后一个安装命令由于某种原因失败,请在签出的git存储库(文件夹
automagica
)中执行以下步骤:此命令将生成/复制项目源到PIP wheel包。如果命令成功,转到
./dist/
子文件夹,将有扩展名为.whl
的文件,如我的电脑上的Automagica-3.2.2-py3-none-any.whl
。只需通过下一个pip命令安装即可:最后一个命令在我的Windows PC上运行,之后
import automagica
在Python代码中运行相关问题 更多 >
编程相关推荐