-1

I have done multiple ways to get source command to run but python does not store those env variables.

        command = shlex.split("env -i bash -c './var/easy-rsa/vars'")
        subprocess.Popen('command', shell=True)

Also tried

        os.system(". /var/easy-rsa/vars")

also tried calling source from a shell script. Do you know of a way around this problem?

Dee
  • 74
  • 6

1 Answers1

0

Split.os.popen(“env ...)

https://janakiev.com/blog/python-shell-commands/ Popen executes the command in a new process, try process.stdout.readline()