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:
>
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
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:
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
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
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
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