Hi,
I’m using psutil to see if a program is opened or not, and I whant to use that to hide or see a TAB.
This is how the tab looks like:
dbc.Tab(label="River Bluff",tab_id="graph14",style={
"color":"#f0f8ff",
"background-color": "#000000"
}, active_label_style={"color":"#f0f8ff","background-color": "#000000"},children=[
dbc.Container(
[
html.H1("River Bluff EV"),
html.Hr(),
dbc.Row(
[
dbc.Col(controls017 , md=4),
dbc.Col([
html.H5("EV ($)"),
html.Div(id='contenedor-evr', style={'whiteSpace': 'pre-line'})
],md=8)
],
align="center",
),
html.Hr(),
dbc.Row([
html.P(""),
html.P(""),
html.P(""),
html.P(""),
html.P(""),
html.P(""),
]),
],
fluid=True,
)]),
and this are the conditions for psutil
import psutil
def programa_esta_abierto(nombre_programa):
for proceso in psutil.process_iter(['pid', 'name']):
if nombre_programa.lower() in proceso.info['name'].lower():
return True
return False
# Ejemplo de uso
nombre_programa = 'PokerStars.exe' # Reemplaza con el nombre del programa que deseas verificar
if programa_esta_abierto(nombre_programa):
print(f"El programa {nombre_programa} está abierto.")
else:
print(f"El programa {nombre_programa} no está abierto.")
How can I hade the tab when the program is opened?