I am writing a Python script to edit a large C project. In this script I am using the subprocess module to call cscope's line oriented interface. This is an example of what I have been doing...
func_name = 'main'
p = subprocess.Popen(['cscope', '-d', '-L', '-0', func_name], stdout=subprocess.PIPE)
(output, err) = p.communicate()
This works great for finding all the references to a function. The problem I am having is that output is just a long string of all the references. Is there a way to call this so it returns a list instead of one string? The string it returns is very hard to parse since there is no real pattern to it.