What is Python's os Module

S Vijay Balaji
Updated on 11-Feb-2021 06:47:49

2K+ Views

IntroductionThe OS module in Python comes with various functions that enables developers to interact with the Operating system that they are currently working on. In this article we’ll be learning mainly to create and delete a directory/folder, rename a directory and even basics of file handling.Without further ado, let’s get started.Getting StartedPython’s OS module comes packaged within python when installed. This means you do not need to separately install it using PIP. In order to access its various methods/functions, you just need to import the module.import osNow that you’ve imported the module, you can start using its various functions.Getting current ... Read More

Reading and Writing Excel Files Using OpenPyXL Module in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:46:38

2K+ Views

Introductionopenpyxl is a Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files.It was born from lack of existing library to read/write natively from Python the Office Open XML format.An excel file that we use for operation is called Workbook that contains a minimum of one Sheet and a maximum of tens of sheets.One sheet consists of rows starting from 1 and columns starting from A.Using the openpxyl library, we can perform various functions including adding sheets and data, manipulate and even delete said data.Now that we know what we are dealing with, let us get started.Getting StartedThe openpyxl does not come ... Read More

Validate Data Using Cerberus in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:44:52

2K+ Views

IntroductionThe Cerberus module in python provides powerful yet lightweight data validation functions. It is designed in such a way that you can extend it to various applications and custom validations.We first define a schema and then validate the data against the scheme and check if it matches the provided conditions or not. If not, accurate errors are thrown to display where it went wrong.Various conditions can be applied at once to the data field for validation.Getting startedIn order to use Cerberus, you must first install it, as it does not come packaged with Python.In order to download and install it, ... Read More

Match Patterns and Strings Using the Regex Module in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:42:22

252 Views

IntroductionThe RegEx module stands for Regular expressions. If you have already worked on programming, you would have come across this term several times already. We use the Regular expressions to search and replace, it is used in various text editors, search engines, word processors, etc.In other words, it helps match a certain pattern that you are looking for.A good example for this would be how your collage website allows you to use only your university mail and none of the other extensions.Getting StartedThe regular expression module comes packaged within Python. You do not need to download and install it separately.In ... Read More

Encrypt and Decrypt Data in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:39:10

18K+ Views

IntroductionWhat is cryptography? Cryptography deals with the conversion of plain text into cipher text which is called encryption of data and cipher text back to plain text which is called decryption of data.We will be using the fernet module in the cryptography package to encrypt and decrypt data using Python. While using the fernet module, a unique key is generated without which you cannot read or manipulate the encrypted data.Now that you know what we will be dealing with, let’s get started.Getting StartedThe cryptography module does not come packaged with Python, which means you will have to install it using ... Read More

Create PowerPoint Files Using Python

S Vijay Balaji
Updated on 11-Feb-2021 06:36:51

16K+ Views

IntroductionWe’ve all had to make PowerPoint presentations at some point in our lives. Most often we’ve used Microsoft’s PowerPoint or Google Slides.But what if you don’t have membership or access to the internet? Or what if you just wanted to do it the “programmers” way?Well, worry not for Python’s got your back!In this article you’ll learn how to create a PowerPoint file and add some content to it with the help of Python. So let’s get started!Getting StartedThroughout this walkthrough, we’ll be using the python-pptx package. This package supports different python versions ranging from 2.6 to 3.6.So, make sure you ... Read More

Control Mouse and Keyboard Using Pynput Library in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:34:27

5K+ Views

IntroductionThe pynput library allows you to control and monitor/listen to your input devices such as they keyboard and mouse.The pynput.mouse allows you control and monitor the mouse, while the pynput.keyboard allows you to control and monitor the keyboard.In this article, we will be moving the cursor to a specific position, automate clicks, and simulate keystrokes from the keyboard.Without further ado, let’s get started.Getting StartedSince the pynput module does not come packaged with Python, you will have to manually download and install it using the pip package manager.To do this, launch your terminal and use the command below.pip install pynputOnce the ... Read More

Build Your Own Website Using Django in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:32:31

8K+ Views

IntroductionDjango is a Python web framework that is both free and open source.Why Use Django?It’s very fast.Comes with a lot of pre-existing features like user authentication, site maps, RSS feeds.It is very secure and prevents a lot of security mistakes like SQL Injection, cross−site scripting, clickjacking etc.It is very scalable and thus can be used even when the network traffic is exceedingly high.Now that you know why we would be using Django to build our web application. Let us start setting up the ground work for it.Setting up an environmentWhile building our web application, we will be using various packages ... Read More

Build Your Own SQLite Database in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:29:59

705 Views

IntroductionBeing a programmer it is essential to learn to use databases in our applications to store, retrieve, manipulate, and delete data with ease. Python comes with the SQLite package preinstalled with it, using which we can create and manipulate SQLite databases.SQLite databases are written in a single file and are hence are easier to use and access. You can easily manipulate the data within and hence is very easy for data analysis. It is very simple and easy to setup and use.Getting StartedNow that you know, what SQLite is and why we use it, let us get started with how ... Read More

Build a Simple GUI Calculator Using Tkinter in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:27:57

876 Views

IntroductionIn Python, we use the tkinter library to create GUI components and craft better user interface.In this article you will learn methods to build a simple GUI based calculator application.Getting startedBefore we jump into it, there are a few things we need to get organised first.Let us start by downloading Python’s imaging library that we will be using to get images from our local system. In order to install PIL(Pillow), launch you terminal and type the command below.pip install PillowNow that you have the package installed. You will have to download icons needed for the calculator.You can go on Google ... Read More

Advertisements