Custom Query (132 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (19 - 21 of 132)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Ticket Resolution Summary Owner Reporter
#132 worksforme PySyck does not dump dictionaries xi xl269@…

Reported by xl269@…, 5 years ago.

Description

infinity0@xl269:~$ uname -a Linux xl269 2.6.30-1-amd64 #1 SMP Sun Jun 14 15:00:29 UTC 2009 x86_64 GNU/Linux infinity0@xl269:~$ python --version Python 2.5.4 infinity0@xl269:~$ python Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from syck import * dump({1:2})

'--- {}\n\n'

load('{1: 2}\n')

{1: 2}

from yaml import * dump({1:2})

'{1: 2}\n'

load('{1: 2}\n')

{1: 2}

#167 worksforme Please help saving dict to yaml xi anonymous

Reported by anonymous, 4 years ago.

Description
Hi, is there any way of saving dict to a file in yaml format? I'm using:
----------------------------------------
#!/usr/bin/python
import yaml
y = """
    root:
         - subject1:
            desc: msg1
         - subject2:
            desc: msg2
"""
settings=yaml.load(y)

settings['root'][0]['subject1']['desc'] = "new msg"
print settings

f = open("temp", "w")
f.write(str(settings))
----------------------------------------
but failing miserably, contents of the temp file:
{'root': [{'subject1': {'desc': 'new msg'}}, {'subject2': {'desc': 'msg2'}}]}

expected result:
    root:
         - subject1:
            desc: new msg
         - subject2:
            desc: msg2

Is there anything like yaml.save? Any help greatly appreciated!

Regards,
Tomas
#21 duplicate yaml emitter bug xi rwb123@…

Reported by rwb123@…, 8 years ago.

Description

The following code produces bad yaml output, which subsequently dies in the yaml.load(). This is with pyyaml 3.0.3 on python 2.4.1.

import yaml

e = {"texas: '": 92.5}
yammy = yaml.dump(e)
print yammy
e2 = yaml.load(yammy)
print e2

The yaml output is:

$ python yamlbug2.py
{'texas: '': 92.5}

Traceback (most recent call last):
  File "yamlbug2.py", line 10, in ?
    e2 = yaml.load(yammy)
  File "/home/blahblah/dl/yaml/PyYAML-3.03/lib/yaml/__init__.py", line 61, in load
    return loader.get_data()
 ... etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Note: See TracQuery for help on using queries.