-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutar.bat
More file actions
59 lines (50 loc) · 2.46 KB
/
Copy pathexecutar.bat
File metadata and controls
59 lines (50 loc) · 2.46 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
@echo off
chcp 65001 >nul
title Calculadora Crypto DNG
echo.
echo ╔══════════════════════════════════════════════════════════╗
echo ║ CALCULADORA CRYPTO DNG ║
echo ║ Valoració automàtica · FIFO · IRPF 2025 ║
echo ╚══════════════════════════════════════════════════════════╝
echo.
:: ── Comprovar Python ─────────────────────────────────────────────────────────
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo [!] Python no trobat.
echo Executa primer: instalar.bat
echo.
pause
exit /b 1
)
:: ── Comprovar Streamlit ───────────────────────────────────────────────────────
python -c "import streamlit" >nul 2>&1
if %errorlevel% neq 0 (
echo [!] Dependències no trobades.
echo Executa primer: instalar.bat
echo.
pause
exit /b 1
)
:: ── Anar al directori de l'aplicació ────────────────────────────────────────
cd /d "%~dp0"
:: ── Comprovar que existeix Tributos.py ───────────────────────────────────────
if not exist "Tributos.py" (
echo [ERROR] No s'ha trobat Tributos.py
echo Assegura't que executar.bat està a la mateixa carpeta que Tributos.py
echo.
pause
exit /b 1
)
:: ── Llançar l'aplicació ──────────────────────────────────────────────────────
echo [*] Iniciant Calculadora Crypto DNG...
echo [*] Obre el navegador a: http://localhost:8501
echo.
echo Per tancar l'aplicació, tanca aquesta finestra.
echo.
:: Obrir el navegador automàticament després de 3 segons
start "" cmd /c "timeout /t 3 /nobreak >nul && start http://localhost:8501"
:: Llançar Streamlit
python -m streamlit run Tributos.py --server.headless true --browser.gatherUsageStats false
echo.
echo [*] Aplicació tancada.
pause