Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5962

Sourcing .sh file from Ubuntu from python script window

$
0
0

I am writing python script in windows, and in the script i need to run some openfoam commands from Ubuntu therefore i need to source ~/.bashrc to make the commands recognized.I did manage to include source /opt/OpenFOAM/OpenFOAM-v2406/etc/bashrc and i manage to run the foam commands from python script in windows, but i have many other environment needed to be sourced.Therefore I need to source the ~/.bashrc itself.I tried many way but all of them failed.I even copied the necessary commands from ~/.bashrc to anoth temp.sh because in ~/.bashrc it block any recall from external environment to source the bashrc file.This step is important and all the script depends on it to make my python script run any commands from Ubuntu smoothly.Thanks in advance.

i used this import(os) and subprocess


Viewing all articles
Browse latest Browse all 5962

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>