Skip to content

Instantly share code, notes, and snippets.

View ejs94's full-sized avatar

Estêvão J. dos Santos ejs94

  • Brasil
View GitHub Profile
@ejs94
ejs94 / signal_stop.py
Created February 7, 2022 18:41
Using signals to terminate a killable thread.
import time
import threading
import signal
class Job(threading.Thread):
def __init__(self):
super().__init__()
'''
The shutdown_flag is a threading.Event object that
indicates whether the thread should be terminated.
@ejs94
ejs94 / _generate_m3u.py
Created January 12, 2025 00:05
I created a script to automate the creation of m3u inside the .hidden folder for psx games
import os
import glob
from collections import defaultdict
def delete_m3u_files():
"""
Deletes all .m3u files in the current directory, including the 'output' folder and any subfolders.
"""
m3u_files = glob.glob("**/*.m3u", recursive=True) # Find .m3u files in all subdirectories
for m3u_file in m3u_files: