Posts

Showing posts with the label Python

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...

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 Dictionaries

Image
 Python Dictionaries What is a Dictionary? A dictionary in Python is an unordered collection of key-value pairs. It's like a real-world dictionary where you look up a word (key) to find its definition (value). What are the features of the dictionary in Python? In Python, a dictionary is an unordered collection of items that stores data in key-value pairs. Here are the key features of dictionaries: Key-Value Pairs : Each item in a dictionary consists of a key and a corresponding value. Keys must be unique and immutable (e.g., strings, numbers, tuples), while values can be of any data type. Unordered : Dictionaries do not maintain the order of items. However, as of Python 3.7, dictionaries preserve the insertion order of keys. Mutable : Dictionaries can be modified after creation. You can add, remove, or change items. Dynamic Size : The size of a dictionary can grow or shrink as items are added or removed. Fast Lookups : Dictionaries provide average-case time complexity of O(1) for l...