[Q] How to compose, serialize, and emit in PyYAML?
"Makoto Kuwata" <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm investigating PyYAML 3.05 and have some questions. Q1. How to compose nodes from event list? Q2. How to serialize node into event list? Q3. How to emit event list into stram? example: -------------------- import yaml string = """ - abc - 123 - yes """ ## parse string and get event list events = [ event for event in yaml.parse(string) ] ### compose nodes from event list node = ?????? # yaml.compose(string) is not what I want ## construct Python data from nodes constructor = yaml.constructor.Constructor() data = constructor.construct_document(node) ## convert data into node representer = yaml.representer.Representer() node = representer.represent_data(data) ## convert node into event list events = ?????? ## convert event list into string string = ?????? -------------------- -- regards, makoto kuwata ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/