从多个 url 中提取图像

发布于 2025-01-15 21:48:46 字数 88 浏览 1 评论 0原文

我想每秒从不同的网址(在 csv 文件中)下载图像。

我可以下载图像。然而,我的代码每秒都会重写图像。我如何每次用不同的名称编写它们,以免覆盖图像?

I want to download images from differenturls (in the csv file) every second.

I can download the images. However, my code over writes the images after every second. How do I write them with different names each time so that it does not overwrite the images?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与之呼应 2025-01-22 21:48:46

正如您所提到的,您每三秒下载一次图像。我建议您在图像名称之前添加当前时间(以秒为单位)。

from datetime import datetime
now = datetime.now()
filename = now . filename

我只是给你一个想法。您可以按照自己的风格实现代码。

我这里可能有语法错误,因为我不是 python 开发人员。但是,我希望你能明白。

As you've mentioned you're downloading images every three seconds. I would suggest you add the current time in seconds format before your image name.

from datetime import datetime
now = datetime.now()
filename = now . filename

I'm just giving you the idea. You can implement your code in your own style.

I might have a syntax error here as I'm not a python-dev. But, I hope you get the idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文