[英]How to download a file in PyCharm instead of !wget in Colab? [duplicate]
When I try some codes in pandas, the bash code wget is used in colab as the following:当我在 pandas 中尝试一些代码时,bash 代码 wget 在 colab 中使用如下:
import pandas as pd
!wget abc.com/sales.csv
If I want to use PyCharm to download the above inte.net file, wget is not recognized.如果我想用PyCharm下载上面的inte.net文件,wget是无法识别的。 So which command should I use to download this file?那么我应该使用哪个命令来下载这个文件呢?
Thanks a lot for Regressor's hints: Here is what I test to be successful to share in case anyone meets this issue:非常感谢 Regressor 的提示:以下是我测试成功分享的内容,以防有人遇到此问题:
(1) install wget in package in PyCharm (1)在PyCharm中安装wget in package
File->Settings->Project->Python Interpreter->+->Input: wget->Install Package文件->设置->项目->Python解释器->+->输入:wget->安装Package
(2) Run the following command (2)运行以下命令
import wget
url = 'abc.com/sales.csv'
filename = wget.download(url)
print(filename)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.