Re: Need help with getting Key, Value out of dicts in lists

2017-04-08 Thread Irv Kalb
[ Sorry, forgot the important stuff! ] What you want to do is tricky because your data structure is difficult to deal with. My guess is that it has to do with a misconception about how a Python dictionary works. Yes, it is a series of key/value pairs, but not the way you have it. It looks li

Re: Need help with getting Key, Value out of dicts in lists

2017-04-08 Thread Irv Kalb
> On Apr 8, 2017, at 5:55 PM, Kenton Brede wrote: > > This is an example of the data I'm working with. The key/value pairs may > come in any order. There are some keys like the 'Resource_group_id' key and > the 'Name' key which will always be present, but other lists may have > unique keys. >

Re: Python and the need for speed

2017-04-08 Thread Chris Angelico
On Sun, Apr 9, 2017 at 10:20 AM, wrote: > I've an idea that http://www.mos6581.org/python_need_for_speed is a week late > for April Fool's but just in case I'm sure that some of you may wish to > comment. > >From that page: > Other candidates for banishment from TurboPython include eval and e

Re: Python and the need for speed

2017-04-08 Thread Thomas Nyberg
On 04/08/2017 05:20 PM, breamore...@gmail.com wrote: > I've an idea that http://www.mos6581.org/python_need_for_speed is a week late > for April Fool's but just in case I'm sure that some of you may wish to > comment. > > Kindest regards. > > Mark Lawrence. > Regarding your restricted subset o

Need help with getting Key, Value out of dicts in lists

2017-04-08 Thread Kenton Brede
This is an example of the data I'm working with. The key/value pairs may come in any order. There are some keys like the 'Resource_group_id' key and the 'Name' key which will always be present, but other lists may have unique keys. alist = [[{u'Value': 'shibboleth-prd', u'Key': 'Name'}, {u'Value'

Python and the need for speed

2017-04-08 Thread breamoreboy
I've an idea that http://www.mos6581.org/python_need_for_speed is a week late for April Fool's but just in case I'm sure that some of you may wish to comment. Kindest regards. Mark Lawrence. -- https://mail.python.org/mailman/listinfo/python-list

Re: read in a list in a file to list

2017-04-08 Thread Rick Johnson
@John General debugging methodology dictates that when your output does not match your expectation, you must never assume anything. Here you made the fatal mistake of assuming that: (1) files are stored as list objects, or (2) Python automatically converts file data to list objects, or (3) that py

Re: read in a list in a file to list

2017-04-08 Thread boB Stepp
On Sat, Apr 8, 2017 at 3:21 PM, wrote: > On Saturday, April 8, 2017 at 7:32:52 PM UTC+1, john polo wrote: >> Hi, >> >> I am using Python 3.6 on Windows 7. >> >> I have a file called apefile.txt. apefile.txt's contents are: >> >> apes = "Home sapiens", "Pan troglodytes", "Gorilla gorilla" >> >> I

Re: read in a list in a file to list

2017-04-08 Thread breamoreboy
On Saturday, April 8, 2017 at 7:32:52 PM UTC+1, john polo wrote: > Hi, > > I am using Python 3.6 on Windows 7. > > I have a file called apefile.txt. apefile.txt's contents are: > > apes = "Home sapiens", "Pan troglodytes", "Gorilla gorilla" > > I have a script: > > apefile = open("apefile.tx

read in a list in a file to list

2017-04-08 Thread john polo
Hi, I am using Python 3.6 on Windows 7. I have a file called apefile.txt. apefile.txt's contents are: apes = "Home sapiens", "Pan troglodytes", "Gorilla gorilla" I have a script: apefile = open("apefile.txt") apelist = apefile.read() for ape in apelist: print("one of the apes is " + ape

Re: Elastic Search

2017-04-08 Thread Paul Rubin
Steve D'Aprano writes: > What's elastic search? > And what does this have to do with Python? https://www.elastic.co/ (formerly elasticsearch.org). It's a Lucene-based distributed search engine, something like Solr if you're used to that. It has Python client libraries. That's the closest Pyth