python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Ending a loop on time expiration
I have a long computation in a loop, which I need to end prematurely if allowed compute time expires (and return a partially computed result). I plan to do it via SIGALARM handler and a timer:
// Alar...
user2052436
Votes: 0
Answers: 2
Why does subprocess stdout only produce one line when the process is killed with os.kill()?
I have a piece of code that opens a subprocess and writes the output to a file:
logPath = '/path/to/some/directory/'
log = open(logPath + 'log', 'a')
guipid = subprocess.Popen(SomeGuiApplication, ...

Daniel Klisiewicz
Votes: 0
Answers: 1
Hitting Task exception was never retrieved while executing a signal handler using asyncio in Python3.6
I have a Python3.6 application that uses bleak lib for BLE communication. I need to handle Ctrl-C signal by disconnecting BLE and do some clean up in case user decides to terminate the script while th...

prime_mover
Votes: 0
Answers: 0
python signal.scipy.welch for complex input returns frequency indices which are not ordered negative to positive
My aim is to plot the PSD of a complex vector x.
I calculated the spectrum estimation using scipy.welch (version 1.4.1):
f, Px = scipy.signal.welch(**x**, return_onesided=False, detrend=False)
and th...

Idnv
Votes: 0
Answers: 1