C parsing in python