- Login to codesandbox and possibly click the left most box and choose the dashboard
- Create a devbox and search for "docker"
- In the
.devcontainerfind theDockerfileand replaceFROM ubuntuwithFROM python:3.12savectrl-Sand let that install - Open a new terminal near the bottom of the page.
- test if python is installed
python3 --versionand test if pip is installedpip3 --version - test if
python -Vandpip -Vwork, note it is a captial V, most other Ubuntu versions checks use a small v - install flask
pip3 install FlaskNote: many installations on Ubuntu useapt install ????but this time we use pip. - Check if flask was installed
flask --version - Copy the 2 files
tz07-flask.pyandtz07-web.pynear the README.md file, or just creatte the files and copy the code - Don't forget to save the files with
ctrl-s - In the terminal activate the flask code which calls the pure python code
python3 tz07-flask.py - copy the generated URL to your
index.htmlpage
#alternate methods:
- Choose the default codesandbox ubuntu docker
Ctrl `to open a new terminaluname -athenapt updatethenaptupgradethenapt updatethenuname -aapt install python3thenpython3 -Vapt install python3-pipthenpip -Vpip install flask- Copy the 2 files
tz07-flask.pyandtz07-web.pynear the README.md file, or just creatte the files and copy the code - Don't forget to save the files with
ctrl-s - In the terminal activate the flask code which calls the pure python code
python3 tz07-flask.py - copy the generated URL to your
index.htmlpage
I just setup nodejs with npm and tried a new file called myNode.js which works in the same way
codesandbox to fork https://codesandbox.io/p/devbox/jovial-dan-pq7mxy
web page https://pq7mxy-5000.csb.app/upload