#!/usr/bin/env python
'''
$Id$

creatext.py -- create a text file (one line at a time)
'''

# prompt user for file name
filename = raw_input('Enter file name: ')

# open file
file = open(filename, 'w')

# loop until user terminates input (using '.')
done = 0
while not done:

    # obtain single line of text from user
    aLine = raw_input("Enter a line ('.') to quit): ")

    # if not terminating, write line out
    if aLine != '.':
        file.write(aLine + '\n')

    # otherwise break out of loop
    else:
        done = 1

# close file
file.close()
