IssueRaiser

Load comments

How do I load (and dump) comments? In the following code, how can I print out the first comment? ``` import yaml code = '''# The following key opens a door key: value # this is another comment''' loaded = yaml.load(code) # CODE HERE: How to print out 'The following key opens a door'? ```

Posted by phihag on Oct 26, 2017, 12:19 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Other)

Load comments

phihagOct 26, 2017, 12:19 PM

How do I load (and dump) comments? In the following code, how can I print out the first comment? ``` import yaml code = '''# The following key opens a door key: value # this is another comment''' loaded = yaml.load(code) # CODE HERE: How to print out 'The following key opens a door'? ```

Comments (0)

No comments yet. Start the discussion.

Comment on this issue