These are chat archives for evhub/coconut

Sep 2017
Jason O.
Sep 16 2017 06:02
Is there a way to import a coconut module from Jupyter notebook without compiling the module to .py first? I hate having to have two files (coco & py) for each module.
Sep 16 2017 17:42
Does anyone know how to setup syntax highlighting in visual studio code?
Evan Hubinger
Sep 16 2017 22:44

@puruzio Currently, not really, you have to compile it beforehand via some means. Ideally, #320 will solve this issue, though in the meantime you could do something like

from coconut.convenience import cmd
cmd([<path to module>])
import <module name>

to trigger the file to be compiled before you try to import it.

@LeviZell I don't know of a dedicated Coconut syntax highlighting package for VS code, though what you can do is just tell VS code to treat it like Python. To do that, open a .coco file, click on Plain Text at the bottom, select Configure File Association for '.coco'..., and then choose Python.