2

I am wondering if there is any possibility to execute process from python with chrt 1 priority. It makes my timer much more accurate. Here is my piece of code:

import subprocess
p = subprocess.Popen(["/a.out"])

I am doing this task manually by typing in raspberry pi linux terminal: chrt 1 ./a.out. Is there any possibility to run process with chrt attribute via python?

  • Does this answer your question? [How to do multiple arguments with Python Popen?](https://stackoverflow.com/questions/11284147/how-to-do-multiple-arguments-with-python-popen). I mean calling ```p = subprocess.Popen(["chrt", "1", "./a.out"])``` – Maxim Sagaydachny May 03 '20 at 15:58
  • Alternatively, you could use [sched_setscheduler](http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html) in the program directly, eliminating the need for an extra chrt altogether. – Jörg Faschingbauer May 04 '20 at 06:21
  • @MaximSagaydachny It did. Thanks. – embwannabe94 May 04 '20 at 07:07

0 Answers0