Sep-04-2018, 08:43 AM
Hi,
I am trying to generate a shell script inside the python script and then planning to execute it. I know that this is a very naive way. This snippet works. Is there a better way to handle this?Thanks.
I am trying to generate a shell script inside the python script and then planning to execute it. I know that this is a very naive way. This snippet works. Is there a better way to handle this?Thanks.
cmd1 = "git clone repoName" + '\n' cmd2 = "cd repoName" + '\n' cmd3 = "git checkout version" + '\n' fh = open(shell_script, 'w') fh.write(cmd1) fh.write(cmd2) fh.write(cmd3) fh.close()