Django ORM – Inserting, Updating & Deleting Data Django lets us interact with its database models, i.e. add, delete, modify and query objects, using a database-abstraction API called ORM(Object Relational Mapper). This article discusses all the useful operations we can
break, continue and pass in Pythonbreak, continue and pass in Python
break, continue and pass in Python Using loops in Python automates and repeats the tasks in an efficient manner. But sometimes, there may arise a condition where you want to exit the loop completely, skip an iteration or ignore that
Saving a Video using OpenCVSaving a Video using OpenCV
Saving a Video using OpenCV OpenCV is an open-source and most popular computer vision library that contains several computer vision algorithms. You can read, display, write and doing lots of other operations on images and videos using OpenCV. The OpenCV
Pandas Series.to_frame()Pandas Series.to_frame()
Python | Pandas Series.to_frame() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for
Desktop Notifier in PythonDesktop Notifier in Python
Desktop Notifier in Python This article demonstrates how to create a simple Desktop Notifier application using Python. A desktop notifier is a simple application which produces a notification message in form of a pop-up message on desktop. Notification content In the example
Instance method in PythonInstance method in Python
Instance method in Python A class is a user-defined blueprint or prototype from which objects are created. Classes provide a means of bundling data and functionality together. Creating a new class creates a new type of object, allowing new
Remove all the occurrences of an element from a list in PythonRemove all the occurrences of an element from a list in Python
Remove all the occurrences of an element from a list in Python The task is to perform the operation of removing all the occurrences of a given item/element present in a list. Examples : Input : 1 1 2
Python program to read character by character from a filePython program to read character by character from a file
Python program to read character by character from a file Given a text file. The task is to read the text from the file character by character. Function used: Syntax: file.read(length) Parameters: An integer value specified the length of data to be
Python program to input a comma separated stringPython program to input a comma separated string
Python program to input a comma separated string Given an input string that is comma-separated instead of space. The task is to store this input string in a list or variables. This can be achieved in Python using two ways:
Get directory of current Python scriptGet directory of current Python script
Get directory of current Python script While working with file handling you might have noticed that files are referenced only by their names, e.g. ‘GFG.txt’ and if the file is not located in the directory of the script, Python raises an error.