Posts

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

Redirecting to another page with button click in Python-flask

Image
  Redirecting to another page with  click in Python-flask Flask is a backend server that is built entirely using Python. It is a  framework that consists of  Python  packages and modules. It is lightweight which makes developing backend applications quicker with its features. Suppose we have to attach any html page Link in any webpage in python  < a class ="dropdown-item" href = "{{ url_for('terms') }}" >< span class ="item-text" > Terms Conditions </ span ></ a > < div class ="dropdown-items-divide-hr" ></ div > < a class ="dropdown-item" href = "{{ url_for('privacy') }}" >< span class ="item-text" > Privacy Policy </ span ></ a > Redirect to a URL in Flask A redirect is used in the Flask class to send the user to a particular URL with the status code. conversely, this status code additionally identifies the issue. When we ac...

Web application using Flask

Image
  Web application using Flask and deploy it to the cloud It makes the process of designing a web application simpler. Flask lets us focus on what the  users are requesting and what sort of response to give back. How Does a Flask App Work? The code lets us run a basic web application that we can serve, as if it were a website. from flask import Flask app = Flask ( __name__ ) @app . route ( "/" ) def home ( ) : return "Hello, World!" if __name__ == "__main__" : app . run ( debug = True ) This piece of code is stored in our main.py. Line 1:  Here we are importing the Flask module and creating a Flask web server from the Flask module. Line 3: __name__ means this current file . In this case, it will be main.py. This current file will represent my web application. We are creating an instance of the Flask class and calling it app. Here we are creating a new web application. Line 5:  It represents the default page. For example, if I go t...