'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:

import pandas as pd

!wget abc.com/sales.csv

If I want to use PyCharm to download the above internet file, wget is not recognized. So which command should I use to download this file?



Solution 1:[1]

Thanks a lot for Regressor's hints! Here is what I test to be successful to share in case anyone meets this issue:

(1) install wget in package in PyCharm

File->Settings->Project->Python Interpreter->+->Input: wget->Install Package

(2) Run the following command

import wget
url = 'abc.com/sales.csv'
filename = wget.download(url)
print(filename)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Blue Sea