0

Not sure what I am missing here, here is my terminal command: enter image description here

Versus using python script & subprocesses:

  • Python script lies in C:/Users/andre/PycharmProjects/3d_Audio/main.py

I called:

subprocess.call('cd sox-14-4-2', shell=True)
subprocess.call("sox stay.wav new3.wav trim 0 40", shell=True)

I thought I was in main.py so I had to cd .. first, but I subprocess.call("cd sox-14-4-2", shell=True) returns no error which means everything up until then should be fine

The error that is returned with subprocess is: sox is not recognized as an internal or external command

Acy
  • 589
  • 2
  • 9
  • 25
  • Each `subprocess` instance *is a different process*. They thus have different directories, and running `cd` in one doesn't change the directory the other one is in. – Charles Duffy Mar 16 '19 at 02:27
  • That's just like how on a UNIX system if you run `bash -c 'cd foo'`, the shell that starts changes to the new directory... *and then exits*, leaving your original program back in its previous directory. – Charles Duffy Mar 16 '19 at 02:28
  • Sorry, I looked up the first duplicate before and didn't read thoroughly. – Acy Mar 16 '19 at 02:39
  • Btw, should I delete or close a question like this? @CharlesDuffy. And if it is better to close, could you do it for me? I think I am not able to close my own questions. – Acy Mar 16 '19 at 02:40
  • It's already closed, but the question of whether to delete it depends on whether it's asked in a substantially similar way to the other instances. If you use new/different keywords here so someone who's searching might not find the duplicates would find this one, go ahead and leave it in the knowledge base; if you think anyone who was making a good-faith effort to search would find an existing instance, then go ahead and delete. – Charles Duffy Mar 16 '19 at 03:53
  • There's an automated process that'll sometimes delete closed questions that don't have any upvoted answers (and also weren't upvoted themselves), so not going out of your way to delete doesn't guarantee it'll stick around -- but people *can* upvote a duplicate question (and should, if it helps them find a canonical instance they wouldn't have identified otherwise), so they *can* stick around & be useful to others. – Charles Duffy Mar 16 '19 at 03:54

0 Answers0