Question: I have a text file that has basic database content. It's supposed to be payroll like information. I try to open it in python with

I have a text file that has basic database content. It's supposed to be payroll like information. I try to open it in python with the below code.

f=open("C:\\User\\Desktop\\School\\Python\\payroll.txt", "r") print(f)

I just get this message "<_io.TextIOWrapper name='C:\\Users\\hmcph\\Desktop\\School\\Python\\payroll.txt' mode='r' encoding='cp1252'> Press any key to continue . . ." Any ideas on why this is happening and how to at least open and read the contents of the text file to python?

The contents below are what I'm trying to read to python...

0000 Kim Allen 7 5 5 3 6 2 0001 Adam Franklin 18 5 8 9 8 8 0002 Chris Deloris 7 4 8 9 5 0003 John Kerney 38 8 8 8 8 8 0004 Michael Husserl 9 3 6 3 4 0005 James Black 15 5 5 8 8 0006 Todd Lidner 20 7.0 6.5 8 8 0007 Melanie McLaird 7 4 4 6 6 6 6 0008 Tim Messelt 13 5 6.5 7 6 7 0009 Mary Allen 25 8 8 7.5 7 4 0010 Kay Simpson 30 8 8 8 8 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!