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
  Unexpected Output - Python Dataframes: Filtering based on Overlapping Dates Xensor 5 655 Nov-15-2023, 06:54 PM
Last Post: deanhystad
  csv filtering with python. KirkmanJ 12 162,866 Jun-26-2018, 11:29 AM
Last Post: KirkmanJ

Forum Jump:

User Panel Messages

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