1
0
Fork 0
This commit is contained in:
floofisnout 2024-02-25 15:20:51 +08:00
commit a4a92272ee
5 changed files with 55 additions and 0 deletions

21
fakecrash.py Normal file
View File

@ -0,0 +1,21 @@
while True:
try:
import numpy, cv2
# Display random image in fullscreen window
cv2.namedWindow("crash", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty("crash", cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
cv2.imshow("crash", numpy.random.randint(0, 256, (1600, 2000, 3), dtype=numpy.uint8))
# Wait for 'P' key press
key = cv2.waitKey(0)
while key not in [ord('P'), ord('p')]:
key = cv2.waitKey(0)
cv2.destroyAllWindows()
except Exception as e:
import os
os.system("py -m pip install numpy opencv-python")
print("Error occurred:", e)
continue
break

20
filetypecheck.py Normal file
View File

@ -0,0 +1,20 @@
import os
directory_path = 'D:/root/videos'
def count_files_by_type(directory):
file_counts = {}
for root, dirs, files in os.walk(directory):
for file in files:
file_path = os.path.join(root, file)
file_extension = os.path.splitext(file_path)[1].lower()
if file_extension in file_counts:
file_counts[file_extension] += 1
else:
file_counts[file_extension] = 1
return file_counts
file_counts = count_files_by_type(directory_path)
for file_type, count in file_counts.items():
print(f"{file_type}: {count}")

2
myip.py Normal file
View File

@ -0,0 +1,2 @@
import socket
input(socket.gethostbyname(socket.gethostname()))

10
serve.py Normal file
View File

@ -0,0 +1,10 @@
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()

2
ytd.py Normal file
View File

@ -0,0 +1,2 @@
''' py -m pip install pytube '''
import pytube;pytube.YouTube(input('url: ')).streams.get_highest_resolution().download();print("done")