Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions docs/installing_octave.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@
"outputs": [],
"source": [
"# Prepare environment variables\n",
"os.environ[\"OCTAVE_EXECUTABLE\"] = os.path.join(os.environ[\"WINPYDIRBASE\"], \"t\", octave_version+\"-w64\", \"mingw64\", \"bin\", \"octave-cli.exe\")\n",
"os.environ[\"OCTAVE_EXECUTABLE\"] = os.path.join(os.environ[\"WINPYDIRBASE\"], \"t\", octave_version+\"-w64\", \"mingw64\", \"bin\", \"octave.bat\")\n",
"os.environ[\"OCTAVE_CLI_OPTIONS\"] = '--no-gui'\n",
"os.environ[\"OCTAVE_KERNEL_JSON\"] = os.path.join(os.environ[\"WINPYDIR\"], \"share\", \"jupyter\", \"kernels\", \"octave\", \"kernel.json\")"
]
},
Expand All @@ -131,7 +132,8 @@
"rem handle {0} if included\n",
"rem ******************\n",
"if not exist \"%WINPYDIRBASE%\\t\\{0}-w64\" goto {0}_bad\n",
"set OCTAVE_EXECUTABLE=%WINPYDIRBASE%\\t\\{0}-w64\\mingw64\\bin\\octave-cli.exe\n",
"set OCTAVE_EXECUTABLE=%WINPYDIRBASE%\\t\\{0}-w64\\mingw64\\bin\\octave.bat\n",
"set OCTAVE_CLI_OPTIONS=--no-gui\n",
"set OCTAVE_KERNEL_JSON=%WINPYDIR%\\share\\jupyter\\kernels\\octave\\kernel.json\n",
":{0}_bad\n",
"\"\"\".format(octave_version)\n",
Expand All @@ -140,11 +142,28 @@
"with open(os.path.join(os.environ[\"WINPYDIRBASE\"],\"scripts\",\"env.bat\"), 'a') as file :\n",
" file.write(inp_str)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# change octave.bat to use `octave-gui.exe --no-gui` instead of `octave-cli`\n",
"octave_bat_path = os.path.join(os.environ[\"WINPYDIRBASE\"], \"t\", octave_version+\"-w64\", \"mingw64\", \"bin\", \"octave.bat\")\n",
"with io.open(octave_bat_path, 'r') as file:\n",
" content = file.read()\n",
"\n",
"content.replace(\"octave-cli.exe %*\", \"call octave-gui.exe --no-gui %*\")\n",
"\n",
"with io.open(octave_bat_path, 'w') as file:\n",
" file.write(content)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -158,7 +177,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
"version": "3.9.8"
}
},
"nbformat": 4,
Expand Down