def skip_comments(filepointer):
	"""
	Moves file pointer to the next non-comment line and returns
	the comments as a list of strings.
	"""
	comments = []
	data = '#'
	try:
		pos = filepointer.tell()
	except:
		print("Could not read file.")
		return None	
	
	while data[0] == '#':
		data = filepointer.readline()
		if not data:
			raise Exception("Unexpected end of file while reading comments.")

		if data[0] == '#':
			comments.append(data)
			pos = filepointer.tell()
		else:
			filepointer.seek(pos)
	return comments