''' Purpose: determine the hidden super power of a CS 1112 person ''' # need help to get web data - so import the capability from urllib.request import urlopen # define the base folder for course participants BASE_PEOPLE_URL = 'http://www.cs.virginia.edu/~cs1112/people/' # get computing id of interest reply = input( 'Enter computing id: ' ) # clean up the reply to get the user id user_id = reply.strip() user_id = user_id.lower() # specify web folder of indicated person web_folder = BASE_PEOPLE_URL + user_id + '/' #you dont want your code going all the way over here cuz someone will have to read it later. # specify link for super power web file of indicated person link = web_folder + 'my-power.txt' #print( link ) # get a connection to stream the web resource of interest stream = urlopen( link ) # read stream to get the contents of the page content = stream.read() # decode contents into plain text form text = content.decode( 'UTF-8' ) # text is the superpower of interest power = text # print power print( power )