This repository has no description
0

Configure Feed

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

correction and ex1 doing

Jay Krishnan (Jul 15, 2026, 2:10 PM +0200) 4e04b915 14c9515b

+44 -19
+6 -4
ex0/construct.py
··· 7 7 # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 8 # +#+#+#+#+#+ +#+ # 9 9 # Created: 2026/07/06 11:12:18 by jkrishna #+# #+# # 10 - # Updated: 2026/07/06 16:07:09 by jkrishna ### ########.fr # 10 + # Updated: 2026/07/15 13:29:24 by jkrishna ### ########.fr # 11 11 # # 12 12 # ########################################################################### # 13 13 14 14 import sys 15 15 import os 16 + import site 16 17 17 18 if __name__ == "__main__": 18 19 if sys.prefix != sys.base_prefix: ··· 24 25 print("SUCCESS: You're in an isolated environment!") 25 26 print("Safe to install packages without affecting") 26 27 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") 28 + # py_v = f"python{sys.version_info.major}.{sys.version_info.minor}" 29 + # package_path = os.path.join(sys.prefix, "lib", py_v, "site-packages") 29 30 print("Package installation path:") 30 - print(f"{package_path}") 31 + # print(f"{package_path}") 32 + print(site.getsitepackages()[0]) 31 33 else: 32 34 print("\nMATRIX STATUS: You're still plugged in\n") 33 35 print(f"Current Python: {sys.executable}")
+20 -15
ex1/loading.py
··· 7 7 # By: jkrishna <jkrishna@student.42.fr> +#+ +:+ +#+ # 8 8 # +#+#+#+#+#+ +#+ # 9 9 # Created: 2026/07/07 15:22:12 by jkrishna #+# #+# # 10 - # Updated: 2026/07/07 16:08:50 by jkrishna ### ########.fr # 10 + # Updated: 2026/07/15 14:09:44 by jkrishna ### ########.fr # 11 11 # # 12 12 # ########################################################################### # 13 13 ··· 20 20 21 21 22 22 def check_dependencies(): 23 - if check_package("pandas"): 24 - import pandas 25 - print(f"[OK] pandas ({pandas.__version__}) - Data manipulation ready") 23 + packages = { 24 + "pandas": "Data manipulation", 25 + "numpy": "Numerical computation", 26 + "requests": "Network access", 27 + "matplotlib": "Visualization", 28 + } 29 + status = {} 30 + for name in packages.keys(): 31 + if check_package(name): 32 + module = importlib.import_module(name) 33 + version = module.__version__ 34 + status[name] = "OK" 35 + else: 36 + status[name] = "KO" 26 37 27 - if check_package("numpy"): 28 - import numpy 29 - print(f"[OK] numpy ({numpy.__version__}) - Numerical computation ready") 30 - 31 - if check_package("requests"): 32 - import requests 33 - print(f"[OK] requests ({requests.__version__}) - Network access ready") 34 - 35 - if check_package("matplotlib"): 36 - import matplotlib 37 - print(f"[OK] matplotlib ({matplotlib.__version__}) - Visualization ready") 38 + for name in packages.keys(): 39 + if status[name] == "OK": 40 + print(f"[OK] {name} {version} {packages[name]} ready") 41 + else: 42 + print(f"[KO] {name} is not installed") 38 43 39 44 40 45 if __name__ == "__main__":
+18
ex1/pyproject.toml
··· 1 + [project] 2 + name = "myproject" 3 + version = "0.1.0" 4 + description = "" 5 + authors = [ 6 + {name = "Jay Krishnan",email = "jkrishna@student.42heilbronn.de"} 7 + ] 8 + readme = "README.md" 9 + requires-python = ">=3.10" 10 + dependencies = [ 11 + ] 12 + 13 + [tool.poetry] 14 + packages = [{include = "myproject", from = "src"}] 15 + 16 + [build-system] 17 + requires = ["poetry-core>=2.0.0,<3.0.0"] 18 + build-backend = "poetry.core.masonry.api"