▲ | theamk 15 days ago | |||||||||||||
It does not have to be all-at-once. Your bash program takes 10 input args and requires 15 env variables to be set? Don't reach out for that bash ini parser, create a python script which parses configs and invokes the original bash script. Next time you change feature, move it to python. Eventually you'll be mostly python. Something that helps greatly with that is that you can embed bash in python. So initial conversion can be as simple as file rename + 3 lines of code.
this lets you start by trivial .sh -> .py conversion, and then you can change one block at a time. Variables are tricky so do them first; or in the worst case, "declare -p" + "eval" + temporary files will save you. | ||||||||||||||
▲ | quotemstr 15 days ago | parent [-] | |||||||||||||
It's not that simple. How are you passing argv to the bash script? What about how `subprocess.run` changes the error output to include Python exception spam? Plus, in most editors, you lose all the bash syntax highlighting in the bash program chunk. I haven't seen a lot of hybrid programs like this work well. | ||||||||||||||
|