Python Forum
Python continues after CTRL-C
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python continues after CTRL-C
#1
I have a programm running continious controlling the heatpump, fan and air-inlet to control the climate. This programm runs for more than a year now, but twice there the programm stopped running without an error. After a CTRL-C it proceeds. I found the code stopped in the included part of te code.

def read_weergegevens(_orig_sens_buiten, _orig_sens_max_buiten, _orig_sens_min_buiten, _orig_sens_rv_buiten,_orig_sens_i_buiten ):
    try:
       _var_response = requests.get("https://www.weerstationtzandt.nl/realtime.txt")
       _var_weer = csv.reader(_var_response.text.strip().split('\n'),delimiter =' ')
       for _var_weergegevens in _var_weer:
          _sens_buiten = float(_var_weergegevens[2])
          _sens_max_buiten = float(_var_weergegevens[26])
          _sens_min_buiten = float(_var_weergegevens[28])
          _sens_rv_buiten = float(_var_weergegevens[3])
          _sens_press_buiten = float(_var_weergegevens[10]) 
          _sens_i_buiten = _calc_enthalpy(_sens_buiten,_sens_rv_buiten,_sens_press_buiten/10)
          return _sens_buiten, _sens_max_buiten, _sens_min_buiten, _sens_rv_buiten , _sens_i_buiten
    except:
       return _orig_sens_buiten, _orig_sens_max_buiten, _orig_sens_min_buiten, _orig_sens_rv_buiten , _orig_sens_i_buiten
This piece of programm reads a frequently updated online file from nearby weatherstation and collects data from it.

What can cause this behaviour and how can i prevent it.
Reply


Messages In This Thread
Python continues after CTRL-C - by kjbolhuis - Aug-06-2021, 02:09 PM
RE: Python continues after CTRL-C - by deanhystad - Aug-06-2021, 03:21 PM
RE: Python continues after CTRL-C - by kjbolhuis - Aug-06-2021, 04:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  waiting for barcode scanner output, while main program continues to run lightframe109 3 4,717 Sep-03-2020, 02:19 PM
Last Post: DeaD_EyE
  Ctrl-b 09 sunabe_97 0 33,749 Aug-01-2019, 01:19 AM
Last Post: sunabe_97
  Popen - How can I read data before CTRL+C command is issued maffaz 13 10,445 Jun-28-2018, 09:18 AM
Last Post: maffaz
  Help with code Python for "Ctrl+S" karlo_ds 1 3,138 May-28-2018, 11:22 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020