Found 27104 Articles for Server Side Programming

How to Check If Python Package Is Installed?

Niharika Aitam
Updated on 09-Aug-2023 10:57:54

2K+ Views

In Python we have a number of modules and packages which needs to be installed to work with. We have various ways to check if a python package is installed in python environment. Package is a directory which contains one or more python modules and also has the __init__.py file which is an initialization file. For using the package, we have to import it by its name. These can be inbuilt packages or allows developers to create the reusable code that can be imported into other programs by avoiding the duplicating of code. Using try and except When we ... Read More

How to check if Pandas column has value from list of string?

Niharika Aitam
Updated on 09-Aug-2023 10:52:40

2K+ Views

In pandas library, we create the data in the form of rows and columns. The columns can be of string data type. The list of strings means the list containing the string elements. Pandas is one of the libraries in python which is abbreviated as Python Data Analysis Library. It is used to perform data analysis, data cleaning, data manipulations and scientific calculations. The data in pandas library is represented in columns and rows. It has many functions and modules which are used to perform data analysis and manipulations. Python provides different ways to check if pandas column has ... Read More

How to check if an object is iterable in Python?

Niharika Aitam
Updated on 09-Aug-2023 10:36:47

535 Views

Iterable object is the object that can be iterated through all its elements using a loop or an iterable function. The lists, string, dictionary, tuples etc. are all known as iterable objects. There are different ways to check if an object is iterable or not in the Python language. Let’s see them one by one. Using a loop In python, we have two looping techniques, one is using the ‘for’ loop and the other is using the ‘while’ loop. Using any one of these two loops, we can check whether the given object is iterable or not. Example In ... Read More

How to check if an application is open in Python?

Niharika Aitam
Updated on 09-Aug-2023 10:31:35

3K+ Views

A program under execution is known as process. A process can be applications running on the current operating system or, applications related to the Operating system. If an application is related to operating system, firstly it will create a process to execute itself. The other applications rely on operating system services for execution. Most of the applications are OS services and the background applications that maintain the operating system, software and Hardware. We have different ways in python to check whether if an application is open or not. Let’s see them one by one in detail. Using ... Read More

How to check the file size?

Niharika Aitam
Updated on 09-Aug-2023 10:30:38

266 Views

Files are used to store certain data based on user requirement. A file can contain any type of information suchas audio, text, images, video or program. Depending on the data present in a file, the size of a file varies. The size of a file is measured in bits or bytes. A bit is the smallest unit of information which is typically represented by a single value: either 0 or 1. Bytes are used to measure the amount of data in a file and the bytes are denoted by 8 bits. There are several ways to check the file ... Read More

How to check Django version?

Niharika Aitam
Updated on 09-Aug-2023 10:27:23

499 Views

Django is a free, open source web framework which is written in python and works with the python language. It follows the Model view controller(MVC) architectural pattern. This is manly used to develop the web applications in an easy and faster way with minimal fuss. The key features of the Django framework are as follows. It provides Object – relational mapper (ORM) for database management. It helps in URL routing and handling of HTTP requests and responses. Provides the templating engines to generate the HTML pages. It has built-in user authentication and administration Django supports the third party modules ... Read More

How to check any script is running in linux using Python?

Niharika Aitam
Updated on 09-Aug-2023 10:25:18

3K+ Views

The psutil module in Python helps us to retrieve information about the processes that are currently running in our local system. What is a script? AScript is a set of instructions that are written in programming language and executed in the computer. We can perform a variety of simple to complex repetitive tasks within less time. In Linux, the scripts are often executed through the command line using the shell interpreters like Bash or python. These scripts can also be scheduled to run at a particular times using the cron or systemd. Installing psutil module To work with ... Read More

How to change ticks label sizes using Python’s Bokeh

Niharika Aitam
Updated on 09-Aug-2023 10:23:53

115 Views

Bokeh is one of the data visualization libraries available in python, which allows the users to create the interactive plots, data applications, dashboards in web browsers. The Bokeh provides us varieties of plots and charts such as scatter plot, line plot, bar charts and area charts etc. and also more specialized heat maps and geographic maps. This is an Open source library with the active developer community. Creating Plots using Bokeh in Python The Bokeh library provides two main interfaces for creating the plot, one is low level interface which is used to develop the plots from the individual components ... Read More

Ways to Convert Boolean Values to Integer in Python

Aayush Shukla
Updated on 07-Aug-2023 21:58:38

939 Views

Python is a widely used programming language used for different purposes all over the world like web development, data science, machine learning and to perform various processes with automation. The output of Boolean is in the form of True & False. So, if we want to convert it into integer, we can represent true as 1 and false as 0. In this article we will learn about the different ways to convert Boolean values into Integer. Different Ways to Convert Boolean Value to Integer Integer Function In this method we will run the integer function along ... Read More

How to change the PyGame icon?

Niharika Aitam
Updated on 09-Aug-2023 10:22:22

711 Views

While building video games, we often try to setup an image or logo for that developed game. Python provides a function in pygame named, set_icon(), which sets the icon as desired. Pygame is a set of modules that allows us to develop the games and multimedia applications. This is built in top of the SDL(Simple Direct Media Layer) library which has low access to the audio keyboard, mouse, joystick and graphics hardware through OpenGL and Direct3D. Syntax Following is the syntax for setting the icon for the game - pygame_icon = pygame.image_load(“image_name”) pygame.display.set_icon(pygame_icon) Where, pygame_icon is the name ... Read More

Advertisements