|
[Sponsors] |
July 5, 2022, 06:18 |
Python execute Allrun in windows sub linux
|
#1 |
Member
Jigs
Join Date: Sep 2017
Location: Pune
Posts: 42
Rep Power: 9 |
Hi Team,
After looking for possible solutions online, I have come here for little help. I am using windows sub linux, installed openfoam and trying to automate tedious task. I am trying to execute Allrun command from python. Is there any way we can do that? Using below command: Code:
from subprocess import call basedirectory = 'destination folder' call(['bash', 'Allrun'], cwd=basedirectory) Code:
Allrun: line 3: /bin/tools/RunFunctions: No such file or directory Allrun: line 7: runApplication: command not found Allrun: line 8: runApplication: command not found Allrun: line 9: runApplication: command not found Allrun: line 10: runApplication: command not found Allrun: line 11: runApplication: command not found |
|
July 6, 2022, 10:45 |
|
#2 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 143
Rep Power: 20 |
Here is a minimal working example. Note, that you need to source OpenFOAM, i. e. all environmentvariables have to be set properly, before executing the script below.
Code:
#! /usr/bin/env python import subprocess command='./Allrun' p = subprocess.run(command,shell=True) |
|
July 7, 2022, 06:39 |
|
#3 | |
Member
Jigs
Join Date: Sep 2017
Location: Pune
Posts: 42
Rep Power: 9 |
Quote:
|
||
Tags |
automate, python |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recent thoughts- Fluent on Linux vs Windows | jpo | FLUENT | 1 | May 17, 2012 07:20 |
[Other] How to excecute allrun in windows openfoam | padmanathan | OpenFOAM Meshing & Mesh Conversion | 2 | November 28, 2011 17:27 |
removing of linux and keeping windows | Anja | Main CFD Forum | 4 | August 23, 2006 08:01 |
Windows EXE file and Linux | MING | Main CFD Forum | 4 | October 22, 2004 06:31 |
read unformatted file in windows and linux | autofly | Main CFD Forum | 7 | August 11, 2004 04:24 |