CPU Cooling (CPU散熱) (P.48) <<
Previous Next >> HW3
HW2
# use "python read url file data" search"
# get "https://stackoverflow.com/questions/1393324/given-a-url-to-a-text-file-what-is-the-simplest-way-to-read-the-contents-of-the"
# since we use python 3 therefore try to use the following script to get cp1a list
import urllib.request # the lib that handles the url stuff
target_url = "https://nfulist.herokuapp.com/?semester=1091&courseno=0762"
cp1a = []
for line in urllib.request.urlopen(target_url):
cp1a.append(line.decode('utf-8'))
#print(line.decode('utf-8'), end = "") #utf-8 or iso8859-1 or whatever the page encoding scheme is
print(cp1a)
# need to chop \n for each line
CPU Cooling (CPU散熱) (P.48) <<
Previous Next >> HW3