0

Very dumb question but I've always pondered on how to simply turn something like this:

ffmpeg -i input.mp3 output.wav

into a function I can write in a custom .py script like this:

in = input.mp3
out = output.wav

def conv(in, out)
  return ffmpeg(in,out)

(above script makes 0 sense I am aware, but I hope you understand my question)

Is it always dependent on the package itself, or is there a universal way to do this?

khelwood
  • 52,115
  • 13
  • 74
  • 94
yst0
  • 21
  • 3
  • In the standard library, the accepted toolkit for this is [`argparse`](https://docs.python.org/3/library/argparse.html); the linked duplicate has answers that go into it in some detail. – Charles Duffy Dec 19 '21 at 00:22

0 Answers0