Giter VIP home page Giter VIP logo

python-scripts's Introduction

Usage

  1. Install the required dependencies by running the following command:
pip install pyscreenshot Pillow
  1. Run the script using the following command:
python screenshot.py

Code

import pyscreenshot
import PIL

capture = pyscreenshot.grab()  # to capture the screen

# to display captured screen
capture.show()

# to save screenshot
capture.save("capturedthroughscript.jpg")

2. funfact.py

Generates and prints random fun facts.

Usage

  1. Install the required dependencies by running the following command:
pip install randfacts
  1. Run the script using the following command:
python funfact.py

Code

from randfacts import get_fact

print("Fact of the moment:", get_fact(filter_enabled=False))
print("Stay Silent with these facts:", get_fact(only_unsafe=True))

3. webcrawler.py

Implements a web crawler to find all links on a web page.

Usage

  1. Install the required dependencies by running the following command:
pip install requests beautifulsoup4
  1. Run the script using the following command:
python webcrawler.py

The script will crawl the web page specified in the url variable and print out all the links found.

4. whatsappautomation.py

Automates sending WhatsApp messages using the pywhatkit library.

Usage

  1. Install the required dependencies by running the following command:
pip install pywhatkit
  1. Update the phone_number, message, hour, and minute variables in the script with your desired values.

  2. Run the script using the following command:

python whatsappautomation.py

The script will send the specified message to the provided phone number at the specified time.

5. camimg.py

Captures an image from the default camera and saves it as a JPEG file.

Usage

  1. Install the required dependencies by running the following command:
pip install cv2
  1. Run the script using the following command:
python camimg.py

Code

import cv2

imgcapture = cv2.VideoCapture(0)
result = True
while(result):
    ret, frame = imgcapture.read()
    cv2.imwrite("test.jpg", frame)
    result = False
    print("Image Captured...")

6. ServerScript.py

Implements a TCP chat server that allows clients to connect and send messages.

Usage

  1. Install the required dependencies by running the following command:
pip install socket
  1. Run the script using the following command:
python ServerScript.py

The script will start a TCP server on port 3000 and listen for incoming connections. When a client connects, the script will print the client's address and receive messages from the client. The script will also send messages to the client.

7. findthegold.py

A game where you try to find the hidden gold on a 3x3 grid.

Usage

  1. Run the script using the following command:
python findthegold.py

8. fizzbuzz.py

Generates a random number and applies the FizzBuzz rules.

Usage

  1. Run the script using the following command:
python fizzbuzz.py

9. twodicerolling.py

Simulates rolling two dice and displays the results.

Usage

  1. Run the script using the following command:
python twodicerolling.py

10. billroulette.py

Randomly selects a person to pay the bill.

Usage

  1. Run the script using the following command:
python billroulette.py

11. removebackground.py

Removes the background from an image and saves it as a transparent image.

Usage

  1. Install the required dependencies by running the following command:
pip install opencv-python
  1. Run the script using the following command:
python removebackground.py

The script will remove the background from the input image and save the result as a transparent image.

python-scripts's People

Contributors

therealsaitama avatar

Stargazers

Aakriti Kaushik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.