pyc-engine 0.1.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.
- pyc_engine-0.1.0/PKG-INFO +3 -0
- pyc_engine-0.1.0/pyc/__init__.py +25 -0
- pyc_engine-0.1.0/pyc/calculator.py +45 -0
- pyc_engine-0.1.0/pyc/launcher.py +16 -0
- pyc_engine-0.1.0/pyc_engine.egg-info/PKG-INFO +3 -0
- pyc_engine-0.1.0/pyc_engine.egg-info/SOURCES.txt +9 -0
- pyc_engine-0.1.0/pyc_engine.egg-info/dependency_links.txt +1 -0
- pyc_engine-0.1.0/pyc_engine.egg-info/entry_points.txt +2 -0
- pyc_engine-0.1.0/pyc_engine.egg-info/top_level.txt +1 -0
- pyc_engine-0.1.0/setup.cfg +4 -0
- pyc_engine-0.1.0/setup.py +13 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PYC Engine - Dynamic Core Package
|
|
3
|
+
Auto-discovers and loads any module dynamically.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import importlib
|
|
7
|
+
import pkgutil
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.0"
|
|
10
|
+
__author__ = "Sahil"
|
|
11
|
+
|
|
12
|
+
def __getattr__(name: str):
|
|
13
|
+
try:
|
|
14
|
+
return importlib.import_module(f".{name}", package=__name__)
|
|
15
|
+
except ImportError as e:
|
|
16
|
+
raise AttributeError(f"Module '{__name__}' has no attribute/file '{name}'") from e
|
|
17
|
+
|
|
18
|
+
def __dir__():
|
|
19
|
+
submodules = [
|
|
20
|
+
mod_name for _, mod_name, _ in pkgutil.iter_modules(__path__)
|
|
21
|
+
if not mod_name.startswith('_')
|
|
22
|
+
]
|
|
23
|
+
return sorted(list(globals().keys()) + submodules)
|
|
24
|
+
|
|
25
|
+
print("🔥 PYC Engine dynamic core active!")
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import math
|
|
2
|
+
|
|
3
|
+
def main():
|
|
4
|
+
print("==========================================")
|
|
5
|
+
print(" PYC ENGINE CALCULATOR ")
|
|
6
|
+
print("==========================================")
|
|
7
|
+
print("1. Addition (+)")
|
|
8
|
+
print("2. Subtraction (-)")
|
|
9
|
+
print("3. Multiplication (*)")
|
|
10
|
+
print("4. Division (/)")
|
|
11
|
+
print("5. Power (^)")
|
|
12
|
+
print("==========================================")
|
|
13
|
+
|
|
14
|
+
choice = input("Select operation (1-5): ").strip()
|
|
15
|
+
|
|
16
|
+
if choice in ['1', '2', '3', '4', '5']:
|
|
17
|
+
try:
|
|
18
|
+
raw1 = input("First number: ").strip()
|
|
19
|
+
raw2 = input("Second number: ").strip()
|
|
20
|
+
|
|
21
|
+
num1 = int(raw1) if '.' not in raw1 else float(raw1)
|
|
22
|
+
num2 = int(raw2) if '.' not in raw2 else float(raw2)
|
|
23
|
+
|
|
24
|
+
if choice == '1':
|
|
25
|
+
print(f"Result: {num1 + num2}")
|
|
26
|
+
elif choice == '2':
|
|
27
|
+
print(f"Result: {num1 - num2}")
|
|
28
|
+
elif choice == '3':
|
|
29
|
+
print(f"Result: {num1 * num2}")
|
|
30
|
+
elif choice == '4':
|
|
31
|
+
if num2 == 0:
|
|
32
|
+
print("❌ Error: Division by zero!")
|
|
33
|
+
else:
|
|
34
|
+
print(f"Result: {num1 / num2}")
|
|
35
|
+
elif choice == '5':
|
|
36
|
+
print(f"Result: {num1 ** num2}")
|
|
37
|
+
except OverflowError:
|
|
38
|
+
print("❌ Error: Result too large! (Number limit exceeded)")
|
|
39
|
+
except ValueError:
|
|
40
|
+
print("❌ Invalid input! Please enter valid numbers.")
|
|
41
|
+
else:
|
|
42
|
+
print("❌ Invalid choice!")
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
main()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
def main():
|
|
4
|
+
print("🚀 Welcome to PYC Engine!")
|
|
5
|
+
print("Commands:")
|
|
6
|
+
print(" pyc calc -> Open Calculator")
|
|
7
|
+
|
|
8
|
+
if len(sys.argv) > 1 and sys.argv[1] == "calc":
|
|
9
|
+
try:
|
|
10
|
+
from pyc.calculator import main as calc_main
|
|
11
|
+
calc_main()
|
|
12
|
+
except ImportError:
|
|
13
|
+
print("❌ Calculator module not found!")
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyc
|