As woooee already mentioned, don't use the Python Shell (has those screwy looking >>> prompts) for writing programs. The Shell is only used for testing small parts of code.
You can modify woooee's code ...
a = 
a = os.listdir('.')
for t in a:
f = open(t,'r')
print t, "opened"
data_str = f.read()
# do something with the data string later ...
# break here if you only want the first file
print " ", t, "not a file"
# now process your data string