The .py files are the python source code of a program. While the .pyc files contain the bytecode of the python files. We get bytecode after compilation of .py file (source code). The .pyc files are not …

Last updated 3 years, 10 months ago | 1694 views

Tags:- Python

Yes, it is possible if the base class is instantiated by other child classes or if the base class is a static method.

Last updated 4 years ago | 1692 views

Tags:- Python

Python | What are unit tests Unit test is a testing technique to check a single component of code and ensures that it performs as expected. Unit tests are an important part of regression testing to ensure that …

Last updated 3 years, 10 months ago | 1689 views

Tags:- Python

PEP stands for Python Enhancement Proposal. A PEP is an official design document that describes new features proposed for Python and documents aspects of Python, like design and style, for the community. PEP 8 exists to …

Last updated 4 years ago | 1689 views

Tags:- Python

Django | Model  A model is a Python class in Django that is derived from the django.db.models.Model class. A model is used in Django to represent a table in a database. It is used to interact …

Last updated 4 years ago | 1686 views

Tags:- Django

Django | Difference between a project and an app The project covers the entire application, while an app is a module or application within the project that deals with one dedicated requirement. So, a project consists …

Last updated 4 years ago | 1680 views

Tags:- Django

Python | Main Function In the world of programming languages, the main is considered as an entry point of execution for a program. But in python, it is known that the interpreter serially interprets the file …

Last updated 4 years ago | 1677 views

Tags:- Python

Python | strip() Function | Remove whitespaces from a string  To remove the whitespaces and trailing spaces from the string, Python provides a strip([str]) built-in function. This function returns a copy of the string after removing whitespaces …

Last updated 4 years ago | 1677 views

Tags:- Python

It means that a function can be treated just like an object. You can assign them to variables and pass them as arguments to other functions. You can even return them from another function.  You …

Last updated 4 years ago | 1675 views

Tags:- Python

The csrf_token is used for protection against Cross-Site Request Forgeries. This kind of attack takes place when a malicious website consists of a link, some JavaScript, or a form whose aim is to perform some …

Last updated 4 years ago | 1675 views

Tags:- PHP Django CodeIgniter

Python | __init__  constructor method __init__ is a constructor method in Python and is automatically called to allocate memory when a new object/instance is created. All classes have a __init__ method associated with them.   class Student: …

Last updated 4 years ago | 1674 views

Tags:- Python

Windows | Set path and environment variables in Windows 10 Press the + to access the Power User Task Menu. Now, select the System option. In the About window, click the Advanced system settings link under Related settings from the right side. In the Advanced tab, click the  button. In …

Last updated 3 years, 10 months ago | 1673 views

Tags:- Windows

Using PDB we debug code in python. Some pdb commands include- <b> — Add breakpoint <c> — Resume execution <s> — Debug step by step <n> — Move to next line <l> — List source code …

Last updated 4 years ago | 1672 views

Tags:- Python

Django | Cookie  A cookie is a small piece of information that is stored in the client's browser. It is used to store a user’s data in a file permanently (or for a specified time). Cookie …

Last updated 4 years ago | 1671 views

Tags:- Django

Python |  issubclass() This is done by using a method called issubclass() provided by python. The method tells us if any class is a child of another class by returning true or false accordingly.     …

Last updated 4 years ago | 1670 views

Tags:- Python