Found 26504 Articles for Server Side Programming

Getting every child widget of a Tkinter window

Dev Prakash Sharma
Updated on 15-Apr-2021 13:28:18

13K+ Views

In order to get the information about the widgets, tkinter provides a set of methods that can be used to test the widgets in an application. In order to get the list of all the child widgets, we can use the winfo_children() method.ExampleIn this example, we have defined some widgets in a frame and by using the winfo_children() method, we will print the list containing the names of all the widgets.#Import tkinter library from tkinter import * #Create an instance of tkinter frame win = Tk() #Set the geometry win.geometry("750x200") #Create a frame frame= Frame(win) #Create label, button widgets Label(frame, ... Read More

How to use Boto3 to paginate through object versions of a S3 bucket present in AWS Glue

Ashish Anand
Updated on 15-Apr-2021 13:30:08

717 Views

Problem Statement: Use boto3 library in Python to paginate through object versions of a S3 bucket from AWS Glue Data Catalog that is created in your accountApproach/Algorithm to solve this problemStep 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, while bucket_name is required parameters.max_items denote the total number of records to return. If the number of available records > max_items then a NextToken will be provided in the response to resume pagination.page_size denotes the size of each page.starting_token helps to paginate, and it uses NextKeyMarker from a ... Read More

Disable the underlying window when a popup is created in Python TKinter

Dev Prakash Sharma
Updated on 15-Apr-2021 13:26:46

2K+ Views

We are familiar with popup and used it in many applications. Popup in a tkinter application can be created by creating an instance of Toplevel(root) window. For a particular application, we can trigger the popup on a button object.Let us create a Python script to close the underlying or the main window after displaying the popup. We can close the main window while residing in a popup window by using the withdraw() method.ExampleThrough this example, we will create a popup dialog that can be triggered after clicking a button. Once the popup will open, the parent window will close automatically.#Import ... Read More

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

Ashish Anand
Updated on 15-Apr-2021 13:29:48

3K+ Views

In this article, we will see how to get the list of all versions of the object from S3 those are present in AWS Resource.ExampleList out all the versions of test.zip from Bucket_1/testfolder of S3.Problem Statement: Use boto3 library in Python to get list of all versions of the object from S3.Approach/Algorithm to solve this problemStep 1: Import boto3 and botocore exceptions to handle exceptions.Step 2: bucket_name is the required parameter.Step 3: Create an AWS session using boto3 libStep 4: Create an AWS client for s3Step 5: Now, list out all version of the object of the given bucket using ... Read More

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

Farhan Muhamed
Updated on 19-Aug-2025 17:27:50

415 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. Find Minimum and Maximum in a BST Given root node of a binary search tree, ... Read More

Python Program to Build Binary Tree if Inorder or Postorder Traversal as Input

AmitDiwan
Updated on 15-Apr-2021 13:35:40

417 Views

When it is required to build a binary tree by taking input using inorder or postorder traversal, a class is defined, that has methods to set the root element, perform inorder traversal, perform post order traversal. It can be used by creating an instance of the class.Below is a demonstration of the same −Example Live Democlass BinaryTree_struct:    def __init__(self, key=None):       self.key = key       self.left = None       self.right = None    def set_root(self, key):       self.key = key    def inorder_traversal(self):       if self.left is not ... Read More

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

Ashish Anand
Updated on 15-Apr-2021 13:27:48

216 Views

Problem Statement: Use boto3 library in Python to paginate through all triggers from AWS Glue Data Catalog that is created in your accountApproach/Algorithm to solve this problemStep 1: Import boto3 and botocore exceptions to handle exceptions.Step 2: max_items, page_size and starting_token are the optional parameters for this functionmax_items denote the total number of records to return. If the number of available records > max_items, then a NextToken will be provided in the response to resume pagination.page_size denotes the size of each page.starting_token helps to paginate, and it uses NextToken from a previous response.Step 3: Create an AWS session using boto3 ... Read More

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

AmitDiwan
Updated on 15-Apr-2021 13:35:21

238 Views

When it is required to find the ‘n’th node using inorder traversal of a binary tree, a binary tree class is created with methods to set the root element, add elements to left or right, perform in order traversal and so on. An instance of the class is created, and it can be used to access the methods.Below is a demonstration of the same −Example Live Democlass BinaryTree_struct:    def __init__(self, key=None):       self.key = key       self.left = None       self.right = None    def set_root(self, key):       self.key = key ... Read More

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

Ashish Anand
Updated on 15-Apr-2021 13:26:06

822 Views

Problem Statement: Use boto3 library in Python to paginate through all tables from AWS Glue Data Catalog that is created in your accountApproach/Algorithm to solve this problemStep 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, while database_name is required.max_items denote the total number of records to return. If the number of available records > max_items, then a NextToken will be provided in the response to resume pagination.page_size denotes the size of each page.starting_token helps to paginate, and it uses NextToken from a previous response.Step 3: Create an ... Read More

Python Program to Convert a given Singly Linked List to a Circular List

AmitDiwan
Updated on 15-Apr-2021 13:34:59

368 Views

When it is required to convert a singly linked list into a circular linked list, a method named ‘convert_to_circular_list’ is defined that ensures that the last elements points to the first element, thereby making it circular in nature.Below is a demonstration of the same −Example Live Democlass Node:    def __init__(self, data):       self.data = data       self.next = None class LinkedList_struct:    def __init__(self):       self.head = None       self.last_node = None    def add_elements(self, data):       if self.last_node is None:          self.head = Node(data) ... Read More

Advertisements