Testing with a txt file
<p>I created a input.txt file. There several sets of testing input date in input.txt. Then I run in the  terminal <code>python Filename.py &lt;input.txt &gt;output.txt</code>. After running I only get output of first set input date. How can I get all the output date automatically in output.txt? </p>

<pre><code># GET amount of money in bank
amount_in_bank = input( "How much money is in the bank? $" )
# GET amount of income
amount_of_income = input( "How much income is expected? $" )
# GET amount of expenses
amount_of_expenses = input( "How much money is going to be spent on    expenses? $" )
# CALCULATE money in bank + income - expenses
# SET amount available to result of previous calculation
amount_available = int( amount_in_bank ) + int( amount_of_income ) - int( amount_of_expenses )
# DISPLAY amount available
message = "Bobbie will have $" + str( amount_available ) + " left at the end of the month."
print ( message )
</code></pre>

<p>I feel that you have not added any loop in order to traverse all the inputs in txt file. This might help:</p>

<p>Start with <code>fp = open('input.txt')</code>. Add a <code>for</code> loop like <code>for i, line in enumerate(fp.readlines()):</code> and then type the code you had added for getting the values and printing the message.</p>

python