Replies: 1 comment
-
You could rewrite the database file and execute the project with the following Python script: import pathlib
import subprocess
import sys
from spinedb_api import create_new_spine_database
db_file = pathlib.Path("DB.sqlite")
db_file.unlink()
url = "sqlite:///" + str(db_file.resolve())
create_new_spine_database(url)
project_dir = pathlib.Path(".")
completed_process = subprocess.run([sys.executable, "-m", "spinetoolbox", "--execute-only", str(project_dir)])
if completed_process.returncode != 0:
print("Run failed.") The script expects to be in Toolbox project's root directory, and that the database is in the same directory and is called You can either call the script from another batch file or add whatever loops to the script if needed. Hope this was helpful. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am running many simulations and would like to automate triggering my workflow.
Is there a way to:
with a batch file?
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions