-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?

1
  • You're sourcing those files in processes separate to the running python oricess Commented Jan 8, 2020 at 2:57

1 Answer 1

0

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

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.