import excel2img
import os
def main(args):
pass
filename = r'D:\chanmama\蝉妈妈商品榜.xlsx'
def image():
# 如果文件路径为空,则使用当前工作目录
if not os.path.exists(filename):
print(f"文件不存在{filename}")
try:
print("开始截图")
excel2img.export_img(filename, r"D:\chanmama\蝉妈妈商品榜.png",None)
except :
print("【没有截图成功!!!】请检查excel文件路径名称是否正确!!!")
else:
print(f"文件保存在{os.path.dirname(filename)}")
image()
