#!/usr/bin/python2.7

import sys
import os

notEND = True
if len(sys.argv) == 2:
	if(os.path.isfile(sys.argv[1])):
		with open(sys.argv[1], "rb") as stream:
			counter = 0
			while(notEND):
				line = stream.read(80)
				if counter == 0 and not (line[0:6]=="SIMPLE"):
					print("Not a FITS File")
					break
				if line[0:4] == "END ":
					notEND = False
				print(line)
				counter += 1
			if counter > 0:
				print("Printed %d Lines" % counter)
	else:
		print("Could not find file : %s" % sys.argv[1])
else:
	print("Please specify a fit file")
