#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    49
    Rep Power
    0

    Red face how to Store Dictionary data in a File - Python


    Hey guys,

    I have a sample code,

    where i have a Dictionary

    {'username': 'kunal', 'gender': 'Male', 'postal': '45621', 'Country': 'U.K', 'Sport': 'Sport', 'Music': 'Music', 'repassword': 'jainjain', 'address': 'sdfsdf', 'password': 'jainjain', 'email': 'kunal@fsdf.com'}


    I want to way to store this data in a file

    any file

    and later read the content of the file

    please help me in this,

    Thanz

    Arpan
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,643
    Rep Power
    4247
    Look at your python documentation for pickle, cpickle or marshall modules. I would use cpickle because of its speed as well as flexibility.

    Comments on this post

    • jacktasia agrees
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo