All pastes #70518 Raw Edit

Someone

public python v1 · immutable
#70518 ·published 2006-06-24 11:20 UTC
rendered paste body
import os,sys,re,urllib#NZB_ = {'Details':[], 'Genre':[], 'Year':[], 'Tagline':[], 'Plot':[], 'Rating':[], 'Runtime':[], 'Actor':[], 'Alias':[]}def Details(url):    global detail    IMDb_ = {'Details':[]}    details = re.compile(r'<p class="plotpar">.*')    in_details = re.compile(r'">(.*?)</p>')    sock = urllib.urlopen(url)    page = sock.readlines()    sock.close()    for i in page:        if details.match(i) != None:            try:                IMDb_['Details'].append(in_details.search(i).group(1).strip())            except:                IMDb_['Details'].append('None')    Detail = str(IMDb_['Details'])Details("http://www.imdb.com/title/tt0233469/plotsummary")print detail"""I'd like to have this function setup so I candefine the variable name to save the details to within the function call,something like:Details("http://www.imdb.com/title/tt0233469/plotsummary", MyVariable)print MyVariable"""