python2とpython3を使えるようにしよう

[vagrant@localhost ~]$ python -V
Python 3.5.2
[vagrant@localhost centos6]$ python
Python 3.5.2 (default, Jul 28 2018, 11:25:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>>
[vagrant@localhost centos6]$ python3
Python 3.5.2 (default, Jul 28 2018, 11:25:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

時間かかった~ 2日くらい

1
2
3
4
5
6
7
import urllib.request
 
savename = "test.png"
 
urllib.request.urlretrieve(url, savename)
print("保存しました")

[vagrant@localhost python]$ python3 app.py
保存しました

おおおお、
では、ヤフオクのmacbookを取得します。

[vagrant@localhost python]$ python3 app.py
mac book

OK

うん、ヤフオクだと、商品画像のアルゴリズムがよくわからんな。
img1100x983が画像サイズでしょうね。
6ba85c7e48fb6a8607eca71d0b7b7d6113140ce8
i-img1100x983-1532495826yzd18p69701.jpg