How to display data in tabular format on a txt file
<p>I have been stuck on this python problem for hours. I'm trying to figure out how to write the data that can be manually entered above into a txt file in a way that it shows up in a two row eight column table. The contents in name_array are supposed to be headers and the  contents in data_array are the actual data pieces.</p>

<pre><code>name = str(raw_input( "Enter the student's name: "))
medianScore = float(raw_input("Enter the median group score for quizzes:"))
indScore = float(raw_input("Enter the score of the individual quiz:  "))
assignmentScore = float(raw_input("Enter the score of the assignment: "))
test1Score = float(raw_input("Enter the score of exam one: "))
test2Score = float(raw_input("Enter the score of exam two: "))
test3Score = float(raw_input("Enter the score of the final exam: "))
fileName = str(raw_input("Enter the name of the file you would like to create: "))
f = file(fileName + ".txt" , a)

finalScore = ((medianScore * .14) + (indScore * .14) + (assignmentScore * .12) + (test1Score * .15) +(test2Score * .20) + (test3Score * .25))
data_array = [name, finalScore, test3Score, test1Score, test2Score, assignmentScore,  indScore, medianScore]
name_array = [ "Student", "Final Grade", "Final Exam", "Exam 1", "Exam 2", "Assignments", "Solo Quizzes", "Group Quizzes"]
</code></pre>

<p>Have you tried something like:</p>

<pre><code>output_file = 'out.txt'
with open(output_file, 'r+') as file:
    file.write('\t'.join(name_array) + '\n')
    file.write('\t'.join(data_array) + '\n')
</code></pre>

python file tabular