Python Forum
Run one Python Script from Another Script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run one Python Script from Another Script
#1
Hello, if I do import "scriptname" I can load one python script from another. I am trying to make a main script that launches 5 seperate python programs at the same time.. but in different shells.. or windows.. Any way I can do that? Any way to do an import "scriptname" (into its own shell/window?)
Reply
#2
Yes, there are several ways. It depends on what your scripts are doing. You could always look into threading, sub-processes, multiprocessing, etc.

But, if you want an easy way to just run multiple scripts from one main script take a look at the tricks used here:
https://stackoverflow.com/questions/4910...er-another
https://stackoverflow.com/questions/5386...ncurrently
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Running script from remote to server invisiblemind 4 578 Mar-28-2025, 07:57 AM
Last Post: buran
  Insert command line in script lif 4 867 Mar-24-2025, 10:30 PM
Last Post: lif
  modifying a script mackconsult 1 520 Mar-17-2025, 04:13 PM
Last Post: snippsat
  help with a script that adds docstrings and type hints to other scripts rickbunk 2 1,196 Feb-24-2025, 05:12 AM
Last Post: from1991
  Detect if another copy of a script is running from within the script gw1500se 4 1,047 Jan-31-2025, 11:30 PM
Last Post: Skaperen
  pass arguments from bat file to pyhon script from application absolut 2 905 Jan-13-2025, 11:05 AM
Last Post: DeaD_EyE
  Best way to feed python script of a file absolut 6 1,044 Jan-11-2025, 07:03 AM
Last Post: Gribouillis
  How to make it so whatever I input into a script gets outputted on a different file spermatozwario 4 1,088 Nov-24-2024, 12:58 PM
Last Post: deanhystad
  [SOLVED] [Linux] Run Python script through cron? Winfried 2 1,178 Oct-19-2024, 06:29 PM
Last Post: Winfried
  Help for Tiktok Script Jasson187512 0 723 Oct-09-2024, 08:42 AM
Last Post: Jasson187512

Forum Jump:

User Panel Messages

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