def sort_file():
    """ Sort the lines in the file named on standard input,
    outputting the sorted lines on stdout.

    Example call (from command line)
    sort_file.py unsorted.txt > sorted.txt
    """
    lines=[] # give lines variable a type of list
    for line in fileinput.input(): lines.append(line.rstrip())
    lines.sort()
    for line in lines: print line
 Sort the lines in the file named on standard input,
    outputting the sorted lines on stdout.

    Example call (from command line)
    sort_file.py unsorted.txt > sorted.txt
    
recipes/Python/440612_Sort_a_file/recipe-440612.py