Show python script on perspective in VSC kind of format

I have a piece of python script, I want to be able to read from this script and display the content on perspective in it's coding format.

is it possible?

Can you share the script and highlight the data you are wanting to show?

The markdown component will display text placed between triple backtick blocks as code (monospace font), but no syntax highlighting.

I want to be able to display any python script. It will be even better if I can also edit the script as well.

  1. open a python script.
  2. copy the content.
  3. paste it to a either a string or dataset tag.
  4. use this tag content to display on perspective view in a python coding format.

or from perspective, embedded with VSC console for direct display or edit.

These are the ways I can think of, not sure either way can work.

thanks, I will have a try. am I able to edit and save the script as well?

Nope.

just had quick look at the markdown component.
Correct me if I am wrong.
here's the procedure I need to do:

  1. open the python script.
  2. take the content.
  3. apply markdown format, "#", "##", etc
  4. pass the content to the markdown component

I think I need to ask my sweetheart "chatgpt" to automate this procedure.

You might be better off making a module that is a perspective wrapper for one of the open source javascript code editors for this, then you can do the edits and saving as well as syntax highlighting and autocomplete etc.

good idea.

It might be worth looking into the Jupyter Kernel on the exchange.
You mentioned you wanted to edit and save the scripts as well.

2 Likes

champion