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
  How to include one script into another? MorningWave 8 304 Mar-21-2024, 10:34 PM
Last Post: MorningWave
  ChromeDriver breaking Python script genericusername12414 1 214 Mar-14-2024, 09:39 AM
Last Post: snippsat
  using PowerShell from Python script for mounting shares tester_V 8 399 Mar-12-2024, 06:26 PM
Last Post: tester_V
  No Internet connection when running a Python script basil_555 8 439 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 335 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Combine console script + GUI (tkinter) dejot 2 360 Feb-27-2024, 04:38 PM
Last Post: deanhystad
  How to receive two passed cmdline parameters and access them inside a Python script? pstein 2 277 Feb-17-2024, 12:29 PM
Last Post: deanhystad
  OBS Script Troubleshooting Jotatochips 0 252 Feb-10-2024, 06:18 PM
Last Post: Jotatochips
  Is possible to run the python command to call python script on linux? cuten222 6 629 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  Triggering a ps1 script in remote windows server via http python request jasveerjassi 1 316 Jan-26-2024, 07:02 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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