Skip to content

Commit b9e16bd

Browse files
Merge pull request #2966 from xavierfingers/master
Made some changes.
2 parents 1074d38 + aa6e7c0 commit b9e16bd

14 files changed

+11
-50
lines changed

MySQL_Databses.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import mysql.connector
2-
32
# MySQl databses details
4-
3+
host = input("Enter MySQL host: ")
4+
username = input("Enter MySQL username: ")
5+
password = input("Enter MySQL password: ")
6+
db_name = input("Enter MySQL database: ")
57
mydb = mysql.connector.connect(
6-
host="0.0.0.0", user="root", passwd="", database="db_name"
8+
host=host, user=username, passwd=password, database=db_name
79
)
810
mycursor = mydb.cursor()
9-
1011
# Execute SQL Query =>>>> mycursor.execute("SQL Query")
1112
mycursor.execute("SELECT column FROM table")
1213

WeatherGUI.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import tkinter as tk
22
import requests
33
from bs4 import BeautifulSoup
4-
54
url = "https://weather.com/en-IN/weather/today/l/32355ced66b7ce3ab7ccafb0a4f45f12e7c915bcf8454f712efa57474ba8d6c8"
6-
75
root = tk.Tk()
86
root.title("Weather")
97
root.config(bg="white")
10-
11-
128
def getWeather():
139
page = requests.get(url)
1410
soup = BeautifulSoup(page.content, "html.parser")

Web Socket.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Program to print a data & it's Metadata of online uploaded file using "socket".
22
import socket
3-
43
skt_c = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
54
skt_c.connect(("data.pr4e.org", 80))
65
link = "GET http://data.pr4e.org/intro-short.txt HTTP/1.0\r\n\r\n".encode()

billing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
updated_billing
1+
22
items = {"apple": 5, "soap": 4, "soda": 6, "pie": 7, "cake": 20}
33
total_price = 0
44
try:
@@ -10,7 +10,7 @@
1010
Press 5 for cake
1111
Press 6 for bill""")
1212
while True:
13-
choice = int(input("enter your choice here..\n"))
13+
choice = int(input("enter your choice here.."))
1414
if choice == 1:
1515
print("Apple added to the cart")
1616
total_price += items["apple"]
@@ -37,7 +37,6 @@
3737
print("Please enter the digits within the range 1-6..")
3838
except:
3939
print("enter only digits")
40-
4140
"""
4241
Code Explanation:
4342
A dictionary named items is created to store product names and their corresponding prices.

calc_area.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Author: PrajaktaSathe
22
# Program to calculate the area of - square, rectangle, circle, and triangle -
33
import math as m
4-
5-
64
def main():
75
shape = int(
86
input(
@@ -38,7 +36,6 @@ def main():
3836
print("You have selected wrong choice.")
3937

4038
restart = input("Would you like to calculate the area of another object? Y/N : ")
41-
4239
if restart.lower().startswith("y"):
4340
main()
4441
elif restart.lower().startswith("n"):

mapit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
import webbrowser
33
import pyperclip
4-
54
if len(sys.argv) > 1:
65
address = " ".join(sys.argv[1:])
76

new.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
def hello_world():
2-
"""
3-
Prints a greeting message.
4-
"""
5-
print("Hello, world!")
61

7-
8-
if __name__ == "__main__":
9-
hello_world()
2+
print("Hello, world!")
3+

passwordGen.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import random
2-
32
lChars = "abcdefghijklmnopqrstuvwxyz"
43
uChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
54
digits = "1234567890"
6-
specialChars = "!@#$%^&*-_+="
7-
5+
specialChars = "!@#$%^&*-_+=()[]"
86
myPass = ""
9-
107
# Generate 3 lowercase letters
118
for _ in range(3):
129
myPass += random.choice(lChars)
@@ -23,4 +20,4 @@
2320
for _ in range(2):
2421
myPass += random.choice(uChars)
2522

26-
print(myPass) # Output: 10-character password (e.g. "abc123!@AB")
23+
print(myPass)

sendemail.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from __future__ import print_function
2-
32
import base64
43
import mimetypes
54
import os
@@ -17,8 +16,6 @@
1716
SCOPES = "https://www.googleapis.com/auth/gmail.send"
1817
CLIENT_SECRET_FILE = "client_secret.json"
1918
APPLICATION_NAME = "Gmail API Python Send Email"
20-
21-
2219
def get_credentials():
2320
home_dir = os.path.expanduser("~")
2421
credential_dir = os.path.join(home_dir, ".credentials")

sensors_information.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
import sys
33
import socket
44
import psutil
5-
6-
75
def python_version():
86
return sys.version_info
9-
10-
117
def ip_addresses():
128
hostname = socket.gethostname()
139
addresses = socket.getaddrinfo(hostname, None)

0 commit comments

Comments
 (0)