Question

I am converting a program from Batch to Python. Here is how I think I could do translate the Batch

%VBM% sharedfolder add %VMNAME% --name "LogDir" --hostpath %LogDir%

into:

os.execlp(VBM, 'sharedfolder', 'add', VMNAME, '--name', "LogDir",'--hostpath', LogDir)

My questions:

  1. Considering VBM, VMNAME, and LogDir are variables that are declared beforehand within my script, is my translation correct?
  2. Is it ok that I represent the Path string with a variable, e.g. VBM
  3. What could be a better way of doing any of the above?
Was it helpful?

Solution

I decided to go ahead and use subprocess.call() and it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top