loading-print 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: loading_print
3
+ Version: 0.0.0
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: loading_print
3
+ Version: 0.0.0
@@ -0,0 +1,6 @@
1
+ loading_print.py
2
+ pyproject.toml
3
+ loading_print.egg-info/PKG-INFO
4
+ loading_print.egg-info/SOURCES.txt
5
+ loading_print.egg-info/dependency_links.txt
6
+ loading_print.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ loading_print
@@ -0,0 +1,22 @@
1
+ import sys
2
+ import time
3
+
4
+ def loading_print(text, duration_seconds=3):
5
+ """
6
+ Displays a rotating typewriter-style spinner with custom text.
7
+ Loops seamlessly directly on the terminal line.
8
+ """
9
+ animation = ["\\", "|", "/", "-"]
10
+ end_time = time.time() + duration_seconds
11
+ idx = 0
12
+
13
+ while time.time() < end_time:
14
+ sys.stdout.write(f"\r{text} {animation[idx]}")
15
+ sys.stdout.flush()
16
+ idx = (idx + 1) % len(animation)
17
+ time.sleep(0.5)
18
+
19
+ # Clear trailing characters cleanly
20
+ clear_length = len(text) + 5
21
+ sys.stdout.write("\r" + " " * clear_length + "\r")
22
+ sys.stdout.flush()
File without changes
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+