Python Forum
Using a script to open multiple shells?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a script to open multiple shells?
#5
(Mar-31-2024, 05:39 PM)Gribouillis Wrote:
(Mar-31-2024, 12:53 PM)SuchUmami Wrote: It is on windows. I use it to run scripts. Here is a screenshot of it:
I don't have a Windows machine to try this because I don't use this OS, but you can launch a Cmd window to execute a python script, then switch to interative mode if you want, for example to launch myscript.py you could do approximately
import subprocess
proc = subprocess.Popen(['cmd.exe', '/K', 'python', '-i', 'myscript.py'])
With several similar lines, you could spawn several cmd windows at the same time, each running its own Python script and interpreter.

How would that look if I have these scripts to run:

exec(open(r'C:\Users\Chris\Python\Python Projects\websocket_bot3\websockets\websockets_spot.py').read())
exec(open(r'C:\Users\Chris\Python\Python Projects\websocket_bot3\avg_price\orderbook_data_feed.py').read())
exec(open(r'C:\Users\Chris\Python\Python Projects\websocket_bot3\avg_price\orderbook_processor_macro_flow.py').read())
exec(open(r'C:\Users\Chris\Python\Python Projects\websocket_bot3\websockets_alert.py').read())
Reply


Messages In This Thread
RE: Using a script to open multiple shells? - by SuchUmami - Mar-31-2024, 07:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to generating multiple json files using python script dzgn989 4 413 May-10-2024, 03:09 PM
Last Post: deanhystad
  Power Shells vs Compile and Run programs? RockBlok 2 527 Jan-13-2024, 09:08 PM
Last Post: RockBlok
  How come my python shells are different? SuchUmami 2 706 Jul-10-2023, 08:00 PM
Last Post: snippsat
  Accessing same python script from multiple computers bigrockcrasher 1 1,840 May-25-2022, 08:35 PM
Last Post: Gribouillis
  Open and read multiple text files and match words kozaizsvemira 3 6,939 Jul-07-2021, 11:27 AM
Last Post: Larz60+
Question (solved) open multiple libre office files in libre office lucky67 5 3,623 May-29-2021, 04:54 PM
Last Post: lucky67
  Running script on multiple files Afrodizzyjack 1 2,609 May-14-2021, 10:49 PM
Last Post: Yoriz
  Python: Automated Script to Read Multiple Files in Respective Matrices Robotguy 7 4,453 Jul-03-2020, 01:34 AM
Last Post: bowlofred
  Running multiple script at the same time LoganSulpizio 1 7,275 Dec-07-2019, 04:30 PM
Last Post: Clunk_Head
  Multiple start of script dev1755 2 2,262 Sep-22-2019, 10:44 PM
Last Post: dev1755

Forum Jump:

User Panel Messages

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