How to import python. The sample is a download using ** urllib.request **.
sample.py
import urllib.request
#Specify the acquisition source URL and save file
url = "http://xxxx.xxx.xx/xx/xxx"
filename = "xxxxxx"
#download
urllib.request.urlretrieve(url, filename)
sample.py
import urllib.request as hoge
#Specify the acquisition source URL and save file
url = "http://xxxx.xxx.xx/xx/xxx"
filename = "xxxxxx"
#download
hoge.urlretrieve(url, filename)
sample.py
from urllib import request
#Specify the acquisition source URL and save file
url = "http://xxxx.xxx.xx/xx/xxx"
filename = "xxxxxx"
#download
request.urlretrieve(url, filename)
sample.py
from urllib import request as hoge
#Specify the acquisition source URL and save file
url = "http://xxxx.xxx.xx/xx/xxx"
filename = "xxxxxx"
#download
hoge.urlretrieve(url, filename)
Recommended Posts