473,586 Members | 2,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting string to dictionary

Hi,
suppose i have dictinary as below :

a={'jack':'moni ca','mark':'ali ce','jeff':'jen i'}

i am storing this dictionary into the database where it is converted
to string of the form :
'{'jack':'monic a','mark':'alic e','jeff':'jeni '}'

now i want to convert this string into dictionary.

how can i do this ?

is there any way to do this ?

thanks,
Jul 18 '05 #1
1 1522
one (good or bad ? ) idea : use pickle...
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1317
by: adamc | last post by:
hi, I'm currently debugging a crash occurring in the Python interpreter. I've got a Dictionary object in the form of a (PyObject *) I can cast it to (dictobject *) in the debugger watch window, and I can also use PyString_AsString(PyObject_Repr()) to get the debugger to print out a string representation of the dictionary (actually I can't...
9
2553
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived) example: In Project RoObjDefs: RoPerson.cls file: Public Property Get FirstName() as String Public Property Get LastName() as String <end of file...
5
2311
by: k.vanderstarren | last post by:
Hi All, I'm trying to convert some ASP.NET code that I found at http://weblogs.asp.net/dannychen/archive/2005/12/02/432190.aspx from VB to C#. I've managed to convert the portion that is in the <script></script> section of the file fine (I think) but I've been unable to convert the code in each of the <asp:Label /tags so far. Can anyone...
3
2564
by: Sharon | last post by:
There is an built-in types table for .NET framework type to C# type which are aliases of predefined types in the System namespace (http://msdn2.microsoft.com/en-US/library/ya5y69ds.aspx). How can use access and use this table (by C# code) to convert the alias to the .NET framework type. For example: if I have: string aliasType = "int";...
20
34135
by: Gustaf | last post by:
This is two questions in one really. First, I wonder how to convert the values in a Dictionary to an array. Here's the dictionary: private Dictionary<Uri, Schemaschemas = new Dictionary<Uri, Schema>(); Uri is the System.Uri class, and Schema is a class I made. Now, I want the class where this Dictionary is contained to have a property that...
3
20394
by: MortyContorty | last post by:
Hello: I am new to Python (and a programming greenie for that matter) and I was trying to figure out how to change the "value" of my dictionary dataset from a string to a float. I imagine it is easy, but I haven't been able to figure it out. data_list ={'11': '0.0', '10': '0.0', '13': '0.0', '12': '10.0', '15': '10.0', '14': '10.0', '17':...
3
1518
by: coconet | last post by:
I have a string like this mystring = "color1:blue;color2:red"; I am tring to convert this into an IDictionary populated like this: color1 blue color2 red My non-working syntax is
2
3125
by: Andy B | last post by:
I don't know if this is even working or not but here is the problem. I have a gridview that I databound to a dictionary<string, stringcollection: Contract StockContract = new Contract(); StockContract.Dictionary = ContractDictionary<string, string>(); GridView1.DataSource=StockContract.Dictionary; So far so good. Now I assign something to...
0
1110
by: Gabriel Genellina | last post by:
En Fri, 19 Sep 2008 10:59:26 -0300, Ron Brennan <brennan.ron@gmail.com> escribió: I guess you probably tried using ' '.join(value) and got an error like this: TypeError: sequence item 0: expected string, int found so you inserted that str(...), but you don't still get what you want. You want "145 2345 567 898". *If* you had a list like...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.