0

I have this piece of bash script code I need executed via Python

asdf=$(function --varname var)

What would be the best way to go about it?

I have used subprocess.run for basic function calls, but have no idea how to parse the line for variable assignments

laserfart
  • 11
  • 3
  • Are you trying to have python take command line arguments [like this](https://stackoverflow.com/questions/1009860/how-to-read-process-command-line-arguments)? – Will May 06 '20 at 17:47
  • You can execute it, but the variable will exist in the subshell, not in Python and certainly not the shell from which you run Python. – chepner May 06 '20 at 17:47

0 Answers0