title: Web-viewing a website while specific programs are off
body: <p>project.py</p>
  <pre><code>import psutil
  from time import time, sleep
  a = &quot;Not Safe&quot;
  systemprocesses=[]
  forbiddenprograms=[&quot;Terminal&quot;, &quot;Safari&quot;]
  for proc in psutil.process_iter():
      try:        
          processname=proc.name()
          systemprocesses.append(processname.lower())
      except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
          pass
  def checkIfProcessRunning(forbiddenprograms, systemprocesses):
      mswitch=0
      for i in forbiddenprograms:        
          if i.lower() in systemprocesses:
              mswitch+=1
          else:
              pass
      if mswitch == 0:
          a = &quot;Safe&quot;
          print(a)
      else:
          a = &quot;Not Safe&quot;
          print(a)
  checkIfProcessRunning(forbiddenprograms, systemprocesses)
  </code></pre>
  <p>Project1.py</p>
  <pre><code>from time import time, sleep
  while True:
      execfile(&quot;Project.py&quot;)
      sleep(1 - time() % 1) 
  </code></pre>
  <p>Im working on a project which is showing a website using pywebview  but it wont work if certain apps is working  so i made a continous function checking if specific apps is working but i dont know how to make webview only work when these apps are off
  And if they are off and it showed and they on again it destroys the webview</p>