Programming Articles

Page 394 of 2547

How to use Boto3 to create a secret key as plain text in AWS Secret Manager

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 1K+ Views

AWS Secrets Manager is a service that helps you securely store, retrieve, and manage sensitive information like API keys, database credentials, and other secrets. Using boto3, Python's AWS SDK, you can programmatically create and manage secrets as plain text. Prerequisites Before creating secrets, ensure you have ? AWS credentials configured (via AWS CLI, IAM roles, or environment variables) Proper IAM permissions for Secrets Manager operations boto3 library installed: pip install boto3 Creating a Secret in AWS Secrets Manager The process involves establishing an AWS session, creating a Secrets Manager client, and calling the ...

Read More

How to use Boto3 to get the secret keys saved as plain text from AWS Secret Manager

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 1K+ Views

AWS Secrets Manager is a service that helps you protect secrets needed to access your applications. Boto3 is the AWS SDK for Python that allows you to interact with AWS services, including retrieving secrets stored as plain text. Prerequisites Before retrieving secrets, ensure you have: AWS credentials configured (via AWS CLI, IAM roles, or environment variables) Proper IAM permissions to access Secrets Manager Boto3 library installed: pip install boto3 Step-by-Step Approach Step 1: Import boto3 and botocore exceptions to handle errors Step 2: Define the secret name or ARN where your secrets ...

Read More

How to use Boto3 to paginate through all objects of a S3 bucket present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 4K+ Views

Boto3 is a Python SDK for AWS that allows you to interact with AWS services. When working with large S3 buckets containing thousands of objects, pagination helps retrieve data in manageable chunks rather than loading everything at once. Why Use Pagination? S3 buckets can contain millions of objects. Loading all objects at once can cause memory issues and timeouts. Pagination allows you to: Process objects in smaller batches Reduce memory usage Handle large datasets efficiently Resume from a specific point using tokens Key Parameters The ...

Read More

Python Program to Construct a Tree & Perform Insertion, Deletion, Display

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 718 Views

When building a tree data structure in Python, we need to construct a tree and perform operations such as inserting an element, deleting an element and displaying elements of the tree. This can be achieved by defining a class with methods for these operations. Below is a demonstration of the same − Tree Structure Implementation class Tree_struct: def __init__(self, data=None, parent=None): self.key = data self.children = [] self.parent ...

Read More

Check whether a number has consecutive 0's in the given base or not using Python

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 272 Views

When working with different number bases, we sometimes need to check if a number contains consecutive zeros in its representation. Python provides an efficient way to convert numbers between bases and detect patterns like consecutive zeros. Understanding the Problem For example, the number 8 in base 2 (binary) is represented as "1000", which contains consecutive zeros. We need to convert the number to the specified base and then check for consecutive zero digits. Complete Solution def check_consecutive_zero(N, K): my_result = convert_to_base(N, K) if (check_consecutive_zeros(my_result)): ...

Read More

Python Program to Implement a Stack

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 4K+ Views

A stack is a Last-In-First-Out (LIFO) data structure where elements are added and removed from the same end (the top). In Python, we can implement a stack using a class with methods for push, pop, and checking if the stack is empty. Stack Implementation Here's a complete stack implementation with push, pop, and empty check operations ? class Stack: def __init__(self): self.items = [] def is_empty(self): return ...

Read More

How to get the list of all versions of the object from S3 present in AWS Resource

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 3K+ Views

In this article, we will see how to get the list of all versions of objects from S3 using boto3 in Python. This is useful when S3 versioning is enabled and you need to track object history. Prerequisites Before running this code, ensure you have ? AWS credentials configured (via AWS CLI, IAM roles, or environment variables) S3 bucket with versioning enabled boto3 library installed: pip install boto3 Approach We'll use the list_object_versions() method from the S3 client to retrieve all versions of objects in a specific bucket and prefix ? ...

Read More

Python Program To Find the Smallest and Largest Elements in the Binary Search Tree

Farhan Muhamed
Farhan Muhamed
Updated on 25-Mar-2026 591 Views

In this article, we will explain how to find the minimum and maximum values in a binary search tree (BST), with implementation in Python. A binary search tree is a data structure that stores data in a sorted order such that for every node, the left subtree contains values less than the node's value, and the right subtree contains values greater than the node's value. So the leftmost node will have the minimum value, and the rightmost node will have the maximum value. Problem Statement Given the root node of a binary search tree, find the node ...

Read More

How to use Boto3 to paginate through all triggers present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 275 Views

Problem Statement: Use boto3 library in Python to paginate through all triggers from AWS Glue Data Catalog that is created in your account Approach/Algorithm to solve this problem Step 1: Import boto3 and botocore exceptions to handle exceptions. Step 2: max_items, page_size and starting_token are the optional parameters for this function max_items denote the total number of records to return. ...

Read More

Python Program to Find Nth Node in the Inorder Traversal of a Tree

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 292 Views

Finding the nth node in inorder traversal of a binary tree is a common problem in tree algorithms. Inorder traversal visits nodes in the order: left subtree → root → right subtree. This article demonstrates how to find the nth node efficiently using a binary tree class with inorder traversal methods. Understanding Inorder Traversal In inorder traversal, nodes are visited in this sequence: Traverse the left subtree Visit the root node Traverse the right subtree For a binary search tree, inorder traversal gives nodes in sorted order. Binary Tree Implementation Here's a complete ...

Read More
Showing 3931–3940 of 25,466 articles
« Prev 1 392 393 394 395 396 2547 Next »
Advertisements