Python Forum
Help with filtering in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with filtering in Python
#1
Hi, i am new to python and trying to learn a new language.

I am attempting to filter some output, but can't get my head around the syntax.

def filter_user_pools():
listpools = client.list_user_pools.filter(
Filters=[{'Id': 'UserPoolId'}])
for list in listpools:
    print(list.Id)
I am trying to output the filter the following output

{'UserPools': [{'Id': 'eu-west-1_asdasdg34', 'Name': 'JenkinsDevelopMarketplace', 'LambdaConfig': {'PreSignUp':...
I want the second field - eu-west_1

Any help, will be appericated.
Reply
#2
The code doesn't run as it is, the indentation has gone, what is a client object? where does the input come from ?.
Reply
#3
import boto3

client = boto3.client('cognito-idp')

def user_pool():
    response = client.list_user_pools(
        NextToken="PaginationKeyType",
        MaxResults=20
    )
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  filtering files using 'any()" tester_V 19 1,531 May-08-2021, 12:01 PM
Last Post: snippsat
  csv filtering with python. KirkmanJ 12 6,186 Jun-26-2018, 11:29 AM
Last Post: KirkmanJ
  filtering a string hello_its_me 6 2,386 Nov-29-2017, 05:46 AM
Last Post: hello_its_me

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020