Repository navigation
Expand file tree
/
Copy pathPythonFetch.py
More file actions
110 lines (72 loc) · 2.43 KB
/
Copy pathPythonFetch.py
File metadata and controls
110 lines (72 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import sys
import os
import platform
from importlib.metadata import version, distributions, PackageNotFoundError
print("If you got somekind of error report it to me on Discord: @ak0101101")
print("or on GitHub: https://github.com/akx25/PythonFetch/issues")
print("")
print("Tip: If PythonFetch looks glitchy/weird try fullscreen!")
print("")
print("")
print("")
logo = r"""
.::::::::::.
::``::::::::::.
:::..:::::::::::
````````::::::::
.::::::::::::::::::::::: iiiiiii,
.:::::::::::::::::::::::::: iiiiiiiii.
::::::::::::::::::::::::::: iiiiiiiiii
::::::::::::::::::::::::::: iiiiiiiiii
:::::::::: ,,,,,,,,,,,,,,,,,iiiiiiiiii
:::::::::: iiiiiiiiiiiiiiiiiiiiiiiiiii
`::::::::: iiiiiiiiiiiiiiiiiiiiiiiiii
`:::::: iiiiiiiiiiiiiiiiiiiiiii
iiiiiiii,,,,,,,,
iiiiiiiiiii''iii
`iiiiiiiiii..ii
`iiiiiiiiii`
____ _ _
| _ \ _ _| |_| |__ ___ _ __
| |_) | | | | __| '_ \ / _ \| '_ \
| __/| |_| | |_| | | | (_) | | | |
|_| \__, |\__|_| |_|\___/|_| |_|
|___/
""".strip("\n")
python = platform.python_version()
python_implementation = platform.python_implementation()
python_compiler = platform.python_compiler()
python_executable = sys.executable
try:
pip = version("pip")
except PackageNotFoundError:
pip = "Not installed"
packages = list(distributions())
python_path = os.getcwd()
website = ("python.org", "pypi.org")
info = [
f"Python Version: {python}",
f"Python Implementation: {python_implementation}",
f"Python Compiler: {python_compiler}",
f"Python Executable: {python_executable}",
f"Pip Version: {pip}",
f"Python Packages: {len(packages)}",
f"Python Path: {python_path}",
f"Websites: {website[0]}, {website[1]}",
]
logo_lines = logo.splitlines()
width = max(len(line) for line in logo_lines)
# Move information down by 3 lines
info_offset = 3
for i in range(max(len(logo_lines), len(info) + info_offset)):
# Logo on the left
left = logo_lines[i] if i < len(logo_lines) else ""
# Information on the right, shifted down
info_index = i - info_offset
if 0 <= info_index < len(info):
right = info[info_index]
else:
right = ""
print(
f"\033[97m{left:<{width}}\033[0m {right}"
)