About 408,000 results
Open links in new tab
  1. python - Convert a String representation of a Dictionary to a ...

    How can I convert the str representation of a dictionary, such as the following string, into a dict?

  2. Convert a python dict to a string and back [duplicate]

    Dec 28, 2010 · How would I convert a dictionary object into a string that can be written to a file and loaded back into a dictionary object? This will hopefully support dictionaries containing dictionaries.

  3. python - How can I convert string to dict or list? - Stack Overflow

    Apr 18, 2015 · You can convert string to list/dict by ast.literal_eval() or eval() function. ast.literal_eval() only considers a small subset of Python's syntax to be valid: The string or node provided may only …

  4. Python Convert string to dict - Stack Overflow

    Dec 6, 2017 · Python Convert string to dict Asked 8 years ago Modified 6 years, 9 months ago Viewed 52k times

  5. python - How can I convert string values from a dictionary, into int ...

    Mar 16, 2011 · If it's able to be converted into a float or int, convert it and modify the value in the dictionary. There isn't any built-in function for this and it can be quite ugly (and non-Pythonic since it …

  6. python 3 dictionary key to a string and value to another string

    dict={'a':'b'} in python 3, i would like to convert this dictionary key to a string and its value to another string:

  7. python - Simple way to convert a string to a dictionary - Stack Overflow

    Now to parse your original text string, storing the results in dd. Pyparsing returns an object of type ParseResults, but this class has many dict-like features (support for keys (), items (), in, etc.), or can …

  8. python - Convert list of strings to dictionary - Stack Overflow

    Apr 10, 2014 · This assumes that you do not have duplicates and you don't have other colons in there. What happens is that you first split the strings into a tuple of two values. You do this here with a …

  9. Convert JSON string to dict using Python - Stack Overflow

    Convert JSON string to dict using Python [duplicate] Asked 14 years, 11 months ago Modified 3 years, 4 months ago Viewed 899k times

  10. python - Converting dictionary to JSON - Stack Overflow

    Nov 5, 2014 · 74 json.dumps() returns the JSON string representation of the python dict. See the docs You can't do r['rating'] because r is a string, not a dict anymore Perhaps you meant something like