Python Forum
autostart python scripts in background (Windows10)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
autostart python scripts in background (Windows10)
#5
(Sep-30-2019, 11:18 PM)snippsat Wrote: Do not use os.system(),subprocess has replaced it in safer way a long time ago.

Can force silent always using subprocess.
import subprocess

si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
#si.wShowWindow = subprocess.SW_HIDE # default
subprocess.run(['python', 'start_notepad.py'], startupinfo=si)
It's working, Thank You.
If I can ask, how can I run 5 scripts with this module(subprocess)?
Can I use subrocess without output return from subprocess?
All my python scripts works in infinity loops.
Reply


Messages In This Thread
RE: autostart python scripts in background (Windows10) - by john36 - Oct-01-2019, 01:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Autostart to run a GUI program at startup. Rpi Edward_ 1 734 Oct-28-2023, 03:19 PM
Last Post: SpongeB0B
  Trying to us python.exe from our network to run scripts cubangt 3 1,050 Aug-17-2023, 07:53 PM
Last Post: deanhystad
  Help with autostart homac 1 1,801 May-22-2021, 07:20 AM
Last Post: Gribouillis
  Running python scripts from github etc pacmyc 7 3,963 Mar-03-2021, 10:26 PM
Last Post: pacmyc
  Reading SQL scripts from excel file and run it using python saravanatn 2 2,808 Aug-23-2020, 04:49 PM
Last Post: saravanatn
  No Scripts File present after python installation ag2207 5 5,226 Jul-30-2020, 11:11 AM
Last Post: buran
  win32 API: Launch Application to RDP session from background process python script rangeshgupta 0 2,283 May-28-2020, 09:41 PM
Last Post: rangeshgupta
  How to merge my two python scripts in one ? HK2432 0 2,253 Jan-31-2020, 10:16 PM
Last Post: HK2432
  How can I Open and close .py file from python scripts SayHiii 9 6,156 Dec-17-2019, 06:10 AM
Last Post: Malt
  How to background another process in Python? Kalet 2 2,617 Oct-21-2019, 05:17 AM
Last Post: newbieAuggie2019

Forum Jump:

User Panel Messages

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