On 3/2/2010 10:19 AM, Roy Smith wrote: > > Somewhat sadly, in my case, I can't even machine process the header > file. I don't, strictly speaking, have a header file. What I have is > a PDF which documents what's in the header file, and I'm manually re- > typing the data out of that. Sigh. Here's an idea, perhaps too obvious, to minimize your keystrokes: 1. Create a text file with the essential data: XYZ_FOO 0 The foo property XYZ_BAR 1 The bar property XYZ_BAZ 2 reserved for future use 2. Use a Python script to convert this into the desired code: declare('XYZ_FOO', 0, "The foo property") declare('XYZ_BAR', 1, "The bar property") declare('XYZ_BAZ', 2, "reserved for future use") Note: >>> s 'XYZ_FOO 0 The foo property' >>> s.split(None, 2) ['XYZ_FOO', '0', 'The foo property'] HTH, John
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4