The problem is that you are mixing two methods of reading a file.
for a in apertura:
print(apertura.read())
So, the first line of the file is never printed.
You can iterate through a line of a line as follows:
for a in apertura:
print(a)
You can also use the context manager to make sure the file is closed later
from sys import argv
script, file = argv
with open(file, 'r') as apertura:
for a in apertura:
print(a)
If you really want to read the file with .read(), the code is a bit simpler, but uses a lot of memory in case the file is large
from sys import argv
script, file = argv
with open(file, 'r') as apertura:
print(apertura.read())
source
share