Taking Input from the User in Tkinter

Dev Prakash Sharma
Updated on 14-Sep-2023 13:13:52

41K+ Views

There might be times when we need to take the user input in our Tkinter application. We can get the user Input in a Single Line text input through the Entry widget using get() method. To display the Captured input, we can either print the message on the screen or display the input with the help of the Label widget.Example#Import the required Libraries from tkinter import * from tkinter import ttk #Create an instance of Tkinter frame win= Tk() #Set the geometry of Tkinter frame win.geometry("750x250") def display_text():    global entry    string= entry.get()    label.configure(text=string) ... Read More

Convert Binary to Decimal

Chandu yadav
Updated on 14-Sep-2023 13:12:25

25K+ Views

Binary is the simplest kind of number system that uses only two digits of 0 and 1 (i.e. value of base 2). Since digital electronics have only these two states (either 0 or 1), so binary number is most preferred in modern computer engineer, networking and communication specialists, and other professionals.Whereas Decimal number is most familiar number system to the general public. It is base 10 which has only 10 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.Conversion from Binary to Decimal number systemThere are mainly two methods to convert a binary number into decimal number ... Read More

Declare String Variables in JavaScript

Ali
Ali
Updated on 14-Sep-2023 02:41:32

30K+ Views

JavaScript is an untyped language. This means that a JavaScript variable can hold a value of any data type. To declare variables in JavaScript, you need to use the var, let, or const keyword. Whether it is a string or a number, use the var, let, or const keyword for its declaration. But for declaring a string variable we had to put the string inside double quotes or single quotes.Here’s how you can declare strings in JavaScript -var name = "David"; var subject = "Programming";ExampleYou can try to run the following code to learn how to declare strings in JavaScript ... Read More

Create Date Object in Java

Maruthi Krishna
Updated on 14-Sep-2023 02:38:59

33K+ Views

Using the Date classYou can create a Date object using the Date() constructor of java.util.Date constructor as shown in the following example. The object created using this constructor represents the current time.ExampleLive Demoimport java.util.Date; public class CreateDate {    public static void main(String args[]) {             Date date = new Date();       System.out.print(date);    } }OutputThu Nov 02 15:43:01 IST 2018Using the SimpleDateFormat classUsing the SimpleDateFormat class and the parse() method of this you can parse a date string in the required format and create a Date object representing the specified date.ExampleLive Demoimport java.text.ParseException; ... Read More

Format Strings in TypeScript

Shubham Vora
Updated on 14-Sep-2023 02:35:36

52K+ Views

In this tutorial, we will learn to format the strings in TypeScript. The string is the sequence of characters in any programming language, and the same goes for TypeScript. In TypeScript, strings are immutable. The meaning of the immutable is that we can’t change the string character at the particular index, but we can append the character to the string. Below, we will learn different methods to format the string in TypeScript. Using the + operator to merge two or more strings Generally, the '+' operator performs the addition operation of two or more numbers. When we use the + ... Read More

Find Unique Elements in an Array using C

Bhanu Priya
Updated on 14-Sep-2023 02:28:29

34K+ Views

ProblemFind the non-repeating element in an array by using the two loops. One is for the current element and the other is to check, if an element is already present in an array or not.SolutionConsider an example given below −15, 15, 16, 15, 13, 15Here, the non-repeated elements in an array are 16 and 13.AlgorithmRefer an algorithm given below for finding the unique or the non-repeated elements in an array.Step 1 − Declare an array and input the array elements at run time.Step 2 − Start traversing the array and check, if the current element is already present in an ... Read More

Find Maximum of Four Integers in C

Arnab Chakraborty
Updated on 14-Sep-2023 02:25:05

38K+ Views

Suppose we have four numbers a, b, c, and d. We shall have to find maximum among them by making our own function. So we shall create one max() function that takes two numbers as input and finds the maximum, then using them we shall find maximum of all four numbers.So, if the input is like a = 5, b = 8, c = 2, d = 3, then the output will be 8To solve this, we will follow these steps −define a function max(), this will take x and yreturn maximum of x and ytake four numbers a, b, ... Read More

Add Average Grand Total Line in a Pivot Chart in Excel

Pradeep Kumar
Updated on 14-Sep-2023 02:23:46

44K+ Views

Have you ever attempted to include an average line or grand total line in an Excel pivot chart? It appears difficult to show or add an average/grand total line like you would in a typical chart. Create Pivot table Let’s understand step by step with an example. Step 1 In the first, we must create a sample data for creating pivot table as shown in the below screenshot. Step 2 Now, select the data range from A1:B15. Click on the Insert tab on the toolbar ribbon and then select pivot table option to insert pivot table for the selected ... Read More

Use Datetime Input Type in HTML

Arjun Thakur
Updated on 14-Sep-2023 02:22:10

29K+ Views

The datetime input type is used in HTML using the . Using this, allow the users to select date and time. A date time picker popup is visible whenever input field is clicked.Note − The input type datetime is not supported in Firefox and Internet Explorer. It works on Google Chrome.ExampleYou can try to run the following code to learn how to use datetime input type in HTML.           HTML input datetime                        Details:          Student Name          Exam Date and Time                    

Get Value of Entry Widget in Tkinter

Dev Prakash Sharma
Updated on 14-Sep-2023 02:16:45

43K+ Views

Let us suppose that we have created an Entry widget and we want to get the value of it. In this case, we can use the .get() method. It maps the input object into a variable which can be used further to print or display the entered value.ExampleIn this example, we will create an application that will display the input text thorough a label widget.#Import tkinter library from tkinter import * from tkinter import ttk #Create an instance of tkinter frame or window win= Tk() #Set the geometry of tkinter frame win.geometry("750x250") def get_value():    e_text=entry.get()    Label(win, text=e_text, font= ... Read More

Advertisements