@ -455,7 +455,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 111 ,
"execution_count": 113 ,
"id": "e42286bc-085c-45dc-b101-234308e58269",
"id": "e42286bc-085c-45dc-b101-234308e58269",
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
@ -477,7 +477,7 @@
"def run_cmd(command_to_run):\n",
"def run_cmd(command_to_run):\n",
" try:\n",
" try:\n",
" run_result = subprocess.run(command_to_run, check=True, text=True, capture_output=True)\n",
" run_result = subprocess.run(command_to_run, check=True, text=True, capture_output=True)\n",
" return run_result.stdout\n",
" return run_result.stdout if run_result.stdout else \"SUCCESS\" \n",
" except:\n",
" except:\n",
" return \"\"\n",
" return \"\"\n",
"\n",
"\n",
@ -513,7 +513,7 @@
" elif my_platform == \"Linux\":\n",
" elif my_platform == \"Linux\":\n",
" if os.path.isfile(\"./simple\"):\n",
" if os.path.isfile(\"./simple\"):\n",
" os.remove(\"./simple\")\n",
" os.remove(\"./simple\")\n",
" compile_cmd = [\"g++\", f\"{filename_base}.cpp\", \"-o\", f\"{filename_base}\" ]\n",
" compile_cmd = [\"g++\", \"simple.cpp\", \"-o\", \"simple\" ]\n",
" if run_cmd(compile_cmd):\n",
" if run_cmd(compile_cmd):\n",
" if run_cmd([\"./simple\"]) == \"Hello\":\n",
" if run_cmd([\"./simple\"]) == \"Hello\":\n",
" my_compiler = [\"Linux\", \"GCC\", [\"g++\", f\"{filename_base}.cpp\", \"-o\", f\"{filename_base}\" ]]\n",
" my_compiler = [\"Linux\", \"GCC\", [\"g++\", f\"{filename_base}.cpp\", \"-o\", f\"{filename_base}\" ]]\n",