[python] - get source form url

Method : urlopen() , read()

[code]
#!/usr/bin/python
import urllib
import sys

url = sys.argv[1]
web_source = urllib.urlopen(url)
source_read = web_source.read()
[/code]


หรือจะต่อ method read() ไว้หลัง urlopen() เลยก็ได้
( สิ่งนี้แหละที่ทำให้ผมเริ่มหลงรัก Python ในวันเดียว
เหมือนกับโค้ดบรรทัดเดียวที่ python หาคำตอบให้ผมได้เช่นกัน )

[code]
web_source = urllib.urlopen(url).read()
print web_source
[/code]