【发布时间】:2022-01-04 06:59:20
【问题描述】:
所以我正在尝试制作一个下载工具来通过链接下载东西,这是我的代码中的一个 sn-p
if download_choice == "14":
print("Downloading test file to Desktop...")
myfile14 = requests.get(url14)
open('c:/users/%userprofile%/desktop/', 'wb').write(myfile14.content)
我想制作一个可以通过链接下载东西的程序。我希望它不仅可以在我的所有 PC 上运行。这是错误:
Traceback (most recent call last): File "C:\Users\David\Desktop\Windows Download Tool\Python\WDT.py", line 100, in <module> open('c:/users/%userprofile%/desktop/', 'wb').write(myfile14.content) FileNotFoundError: [Errno 2] No such file or directory: 'c:/users/%userprofile%/desktop/'
【问题讨论】:
-
@lema 这究竟是如何解决他的问题的?
-
@lema no i didn't.
-
重点是:真正的问题是什么?这段代码有什么问题(就结果而言)?你能指望什么?你的问题应该更准确
-
请提供更多信息
-
@Christophe 我想制作一个可以通过链接下载东西的程序。我希望它不仅可以在我的所有 PC 上运行。这是错误回溯(最近一次调用最后一次):文件“C:\Users\David\Desktop\Windows 下载工具\Python\WDT.py”,第 100 行,在
open('c:/users/% userprofile%/desktop/', 'wb').write(myfile14.content) FileNotFoundError: [Errno 2] No such file or directory: 'c:/users/%userprofile%/desktop/'