0

I have tried looking this up, but for some reason I cannot find anything about it. How do I run a script by giving the particular file directory in start()?

This works (when Test is in the same folder as the main script):

self.process.start("python3 Test.py")

This does NOT work:

self.process.start("python3 /my/path/Test.py")
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • Have you tried putting two period in front of "/me" like this: ```self.process.start("python3 ../my/path/Test.py")``` – burntchowmein Jul 08 '20 at 15:10
  • 1
    @burntchowmein Ok, I did that and it works now. Before, I was doing ~/Documents/my/path/Test.py ---- Does the ~ not work? – RamboPenguin Jul 08 '20 at 15:20
  • @RamboPenguin Is the problem "~"? your question does not indicate that – eyllanesc Jul 08 '20 at 15:24
  • @RamboPenguin Great! I am going to copy my answer down below so people in the future will have an easier time finding it immediately. I am not too familiar with ~ but see if this answer helps you understand it better: https://stackoverflow.com/questions/31435921/difference-between-and – burntchowmein Jul 08 '20 at 16:04
  • @eyllanesc sorry, will be more clear in the future. Didn't think ~ was the problem because I've used it before without any issues in subprocess.run() – RamboPenguin Jul 08 '20 at 16:08

1 Answers1

0

Try this:

self.process.start("python3 ../my/path/Test.py") # added two periods before "/m"
burntchowmein
  • 474
  • 1
  • 4
  • 16