Script to start SimpleFOCStudio

Hello I have been looking for a while so I am sharing (Google Translate, sorry)

On Gnu/Linux
Save on SimpleFOCStudio.sh


#!/bin/bash
_CONDA_ROOT="/home/$USER/anaconda3"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
conda activate "simplefoc"
cd "/home/$USER/SimpleFOCStudio"
python3.8 simpleFOCStudio.py
exit 0

On Windows 10
Save on file ==> SimpleFOCStudio.bat

call C:\ProgramData\Anaconda3\Scripts\activate.bat
call conda activate simplefoc
cd C:\Users\YOURUSER\Desktop\SimpleFOCStudio
call python simpleFOCStudio.py
pause
1 Like

Thanks @multisystem - I’ve made a few tweaks for my system (I use miniconda, have installed in a different dir and use a different python version)
Once it’s working - you could copy it to somewhere on your path (e.g. /usr/local/bin)

#!/bin/bash
_CONDA_ROOT=~/miniconda3
_INSTALL_ROOT=~/tools/SimpleFOCStudio
source "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
conda activate simplefoc
python "$_INSTALL_ROOT/simpleFOCStudio.py"
exit 0

You’d have thought this would be simpler but conda is a strange beast.