Re: how to create data to dump into yaml file

Discussion in 'Python' started by Chris Rebert, Feb 2, 2009.

  1. Chris Rebert

    Chris Rebert Guest

    On Sun, Feb 1, 2009 at 11:41 PM, <> wrote:
    > hi
    > I have to create a yaml file using my list of objects.shall i need to
    > create a string using my objects and then load and dump that string or
    > is there any other way to create the yaml file.
    >
    > i want a yaml file to be created from [Text, Author,......]in this format
    > Text:
    > - value1
    > - value2
    > - value 3
    > Author:
    > name: bookName


    The PyYAML library is available on http://pyyaml.org/
    Also, since JSON is essentially a subset of YAML, you could use the
    `json` module (http://docs.python.org/library/json.html) in the Python
    std lib, albeit with differently formatted results.

    Cheers,
    Chris

    --
    Follow the path of the Iguana...
    http://rebertia.com
     
    Chris Rebert, Feb 2, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. halfdog
    Replies:
    12
    Views:
    12,522
  2. Replies:
    0
    Views:
    521
  3. Trans
    Replies:
    2
    Views:
    309
    Trans
    Jan 29, 2005
  4. Paul Battley

    YAML.dump/YAML.load bug

    Paul Battley, Aug 3, 2005, in forum: Ruby
    Replies:
    0
    Views:
    194
    Paul Battley
    Aug 3, 2005
  5. Jonathan Gold
    Replies:
    0
    Views:
    146
    Jonathan Gold
    May 19, 2009
Loading...

Share This Page