IJulia.jl icon indicating copy to clipboard operation
IJulia.jl copied to clipboard

Can we collect all outputs into one?

Open colinfang opened this issue 2 years ago • 0 comments

I am running Notebook with Julia kernel in VS Code with Julia extension

If I print multiple things with time intervals in a cell

println(1)
sleep(1)
println(2)
sleep(1)
println(3)
sleep(1)
println(4)

The output looks like

  "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n"
     ]
    }
   ],

In my VS Code, it renders weirdly

image

Python kernel is still able to generate 1 output instead of multiple in this case and hence gets rendered correctly

  "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2\n",
      "3\n",
      "4\n"
     ]
   }
]

colinfang avatar Jul 30 '22 09:07 colinfang