This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

ex0 attempt

Jay Krishnan (Jul 6, 2026, 4:07 PM +0200) 6b744573

+41
+41
ex0/construct.py
··· 1 + #!/usr/bin/env python3 2 + # ########################################################################### # 3 + # shebang: 1 # 4 + # ::: :::::::: # 5 + # construct.py :+: :+: :+: # 6 + # +:+ +:+ +:+ # 7 + # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 + # +#+#+#+#+#+ +#+ # 9 + # Created: 2026/07/06 11:12:18 by jkrishna #+# #+# # 10 + # Updated: 2026/07/06 16:07:09 by jkrishna ### ########.fr # 11 + # # 12 + # ########################################################################### # 13 + 14 + import sys 15 + import os 16 + 17 + if __name__ == "__main__": 18 + if sys.prefix != sys.base_prefix: 19 + print("MATRIX STATUS: Welcome to the construct") 20 + print(f"Current Python: {sys.executable}") 21 + venv_name = os.path.basename(sys.prefix) 22 + print(f"Virtual Environment: {venv_name}") 23 + print(f"Environment Path: {sys.prefix}") 24 + print("SUCCESS: You're in an isolated environment!") 25 + print("Safe to install packages without affecting") 26 + print("the global system.") 27 + py_v = f"python{sys.version_info.major}.{sys.version_info.minor}" 28 + package_path = os.path.join(sys.prefix, "lib", py_v, "site-packages") 29 + print("Package installation path:") 30 + print(f"{package_path}") 31 + else: 32 + print("\nMATRIX STATUS: You're still plugged in\n") 33 + print(f"Current Python: {sys.executable}") 34 + print("Virtual Environment: None detected\n") 35 + print("WARNING: You're in the global environment!") 36 + print("The machines can see everything you install.\n") 37 + print("To enter the construct, run:") 38 + print("python -m venv matrix_env") 39 + print("source matrix_env/bin/activate # On Unix") 40 + print(r"matrix_env\Scripts\activate # On Windows\n") 41 + print("Then run this program again.")