Change list in python
Question: How can make several lists like this:

    
    
    ['The Lord of the Rings: The Fellowship of the Ring (2001)']
    
    ['The Lord of the Rings: The Two Towers (2002)']
    
    ['"5 Second Movies" (2007) {The Lord of the Rings and the Two Towers (#1.63)}']
    

Into one list like this:

    
    
     ['The Lord of the Rings: The Fellowship of the Ring (2001)',
    'The Lord of the Rings: The Two Towers (2002)',
    '"5 Second Movies" (2007) {The Lord of the Rings and the Two Towers (#1.63)}']
    

I have tried this:

    
    
    x = open("ratings.list.txt","r")
    movread = x.readlines()
    x.close()
    
    
    
    #s = raw_input('Search: ').lower()
    for ns in movread:
    
    
        if 'the lord of the' in ns.lower():
            d = re.split('\s+',ns,4)
            Title = d[4].rstrip()
            Rating= d[3]
    
    
    
            lists = [Title]
    
            combined = [item for sublist in lists for item in sublist]
            print combined
    

But its gives me this output:

    
    
    ['T', 'h', 'e', ' ', 'L', 'o', 'r', 'd', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'R', 'i', 'n', 'g', 's', ':', ' ', 'T', 'h', 'e', ' ', 'R', 'e', 't', 'u', 'r', 'n', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'K', 'i', 'n', 'g', ' ', '(', '2', '0', '0', '3', ')']
    ['T', 'h', 'e', ' ', 'L', 'o', 'r', 'd', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'R', 'i', 'n', 'g', 's', ':', ' ', 'T', 'h', 'e', ' ', 'F', 'e', 'l', 'l', 'o', 'w', 's', 'h', 'i', 'p', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'R', 'i', 'n', 'g', ' ', '(', '2', '0', '0', '1', ')']
    

Thanks for the help guys :D

UPDATE

The file look like this (its a list of all the movies on IMDB, so the size is
huge):

    
    
    New  Distribution  Votes  Rank  Title
          0000000125  1196672   9.2  The Shawshank Redemption (1994)
          0000000125  829707   9.2  The Godfather (1972)
          0000000124  547511   9.0  The Godfather: Part II (1974)
          0000000124  1160800   8.9  The Dark Knight (2008)
          0000000124  920221   8.9  Pulp Fiction (1994)
          0000000124  358790   8.9  Il buono, il brutto, il cattivo. (1966)
          0000000123  605734   8.9  Schindler's List (1993)
          0000000133  297241   8.9  12 Angry Men (1957)
          0000000124  854409   8.9  The Lord of the Rings: The Return of the King (2003)
          0000000123  910109   8.8  Fight Club (1999)
          0000000124  880827   8.8  The Lord of the Rings: The Fellowship of the Ring (2001)
          0000000123  568723   8.8  Star Wars: Episode V - The Empire Strikes Back (1980)
          0000000124  953140   8.7  Inception (2010)
    


Answer: You want to

    
    
    [movie[0] for movie in movies]
    

An example script would look like this

    
    
    import pprint    
    
    movies = [
    ['The Lord of the Rings: The Fellowship of the Ring (2001)'],
    ['The Lord of the Rings: The Two Towers (2002)'],
    ['"5 Second Movies" (2007) {The Lord of the Rings and the Two Towers (#1.63)}'],
    ]
    
    pprint.pprint([movie[0] for movie in movies], indent=4)
    

This outputs

    
    
    [   'The Lord of the Rings: The Fellowship of the Ring (2001)',
        'The Lord of the Rings: The Two Towers (2002)',
        '"5 Second Movies" (2007) {The Lord of the Rings and the Two Towers (#1.63)}']
    

The `movies` list, would be populated by you when you read in the file.

