39 lines
872 B
Python
39 lines
872 B
Python
from __future__ import annotations
|
|
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
SCRIPTS = [
|
|
"port_sutartis_to_rivile.py",
|
|
"port_menesine_kaina_to_rivile.py",
|
|
"port_bukle_to_rivile.py",
|
|
]
|
|
|
|
|
|
def _run_script(script_path: Path, sutarties_kodas: str) -> None:
|
|
result = subprocess.run(
|
|
[sys.executable, str(script_path)],
|
|
input=f"{sutarties_kodas}\n",
|
|
text=True,
|
|
check=True,
|
|
)
|
|
return None
|
|
|
|
|
|
def main() -> None:
|
|
sutarties_kodas = input("Sutarties kodas: ").strip()
|
|
if not sutarties_kodas:
|
|
print("Missing sutarties kodas.")
|
|
return
|
|
|
|
base_dir = Path(__file__).resolve().parent
|
|
for script_name in SCRIPTS:
|
|
script_path = base_dir / script_name
|
|
print(f"Running {script_name}...")
|
|
_run_script(script_path, sutarties_kodas)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|