mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
14 lines
376 B
Python
14 lines
376 B
Python
#!/usr/bin/env python
|
|
import sys
|
|
|
|
download_url = sys.argv[1]
|
|
output_filename = sys.argv[2]
|
|
if (sys.version_info > (3, 0)):
|
|
import urllib.request
|
|
urllib.request.urlretrieve(download_url, output_filename)
|
|
else:
|
|
import urllib2
|
|
response = urllib2.urlopen(download_url)
|
|
with open(output_filename, 'w') as output_file:
|
|
output_file.write(response.read())
|