What you're referring to as the console is probably the interactive interpreter. In the interactive interpreter, results of expressions are automatically shown, making it usable much like a calculator; it performs a read-eval-print loop. When running a prepared program, there is no assumption of the print step (nor, technically, the read step), so you must request it if that is what you want done.
A quite separate issue is how you read the entire file 40 times, splitting it into lines each time, when you only intend to print 20 lines. I would probably rewrite the loop like so:
f=open('fil.txt','r')
for i in range(40):
p=f.readline()
if i%2==1:
print p
The reason I don't use f.e. for line in file('filename'): is that I don't intend to process the whole file; placing the range in the for line shows the limits at a glance.