%%writefile app.py is not working on vscode. how do i make an app.py file?

Question:

My mentor using google colab made an app.py file using %%writefile app.py called it a ‘magic’ command. However, when I tried implementing the same on my vscode file, it didn’t work. My mentor used google colab while I use vscode. How do I execute a similar app.py in my vscode environment?

My mentor’s code

My failed execution

(The main ML model is in a different joblib dump, thus it cannot be recreated in an independent system. The image provided aptly represents the problem being encountered. Considering these reasons, code for the same has not been provided here.)

Asked By: Marka Ragnos

||

Answers:

enter image description here

As is shown in your teacher’s picture, this is .ipynb file which can be run after install "jupyter" extension on vscode. %%writefile app.py is the syntax in jupyter notebook. You can use it to creat files.

So, install the extension and follow your teacher’s example. Vscode can do this.

Answered By: MingJie-MSFT
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.