Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
llamando a múltiples funciones de python mientras algunas de ellas aún no están terminadas

Estoy usando anguila para escribir un programa y tengo un problema

digamos que tenemos este código python:

 import eel eel.init('web') run =1 @eel.expose def start(): global run while run: print("loop") @eel.expose def stop(): global run run =0 print("stopped................................") if __name__ == '__main__': eel.start('index.html')

y la parte html y js es así:

 <html> <head> <script type="text/javascript" src="/eel.js"></script> <title>doc</title> </head> <body> <input type="button" onclick="startJs()" value="start"> <input type="button" onclick="stopJs()" value="stop"> <script> function startJs(){ eel.start(); } function stopJs(){ eel.stop() } </script> </body> </html>

así que primero quiero llamar a la función de inicio de python usando javascript y luego detenerlo con la función de parada

pero, cuando presiono iniciar, ¡la función de parada (de python) no funciona en absoluto!

Creo que es porque todavía está procesando la función de inicio, pero ¿puedo cruzarlo dos veces?

¿alguien puede ayudar por favor?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hola soy yo hablando solo :_)

Agregué un eel.sleep(0.001) en el bucle while y la función de parada funcionó :)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!