Re: Python-remove duplicate output

2018-11-22 Thread Bob Gailer
On Nov 22, 2018 8:50 AM, wrote: > > On Thursday, November 22, 2018 at 12:10:28 AM UTC+1, drvuc...@gmail.com wrote: > > How to remove duplicate lines and store output into one ine > > > >reservations = ec.describe_instances().get('Reservations', []) > > > >for reservation in reservations: >

Re: Python-remove duplicate output

2018-11-22 Thread marco . nawijn
On Thursday, November 22, 2018 at 12:10:28 AM UTC+1, drvuc...@gmail.com wrote: > How to remove duplicate lines and store output into one ine > >reservations = ec.describe_instances().get('Reservations', []) > >for reservation in reservations: > for instance in reservation['Instan

Re: Python-remove duplicate output

2018-11-21 Thread dieter
drvucano...@gmail.com writes: > How to remove duplicate lines and store output into one ine I do not understand "into one ine". > ... > Current Output: > aws-opsworks > aws-opsworks Ansible > > Desired output: > aws-opsworks Ansible Looks for me as if you do not want to remove duplicate lines:

Python-remove duplicate output

2018-11-21 Thread drvucanovic
How to remove duplicate lines and store output into one ine reservations = ec.describe_instances().get('Reservations', []) for reservation in reservations: for instance in reservation['Instances']: tags = {} for tag in instance['Tags']: ta

Re: Duplicate Output

2016-01-27 Thread Peter Otten
Peter Otten wrote: > or use next(): > > filenames = next(walk("."))[2] > print(filenames) Be warned though that if you try this with a non-existent or otherwise inaccessible directory you will get an exception: $ sudo mkdir forbidden $ sudo chmod a-r forbidden $ python3 -c 'import os; next(os

Re: Duplicate Output

2016-01-27 Thread Peter Otten
Gary Roach wrote: > Hi > > Debian stretch OS > KDE Desktop > Code written with Kate > Run in command line with $python getFileNames.py > > Code: > > from os import walk > import subprocess > > f = [] > x = "" > for (dirpath, dirnames, filenames) in walk('.'): > print(filenames) > > This

Duplicate Output

2016-01-27 Thread Gary Roach
Hi Debian stretch OS KDE Desktop Code written with Kate Run in command line with $python getFileNames.py Code: from os import walk import subprocess f = [] x = "" for (dirpath, dirnames, filenames) in walk('.'): print(filenames) This prints [][] What am I doing wrong or how do I remove t