Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80162
| X-Received | by 10.50.141.135 with SMTP id ro7mr13678091igb.7.1415037436112; Mon, 03 Nov 2014 09:57:16 -0800 (PST) |
|---|---|
| X-Received | by 10.140.21.49 with SMTP id 46mr19921qgk.30.1415037436081; Mon, 03 Nov 2014 09:57:16 -0800 (PST) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!h15no4900056igd.0!news-out.google.com!u5ni19qab.1!nntp.google.com!i13no986485qae.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Mon, 3 Nov 2014 09:57:15 -0800 (PST) |
| In-Reply-To | <64f7e57a-4be3-44f4-b11c-0d270fc91809@googlegroups.com> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=129.10.18.88; posting-account=khY3HgoAAAA15u5JaWPakBuLspWynfqC |
| NNTP-Posting-Host | 129.10.18.88 |
| References | <64f7e57a-4be3-44f4-b11c-0d270fc91809@googlegroups.com> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <024ff5ca-b0b7-4b03-b45c-1d9edb2aedce@googlegroups.com> (permalink) |
| Subject | Re: Parsing Python dictionary with multiple objects |
| From | Anurag Patibandla <anuragpatibandla7@gmail.com> |
| Injection-Date | Mon, 03 Nov 2014 17:57:16 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.python:80162 |
Show key headers only | View raw
json_split = {}
value = {"Status": "Submitted", "m_Controller": "Python"}
a = range(31)
del a[0]
for i in a:
json_split[i] = value
keys = json_split.keys()
order = list(keys)
q1 = int(round(len(keys)*0.2))
q2 = int(round(len(keys)*0.3))
q3 = int(round(len(keys)*0.5))
b = [q1,q2,q3]
n=0
threedicts = []
for i in b:
queues = order[n:n+i]
n = n+i
lists = [(queues[j], json_split.get(queues[j])) for j in range(len(queues))]
onedict = {}
for q in queues:
onedict[q] = json_split[q]
threedicts.append (onedict)
queue1, queue2, queue3 = threedicts
keys1 = queue1.keys()
for i in keys1:
queue1[i]['Priority'] = ['1']
keys2 = queue2.keys()
for j in keys2:
queue2[j]['Priority'] = ['2']
keys3 = queue3.keys()
for z in keys3:
queue3[z]['Priority'] = ['3']
I am trying to add a key value pair of ("Priority":"1") to queue1, ("Priority":"2") to queue2, and ("Priority":"3") to queue3.
When I just add ("Priority":"1") to queue1, it works.
But when I run the above code, ("Priority":"3") is being added to all the queues.
This looks trivial and I don't understand why this is happening. Is there something wrong with what I am doing?
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Parsing Python dictionary with multiple objects anuragpatibandla7@gmail.com - 2014-10-14 08:57 -0700
Re:Parsing Python dictionary with multiple objects Dave Angel <davea@davea.name> - 2014-10-14 13:02 -0400
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-14 14:15 -0700
Re: Parsing Python dictionary with multiple objects Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-14 16:32 -0500
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-14 14:36 -0700
Re: Parsing Python dictionary with multiple objects MRAB <python@mrabarnett.plus.com> - 2014-10-14 23:58 +0100
Re:Parsing Python dictionary with multiple objects Dave Angel <davea@davea.name> - 2014-10-14 21:57 -0400
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-14 19:32 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-14 20:40 -0700
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-14 21:50 -0700
Re: Parsing Python dictionary with multiple objects Dave Angel <davea@davea.name> - 2014-10-15 13:43 -0400
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 11:35 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-14 20:41 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 08:52 -0700
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-15 09:06 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 09:28 -0700
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-15 09:43 -0700
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-15 09:59 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 09:57 -0700
Re: Parsing Python dictionary with multiple objects Dave Angel <davea@davea.name> - 2014-10-15 13:48 -0400
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 10:00 -0700
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-15 10:10 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 10:20 -0700
Re: Parsing Python dictionary with multiple objects Dave Angel <davea@davea.name> - 2014-10-15 13:50 -0400
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 10:20 -0700
Re: Parsing Python dictionary with multiple objects Rustom Mody <rustompmody@gmail.com> - 2014-10-15 10:35 -0700
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-10-15 11:27 -0700
Re: Parsing Python dictionary with multiple objects Dave Angel <davea@davea.name> - 2014-10-15 18:25 -0400
Re: Parsing Python dictionary with multiple objects Anurag Patibandla <anuragpatibandla7@gmail.com> - 2014-11-03 09:57 -0800
csiph-web