titlepy 1.0.0__py3-none-any.whl
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.
title.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
class Title:
|
|
5
|
+
def __init__(self):
|
|
6
|
+
"""Initialize the Title object."""
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
def init(self):
|
|
10
|
+
"""Initialize the title object (if not already initialized)."""
|
|
11
|
+
if not hasattr(self, "_initialized"):
|
|
12
|
+
# This ensures the Title instance is created only once
|
|
13
|
+
self._initialized = True
|
|
14
|
+
self.set_title("")
|
|
15
|
+
|
|
16
|
+
def set_title(self, title):
|
|
17
|
+
"""Set the console window title for supported platforms."""
|
|
18
|
+
if sys.platform == "win32":
|
|
19
|
+
# For Windows, use the 'title' command
|
|
20
|
+
os.system(f'title {title}')
|
|
21
|
+
elif sys.platform == "darwin" or sys.platform == "linux" or sys.platform == "cygwin":
|
|
22
|
+
# For UNIX-like systems (Linux, macOS), use escape sequences
|
|
23
|
+
print(f"\033]0;{title}\007", end="", flush=True)
|
|
24
|
+
|
|
25
|
+
def __call__(self, title):
|
|
26
|
+
"""Allow the title to be set directly as a callable."""
|
|
27
|
+
self.set_title(title)
|
|
28
|
+
|
|
29
|
+
# Initialize a global instance for use in the module
|
|
30
|
+
title = Title()
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: titlepy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A lightweight Python library for changing Windows console titles
|
|
5
|
+
Home-page: https://github.com/SupremeXD4925/TitleLibrary
|
|
6
|
+
Author: SupremeXD4925
|
|
7
|
+
Author-email: neon321ontg@gmail.com
|
|
8
|
+
Project-URL: Homepage, https://github.com/SupremeXD4925/TitleLibrary
|
|
9
|
+
Project-URL: Repository, https://github.com/SupremeXD4925/TitleLibrary
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
12
|
+
Requires-Python: >=3.6
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: home-page
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
Dynamic: requires-python
|
|
19
|
+
|
|
20
|
+
### HOW TO USE title.py ###
|
|
21
|
+
|
|
22
|
+
1) pip install title (If i put on pip pakage)
|
|
23
|
+
2) Minimum py 3.6
|
|
24
|
+
3) Create a basic file:
|
|
25
|
+
|
|
26
|
+
```py
|
|
27
|
+
|
|
28
|
+
from title import *
|
|
29
|
+
|
|
30
|
+
title.init()
|
|
31
|
+
|
|
32
|
+
title("TITLE HERE")
|
|
33
|
+
input("")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4) Run & Done !
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
title.py,sha256=y8PgCtN7is8nW0KpygDxlse_e7ndFrSm3f-6jmKEBjc,1071
|
|
2
|
+
titlepy-1.0.0.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
titlepy-1.0.0.dist-info/METADATA,sha256=ZGX_DEJz06WMMIegmVJhAJtP6K6orBV4CYqxxE_z8II,912
|
|
4
|
+
titlepy-1.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
5
|
+
titlepy-1.0.0.dist-info/top_level.txt,sha256=HscraGH-6ZJtgopzTdvVM6HrGpg9QqzsVxcg3rK5IBg,6
|
|
6
|
+
titlepy-1.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
title
|