为什么我的clojure shell结果不像python中的那样?

exb*_*tel 3 python clojure

在python中工作时,repl我经常需要编辑多行代码.

所以,我用import os那么os.system("notepad npad.py")

在clojure我第一次跑 (use '[clojure.java.shell :only [sh]])

然后我跑了 (sh "notepad" "jpad.clj")

这开始记事本,但不是有用的方式,因为clojure repl现在挂起.换句话说,在我关闭记事本之前,我无法输入代码repl并且我想保持两者都打开.

我知道我可以很容易地打开记事本而不用咒语,所以这没什么大不了的.但是,有没有办法让clojure在没有挂起的情况下启动外部进程?

Art*_*ldt 5

future 是一种让工作在后台运行的便捷方式,以后可以轻松查看该过程.

user> (def notepad-process (future (sh "emacs" "jpad.clj")))
#'user/notepad-process
Run Code Online (Sandbox Code Playgroud)

编辑文件一段时间,如果您想要退出代码,请稍后检查该过程:

user> @notepad-process
{:exit 0, :out "", :err ""} 
Run Code Online (Sandbox Code Playgroud)