Vlad's Roam Garden

Powered by 🌱Roam Garden

Kotlin Jupyter

This is an "Orphan" page. Its core content has not been shared: what you see below is a loose collection of pages and page snippets that mention this page, as well as snippets of this page that were quoted elsewhere.

  import java.util.concurrent.TimeUnit
  import java.io.File

operator fun String.invoke(workingDir: File = File(".")): String {
    val parts = this.split("\\s".toRegex())
    val proc = ProcessBuilder(*parts.toTypedArray())

    proc.waitFor(60, TimeUnit.MINUTES)
    return proc.inputStream.bufferedReader().readText()

val String.e get()= invoke()

// example