Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
background
#1
Guys,

first things first. HI - I am new here and to python.

How can I do a job in the background while doing a different thing.
Its just a small project for my Raspberry
script simple:

import python-forum-knowledge

def main():
  start_blink()  #  just let a led blink in a while loop

  if fetch_my_mails(): # nomen est omen
    stop_blink()
I thought about subprocess.getstatusoutput, but this one is wating for an output of course.
Some kind of threading inside the script?
Ohhh yeah. the whole thing is runnging under daemon.DaemonContext

So if you could push me in a direction - do it!

Thanks.
K.
Reply
#2
Have yet to use, but I'd be looking into asyncio.
Python docs for async IO
Reply
#3
(Jul-29-2021, 07:33 PM)jefsummers Wrote: Have yet to use, but I'd be looking into asyncio.
Python docs for async IO

thanks man. messed around a bit with asyncIO, but it was a way too much
found module "threading", that did the job easy.

thanks anyway for the answer.
cheers K.
Reply


Forum Jump:

User Panel Messages

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