Pradeep Elance has Published 417 Articles

Python Generate QR Code using pyqrcode module?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:46:33

500 Views

A QR code consists of black squares arranged in a square grid on a white background, which can be read by an imaging device such as a camera. It is widely used for many commercial tracking applications and payment and website login etc. for various applications aimed at mobile-phone users. ... Read More

Python Front and rear range deletion in a list?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:44:05

202 Views

Using list slicingIn this approach we use slicing from both the front and rear of the list. The result is stored into a new list. The number of elements to be sliced can be a variable.Example Live DemolistA = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] # Given list print("Given ... Read More

Python Float Layout in Kivy?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:41:42

582 Views

Kivy is an open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. It is used to develop the Android application, as well as Desktops applications. In this article we will see how to use the FloatLayout widget to create ... Read More

Python file parameter in print()?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:36:23

984 Views

The regular use of the print() function is to display text either in the command-line or in the interactive interpreter. But the same function can also write into a file or an output stream.Printing to fileIn the example we can open a file with a new filename in write mode ... Read More

Python Extract specific keys from dictionary?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:33:40

2K+ Views

Dictionaries are most extensively used data structures in python. They contain data in form of keys and values. In this example we will see how to get the items form a dictionary specific to a given set of keys.With dictionary comprehensionIn this approach we simply loop through the dictionary using ... Read More

Python Count set bits in a range?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:31:45

318 Views

A given positive number when converted to binary, has a number of setbits. Set bits in a binary number is represented by 1. In this article we will see how to get the number of setbits in a given number after it is converted to binary value.Using bin and slicingIn ... Read More

Python Convert nested dictionary into flattened dictionary?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:28:35

2K+ Views

As the world embraces more unstructured data, we come across many formats of data where the data structure can be deeply nested like nested JSONS. Python has the ability to deal with nested data structure by concatenating the inner keys with outer keys to flatten the data. In this article ... Read More

Python Checkbox widget in Kivy?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:21:28

583 Views

Kivy is an open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. It is used to develop the Android application, as well as Desktops applications. In this article we will see how to use the GridLayout and CheckBox.After importing ... Read More

Python Check if suffix matches with any string in given list?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:17:24

397 Views

Many times we need to analyze if a given word is present in a given list. That helps us in further processing the business logic for the data. In this article we see how to find if a given suffix which is a string is present in a list with ... Read More

Memory-mapped file support in Python (mmap)?

Pradeep Elance

Pradeep Elance

Updated on 12-Jan-2021 13:14:23

1K+ Views

When you read a file object to a python program and want to modify, it can be done in two ways. First way is to modify the content in the physical storage drive where the file is located and the second way is to modify it directly in the memory ... Read More

Advertisements