Python Articles - Page 79 of 929

Create a box in Python GTK+ 3

Atharva Shah
Updated on 09-Aug-2023 16:26:52

2K+ Views

GTK+ 3 is a sophisticated and used graphical user interface library (GUIs). It comes with an extensive range of tools and widgets for creating cross-platform interactive and appealing apps. Let us concentrate on the fundamentals of GTK+ 3 and its box layout to manage and arrange widgets within a window. Setup Windows users require the Windows Subsystem for Linux (WSL). It uses Linux commands and PyGObject in Windows contexts. This simplifies access to libraries and GObject Introspection bindings. When you have it: pip install PyGObject sudo apt install libcairo2-dev python3-gi gir1.2-gtk-3.0gcc libgirepository1.0-dev gobject-introspection pkg-config ... Read More

Opening Links Using Selenium in Python

Sai Mohan Pulamolu
Updated on 09-Aug-2023 16:35:59

3K+ Views

When working with automation tasks, opening links programmatically is a very common requirement. Selenium, a popular web testing framework, provides powerful tools to handle web pages and perform various actions like opening links and etc. In this article, we will learn various methods to open links in Selenium using Python. Prerequisites Before we get started just make sure that you have the following software installed: Python: Install Python, if you haven't already. Selenium: Install Selenium by running pip install selenium in your command prompt. Web Driver: Selenium requires a web driver to interface with the chosen browser. You need to download ... Read More

Iterate Through List of Dictionaries in Python

Sai Mohan Pulamolu
Updated on 09-Aug-2023 16:08:16

11K+ Views

In this article, we will learn various methods to iterate through the list of dictionaries in Python. When working with data in Python, it is very common to encounter scenarios where you have a list of dictionaries. Each dictionary represents an individual data entry, and you need to perform operations or extract specific information from these dictionaries. Using a For Loop and Dictionary Access Methods The approach is to use a for loop to iterate through each dictionary in the list. Inside the loop, we can use dictionary access methods like keys(), values(), or items() to retrieve the keys, values, ... Read More

Iterate Over Words of a String in Python

Sai Mohan Pulamolu
Updated on 09-Aug-2023 15:56:15

2K+ Views

In this article, we will learn various methods to iterate over words of a string in Python. Understanding how to access and manipulate words in a string is a very important skill for any Python programmer, as it allows for efficient text processing and analysis. We will discuss the problem statement and provide solutions using different approaches in Python. Using the split() Method Syntax string.split(separator, maxsplit) The split() method takes two optional parameters: separator and maxsplit. By default, the separator is any whitespace, and maxsplit is −1, which means the method will split the string at every occurrence of ... Read More

Pie Syntax (@) in Python

Vishal Gupta
Updated on 29-Sep-2023 14:33:09

398 Views

The Pi method or Pi Syntax is used to decorate a function or method in Python, and is known as a decorator. The pie method is used to modify the behaviour of a function or method. Pie Syntax (@) can be used by simply placing the @ symbol and the name of the decorator function above the definition of the function. When the function is invoked, Python is instructed to use the decorator. Pie Syntax (@) has the benefit of allowing for more adaptability in function calls. When working with complicated data structures or when you need to put in ... Read More

Phrase extraction in String using Python

Vishal Gupta
Updated on 29-Sep-2023 11:18:53

384 Views

Phrase extraction in Python is the process of identifying meaningful words from a text context. In this, the text is divided into sentences, phrases, words etc. and these phrases are displayed with full meaning. This process is useful in areas such as text analysis, machine learning, and supply-demand identification (information retrieval). Phrase extraction can be used in normal language processing (NLP) tasks to separate phrases from sentences. It can help to recognize words that are known as phrases and can be used for translation, summarising etc. Here we have some method to phrase extraction. Method 1 Using list slicing, enumerate(), ... Read More

Pendulum Module in Python

Vishal Gupta
Updated on 29-Sep-2023 14:28:24

891 Views

The Pendulum Module is used in Python for datetime manipulation and time zone management. Using this module, you can manage date, time, and other related things over time. The Pendulum Module's ability to manage time zones easily is one of its main advantages. It makes it simple to deal with dates and times from all around the world since it can instantly convert between various time zones. The Pendulum Module is a powerful tool for anyone who is dealing with time-sensitive data. You can install this module with following command − pip install pendulum We have some methods in Pendulum ... Read More

Show Pearson type-3 Distribution in Statistics using Python

Vishal Gupta
Updated on 29-Sep-2023 14:44:22

564 Views

The Pearson Type-3 Distribution is a continuous probability distribution that is widely used in statistics. It has a skewed distribution. Three parameters determined the shape of distribution: location, scale, and shape. Discovering this type of distribution would enable statisticians to analyse their data more effectively and make more precise predictions. We can use pearson3.rvs function to generate random numbers from the distribution, and calculate the pdf (probability density function) at a given point with the help of pearson3.pdf function. Parameters of Pearson type-3 distribution Shape parameter − This parameter determines the spread through the probability density of the distribution. ... Read More

How to pass multiple arguments to a map function in Python?

Vishal Gupta
Updated on 29-Sep-2023 10:50:46

2K+ Views

The map function is an in−built function in Python, which applies a given function to each and every element in an iterable (list, tuple, etc.) and returns an iterator of the result in the list. We can also use multiple arguments in the map function. Syntax This syntax is used in all the following examples − map(function, argument1, argument2, .....) Method 1: Use multiple arguments with map function Example write a program to add two list elements with the help of map function. def add(a, b): return a + b # Create two lists list1 ... Read More

path_curve_to_quadratic_bezier() function in Python Wand

Vishal Gupta
Updated on 29-Sep-2023 14:01:10

426 Views

The bezier is an inbuilt drawing function in python. It is used to draw curves in python according to given points. The quadratic bezier is a Python function that draws a path through vertices( control points) for a quadratic bezier wind. A quadratic Bezier wind is a parametric wind that defines a path in 2- dimensional space. This wind is linked by a control point with two ending points. In a visualisation programme, you may construct and draw easily using this function. With the use of the time parameter, you may locate two control points and determine their locations. You ... Read More

Advertisements