Posts

Python to automate What's App messages

Image
 Python to automate What's App messages  We can automate a Python script to send WhatsApp messages. In this article, we will learn the easiest ways using pywhatkit module that the website web.whatsapp.com uses to automate the sending of messages to any WhatsApp number. Send WhatsApp Messages  : We can automate WhatsApp to send messages by running a python script.  Now let's setup  pywhatkit  module and write the code to send WhatsApp message automatically. Install pywhatkit module: To install the pywhatkit module, we can use the pip command: pip install pywhatkit This command will download the  pywhatkit  module. It will take some time as it will download some related modules too. LIKE BELOW SCRIPT WILL RUN AUTOMATICALLY:::: (venv) C:\Users\RCF\PycharmProjects\pywhatkitWhatsAppAutomate>pip install pywhatkit Collecting pywhatkit   Downloading pywhatkit-3.9-py3-none-any.whl (9.1 kB) Collecting beautifulsoup4   Downloading beautifulsoup4...

RESTful APIs with Flask in PyCharm

Image
  Building RESTful APIs with Flask in PyCharm Building RESTful APIs with Flask in Py-Charm involves setting up a Flask project, writing API endpoints, and running the application.  Installing packages Once your virtualenv is ready, click the “Install” button to begin installing packages. We’ll be installing three packages for our project: Flask  (install either by pycharms STTINGS-----PYTHON INTERPRETOR (+)) Flask-Restless  (for building the RESTful API) Flask-SQLAlchemy  (for connecting to our database) || OR  MySQLdb In Pycharms (Main.py):write below code here change parameters as per your database: import flask from flask import Flask, json, request, jsonify from flask_mysqldb import MySQL, MySQLdb # pip install flask-mysqldb https://github.com/alexferl/flask-mysqldb app = Flask(__name__) app.secret_key = "2021" app.config[ 'MYSQL_HOST' ] = 'localhost' app.config[ 'MYSQL_USER' ] = 'root' app.config[ 'MYSQL_PASSWORD' ] = ''...

Python Pandas As Json

Image
 Python Pandas As Json Pandas allows us to analyze big data and make conclusions based on statistical theories. Pandas can clean messy data sets, and make them readable and relevant. Pandas gives you answers about the data. Like: Is there a correlation between two or more columns? What is average value? Max value? Min value? Pandas are also able to delete rows that are not relevant, or contains wrong values, like empty or NULL values. This is called  cleaning  the data. Installation of Pandas If you have Python and PIP already installed on a system, then installation of Pandas is very easy. (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\RCF>cd.. C:\Users>cd.. C:\>cd Python3.9.1 C:\Python3.9.1>cd Scripts C:\Python3.9.1\Scripts> pip install pandas Collecting pandas   Downloading pandas-1.2.0-cp39-cp39-win_amd64.whl (9.3 MB)      |████████████████████████████████| 9.3 MB 18 kB/s Collecting python-dateutil...

Python MySQL – Select Query

Image
  Python MySQL – Select Query Python Database API ( Application Program Interface ) is the Database interface for the standard Python. This standard is adhered to by most Python Database interfaces. There are various Database servers supported by Python Database such as MySQL, GadFly, mySQL, PostgreSQL, Microsoft SQL Server 2000, Informix, Interbase, Oracle, Sybase etc. To connect with MySQL database server from Python, we need to import the mysql.connector module. Below is a program to connect with MySQL database geeks.  Here is a Python example to perform a SELECT query from a MySQL database using the mysql-connector-python library: Step 1: Install the Required Library If you haven't already installed the library, run: bash pip install mysql-connector-python Step 2: Example Code for SELECT Query python import mysql.connector from mysql.connector import Error try : # Connect to the MySQL database connection = mysql.connector.connect( host= 'your_host...

Python MySQL with WAMP

Image
  Install MySQL Driver Python is a high-level, general-purpose, and very popular programming language. Basically, it was designed with an emphasis on code readability, and programmers can express their concepts in fewer lines of code. We can also use Python with SQL. In this article, we will learn how to connect SQL with Python using the ‘MySQL Connector Python module. The diagram given below illustrates how a connection request is sent to MySQL connector Python, how it gets accepted from the database and how the cursor is executed with result data. Move to ur Python Scripts location Microsoft Windows [Version 10.0.18363.1256] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\RCF>cd.. C:\Users>cd.. C:\>cd Python3.9.1 C:\Python3.9.1>cd Scripts C:\Python3.9.1\Scripts>python -m pip install mysql-connector-python Collecting mysql-connector-python   Downloading mysql_connector_python-8.0.22-py2.py3-none-any.whl (374 kB)      |███████...

Install WAMP server to run python

Image
 Install WAMP + PYTHON Integration I'd be glad to assist you with installing WAMP server to run Python. However, it's important to note that WAMP is primarily designed for running PHP applications, and Python typically has its own dedicated environments like Anaconda or virtual environments. Important Considerations: WAMP's Primary Purpose: WAMP is primarily designed for running PHP applications. Using it for Python might not be the most optimal or efficient approach. Dedicated Python Environments: For dedicated Python development, consider using Python-specific environments like Anaconda or virtual environments. These environments provide better control over Python versions and packages. Web Framework Choice: If you need to run Python web applications, carefully evaluate the features and requirements of different web frameworks to choose the best one for your project. How to set up wamp to run Python programs and php on your own computer. SQL works also. Only tested on ...

Python – Color Detection using Pandas & OpenCV

Image
  Python – Color Detection using Pandas & OpenCV What is Color Detection? Color detection is the process of detecting the name of any color. Simple isn’t it? Well, for humans this is an extremely easy task but for computers, it is not straightforward. Human eyes and brains work together to translate light into color. Light receptors that are present in our eyes transmit the signal to the brain. Our brain then recognizes the color. Since childhood, we have mapped certain lights with their color names. We will be using the somewhat same strategy to detect color names. Prerequisites Before starting with this Python project with source code, you should be familiar with the computer vision library of Python that is  OpenCV  and  Pandas . OpenCV, Pandas, and numpy are the Python packages that are necessary for this project in Python. To install them, simply run this pip command in your terminal: pip install opencv-python numpy pandas Run Python File The beginner Python...