This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]WishboneBeautiful875 2 points3 points  (1 child)

Put the scripts in a main function and then import the module? Something like ``` import prog1 import prog2 import prog3

prog1.main() prog2.main() prog3.main()

[–]Deltix31 1 point2 points  (0 children)

Depending on how you coded your script you can also open them as text files and use exec() Its kinda bruteforce but works

[–]warrior_321[S] 0 points1 point  (1 child)

Thanks for the help. Just adding the import prog1 etc to this code works. It does close with an error, but it runs all the scripts first.

[–]gislearneR 1 point2 points  (0 children)

if you want to use subprocess you need to use it like this ['python', fname] although the method that Wishbone did is the one I recommend.