Subprocess to use external program

Hi everyone,

I use a finite element software called ZSoil (for ground engineering). ZSoil files are .inp extension and contain all the information to run the calculus in the software. I just wrote a python code that modifies some values in the .inp file in order to run them in ZSoil for parametric analysis. The output of my code are 4 .inp files for the moment.

I would like to be able to launch ZSoil from my code, open the 4 .inp files in ZSoil and run the calculus.

I managed to open ZSoil from my code using :

import subprocess
subprocess.run(‘C:\Program Files\ZSoil\ZSoil 2023 v23.04\Z_Soil.exe’)

In ZSoil GUI, I need to click on ‘File’, then ‘Open’, then select the .inp I want, and the click on ‘Run’.

Is there a way to to all of these ‘clicks’ from my python code ?

Thanks for your help.

Subprocess with zsoil would need a non-gui mode that took input from stding or a configuation file.

pyautogui automates the desktop screen. Never used it.
This pypi search list some associated packages.

Selenium automates web browsers, which is not what you want.

Hi Terry,

I am going to give a shot to pyautogui.

Thanks for your answer.

https://www.zsoil.com/zsoil_manual/DP-Man.pdf#subsection.DP_AnalBatProc

Maybe look into the format of the .bat files, see if there’s any way you could write one of those and then run that as a subprocess?

dat url tho