Import already existing JL file in Pluto?

This should work if you manually re-execute the cell with the import statement.

If you want to automatically re-run the script, you could do the following:

a. for re-running when a variable changes in the notebook, but the include statement in a block with this variable, e.g.

begin
    x
    include("myscript.jl")
end

b. for re-running if the script itself changes, use Revise:

using Revise
includet("myscript.jl")

Use ingredients instead of include to load a file a second time into the same notebook session:

https://github.com/fonsp/Pluto.jl/issues/115#issuecomment-661722426

1 Like