# L-10.5 MCS 260 Wed 9 Jul 2014 : q14.py
"""
Write a Python program that doubles the spaces in a file:
every space in the input file is
replaced by two consecutive spaces in the output file.
"""
NAME = raw_input('Give the name of the input file : ')
INFILE = open(NAME, 'r')
NAME = raw_input('Give the name of the output file : ')
OUTFILE = open(NAME, 'w')
while True:
    C = INFILE.read(1)
    if C == '':
        break
    elif C == ' ':
        OUTFILE.write(C)
        OUTFILE.write(C)
    else:
        OUTFILE.write(C)
