diff --git a/__pycache__/test_chargementlogo.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_chargementlogo.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d86cdf7ed8ae115c53013759543d938d3abcd92e Binary files /dev/null and b/__pycache__/test_chargementlogo.cpython-310-pytest-8.3.5.pyc differ diff --git a/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc index 574f08c449b1eaa692997d1b9f2c514422cc3c8e..b7db4f230e6cee64220aa083eded1e5add967254 100644 Binary files a/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc and b/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc differ diff --git a/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc index e33a043a73459068f6c2832c2b52352e981474d7..b4fa344dffe4931e1f8c95f4a81c7dc0ed4dd8bb 100644 Binary files a/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc and b/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc differ diff --git a/output_image.png b/output_image.png new file mode 100644 index 0000000000000000000000000000000000000000..1dbdc6e565ee67601207b8f27bc8203717c1c713 Binary files /dev/null and b/output_image.png differ diff --git a/test_chargementlogo.py b/test_chargementlogo.py new file mode 100644 index 0000000000000000000000000000000000000000..bc9a592a3b3956eb5d85184d356286f3cf7ca3b3 --- /dev/null +++ b/test_chargementlogo.py @@ -0,0 +1,54 @@ +import time +from PIL import Image, ImageEnhance, ImageTk +import tkinter as tk + +def adjust_transparency(image_path, charge_percentage): + # Open the image + image = Image.open(image_path).convert("RGBA") + # Split the image into channels + r, g, b, alpha = image.split() + # Adjust the alpha channel based on charge percentage + alpha = alpha.point(lambda p: p * (charge_percentage / 100)) + # Merge channels back + return Image.merge("RGBA", (r, g, b, alpha)) + +def fake_charging(image_path): + # Create a Tkinter window + root = tk.Tk() + root.title("Charging...") + + # Load the initial image + charge_percentage = 0 + image = adjust_transparency(image_path, charge_percentage) + tk_image = ImageTk.PhotoImage(image) + + # Create a label to display the image + label = tk.Label(root, image=tk_image) + label.pack() + + def update_image(): + nonlocal charge_percentage, tk_image + if charge_percentage < 100: + # Increment charge percentage smoothly + charge_percentage += 1 + # Adjust transparency and update the image + image = adjust_transparency(image_path, charge_percentage) + tk_image = ImageTk.PhotoImage(image) + label.config(image=tk_image) + label.image = tk_image + root.title(f"Charging... {charge_percentage}%") + root.after(50, update_image) # Update every 50ms for smoother transition + else: + root.title("Charging complete!") + + # Start updating the image + update_image() + root.mainloop() + +def main(): + # Use the specified image + image_path = "LogoSymbole_canard.png" + fake_charging(image_path) + +if __name__ == "__main__": + main() diff --git a/test_nouveautestthreding.py b/test_nouveautestthreding.py index 31ab9c990d82748fe441173c443491a04eae997d..5dc0263205cb6953606cec40f909a670fd0180ac 100644 --- a/test_nouveautestthreding.py +++ b/test_nouveautestthreding.py @@ -22,7 +22,7 @@ def single_threaded(): # Multi-threaded execution def multi_threaded(): start_time = time.time() - num_threads = 4 + num_threads = 2 step = 10_000_000 // num_threads threads = [] results = [0] * num_threads diff --git a/test_recup_info.py b/test_recup_info.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..339bbe015c3bd6a11e56da19eff6c821c1b8bb0e 100644 --- a/test_recup_info.py +++ b/test_recup_info.py @@ -0,0 +1,3 @@ +import multiprocessing +print(f"Cœurs physiques : {multiprocessing.cpu_count() // 2}") +print(f"Cœurs logiques : {multiprocessing.cpu_count()}")