Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions MySQL_Databses.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import mysql.connector

# MySQl databses details

host = input("Enter MySQL host: ")
username = input("Enter MySQL username: ")
password = input("Enter MySQL password: ")
db_name = input("Enter MySQL database: ")
mydb = mysql.connector.connect(
host="0.0.0.0", user="root", passwd="", database="db_name"
host=host, user=username, passwd=password, database=db_name
)
mycursor = mydb.cursor()

# Execute SQL Query =>>>> mycursor.execute("SQL Query")
mycursor.execute("SELECT column FROM table")

Expand Down
4 changes: 0 additions & 4 deletions WeatherGUI.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import tkinter as tk
import requests
from bs4 import BeautifulSoup

url = "https://weather.com/en-IN/weather/today/l/32355ced66b7ce3ab7ccafb0a4f45f12e7c915bcf8454f712efa57474ba8d6c8"

root = tk.Tk()
root.title("Weather")
root.config(bg="white")


def getWeather():
page = requests.get(url)
soup = BeautifulSoup(page.content, "html.parser")
Expand Down
1 change: 0 additions & 1 deletion Web Socket.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Program to print a data & it's Metadata of online uploaded file using "socket".
import socket

skt_c = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
skt_c.connect(("data.pr4e.org", 80))
link = "GET http://data.pr4e.org/intro-short.txt HTTP/1.0\r\n\r\n".encode()
Expand Down
5 changes: 2 additions & 3 deletions billing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
updated_billing

items = {"apple": 5, "soap": 4, "soda": 6, "pie": 7, "cake": 20}
total_price = 0
try:
Expand All @@ -10,7 +10,7 @@
Press 5 for cake
Press 6 for bill""")
while True:
choice = int(input("enter your choice here..\n"))
choice = int(input("enter your choice here.."))
if choice == 1:
print("Apple added to the cart")
total_price += items["apple"]
Expand All @@ -37,7 +37,6 @@
print("Please enter the digits within the range 1-6..")
except:
print("enter only digits")

"""
Code Explanation:
A dictionary named items is created to store product names and their corresponding prices.
Expand Down
3 changes: 0 additions & 3 deletions calc_area.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Author: PrajaktaSathe
# Program to calculate the area of - square, rectangle, circle, and triangle -
import math as m


def main():
shape = int(
input(
Expand Down Expand Up @@ -38,7 +36,6 @@ def main():
print("You have selected wrong choice.")

restart = input("Would you like to calculate the area of another object? Y/N : ")

if restart.lower().startswith("y"):
main()
elif restart.lower().startswith("n"):
Expand Down
1 change: 0 additions & 1 deletion mapit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
import webbrowser
import pyperclip

if len(sys.argv) > 1:
address = " ".join(sys.argv[1:])

Expand Down
10 changes: 2 additions & 8 deletions new.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
def hello_world():
"""
Prints a greeting message.
"""
print("Hello, world!")


if __name__ == "__main__":
hello_world()
print("Hello, world!")

7 changes: 2 additions & 5 deletions passwordGen.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import random

lChars = "abcdefghijklmnopqrstuvwxyz"
uChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
digits = "1234567890"
specialChars = "!@#$%^&*-_+="

specialChars = "!@#$%^&*-_+=()[]"
myPass = ""

# Generate 3 lowercase letters
for _ in range(3):
myPass += random.choice(lChars)
Expand All @@ -23,4 +20,4 @@
for _ in range(2):
myPass += random.choice(uChars)

print(myPass) # Output: 10-character password (e.g. "abc123!@AB")
print(myPass)
3 changes: 0 additions & 3 deletions sendemail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import print_function

import base64
import mimetypes
import os
Expand All @@ -17,8 +16,6 @@
SCOPES = "https://www.googleapis.com/auth/gmail.send"
CLIENT_SECRET_FILE = "client_secret.json"
APPLICATION_NAME = "Gmail API Python Send Email"


def get_credentials():
home_dir = os.path.expanduser("~")
credential_dir = os.path.join(home_dir, ".credentials")
Expand Down
4 changes: 0 additions & 4 deletions sensors_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
import sys
import socket
import psutil


def python_version():
return sys.version_info


def ip_addresses():
hostname = socket.gethostname()
addresses = socket.getaddrinfo(hostname, None)
Expand Down
1 change: 0 additions & 1 deletion sqlite_check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import print_function

import os
import sqlite3 as lite
import sys
Expand Down
2 changes: 0 additions & 2 deletions vowel remover function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ def vowel_remover(text):
if l.lower() not in "aeiou":
string += l
return string


print(vowel_remover("hello world!"))
5 changes: 0 additions & 5 deletions wikipedia.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import wikipedia
from tkinter import *
from tkinter.messagebox import showinfo

win = Tk() # objek
win.title("WIKIPEDIA")
win.geometry("200x70") # function


# function
def search_wiki():
search = entry.get()
Hasil = wikipedia.summary(search)
showinfo("Hasil Pencarian", Hasil)


label = Label(win, text="Wikipedia Search :")
label.grid(row=0, column=0)

Expand Down
6 changes: 0 additions & 6 deletions youtubedownloader.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from tkinter import Button, Entry, Label, Tk, filedialog, messagebox
from threading import Thread
from pytube import YouTube


def threading():
# Call work function
t1 = Thread(target=download)
t1.start()


def download():
try:
url = YouTube(str(url_box.get()))
Expand All @@ -30,7 +26,6 @@ def download():
root.geometry("780x500+200+200")
root.configure(bg="olivedrab1")
root.resizable(False, False)

# Label widgets
introlable = Label(
root,
Expand All @@ -52,5 +47,4 @@ def download():

btn = Button(root, text="DOWNLOAD", font=("sans-serif", 25), command=threading)
btn.place(x=270, y=240)

root.mainloop()