S Vijay Balaji

S Vijay Balaji

31 Articles Published

Articles by S Vijay Balaji

Page 3 of 4

How to validate data using Cerberus in python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 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

How to Match patterns and strings using the RegEx module in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 305 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

How to encrypt and decrypt data in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 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

How to create powerpoint files using Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 17K+ 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

How to control your mouse and keyboard using the pynput library in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 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

How to Build your own website using Django in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 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

How to build a simple GUI calculator using tkinter in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 996 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

How to access and convert time using the time library in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 512 Views

IntroductionThe time library in Python is used to obtain time in the real world and perform various tasks related to it. You can even manipulate execution time using this module.Getting StartedThe time module comes packaged with Python. This means you do not have to install it separately using the PIP package manager.In order to use its various functions and methods, you must first import it.import timePrinting current local timeIn order to print the current local time, we will be using the ctime() function.But firstly, we must obtain the number of seconds since epoch. That is, the number of seconds since ...

Read More

Documentation generation using the pydoc module in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 8K+ Views

IntroductionThe pydoc module automatically generates documentation from Python modules. The documentation can be saved as pages of text on the console, displayed on the web browser, or even as HTML files.In this article you will be learning methods to view these documentations in various cases and even learn about docstrings that help you create your own documentation for your python scripts.Now that you know the use of pydoc, let us get started.Getting StartedThe pydoc module comes packaged along with Python, which means you don’t have to download and install it separately.In order to access pydoc, you can must first import ...

Read More

Copy and paste to your clipboard using the pyperclip module in Python

S Vijay Balaji
S Vijay Balaji
Updated on 11-Feb-2021 2K+ Views

IntroductionWe will be using the pyperclip module in order to copy and paste content to the clipboard. It is cross−platform and works on both Python 2 and Python 3.Copying and pasting from and to the clipboard could be very useful when you want the output of the data to be pasted elsewhere in a different file or software.Getting StartedThe pyperclip module does not come packaged with Python. In order to access it, you must first download and install it. You can do this using the PIP package manager.Launch your terminal and type the command below to install pyperclippip install pyperclipOnce ...

Read More
Showing 21–30 of 31 articles
Advertisements