0

I'm new to the usage of pycharm and a .bash file. I've got a python script and a .bash file. I'd like to run the python code through the .bash file.

So if the code is like

def func(para):
    print(para)

[this is just an example of a parametrized code] how do I run the script while also answering the parameter through the bash file. Any response is greatly appreciated. (also it does not have to be a .bash file any other shell type is ok too)

Adi Krish
  • 13
  • 2
  • maybe you can pass the values using cmd line args. [How to read/process command line arguments?](https://stackoverflow.com/questions/1009860/how-to-read-process-command-line-arguments) – Yoshikage Kira Jun 16 '21 at 20:58
  • the most common way is to provide an argument via the command line. There's many ways to do this, but `typer` is my current favorite -- https://typer.tiangolo.com/ – Teejay Bruno Jun 16 '21 at 20:59
  • You'd basically create a run configuration, that calls the bash script, that internally calls the Python script. The [initial parameters to the bash script](https://www.jetbrains.com/help/pycharm/run-debug-configuration.html#run-debug-parameters) would be set in the run configuration. – bad_coder Jun 17 '21 at 09:41

0 Answers0