用于 Clojure 的 Python StringIO

标签 python clojure stringio

有没有等同于 Python 的 StingIO 的东西?对于 Clojure?

我正在尝试编写类似于 Sweave 的报告生成/读写编程系统和 Pweave对于 Clojure。我目前正在使用一个临时文件,但我更喜欢使用类似于 StringIO 的文件。

最佳答案

with-out-str 非常方便。

(let [foo (with-out-str (println "Hello world!"))] 
   foo)

更多文档 here

关于用于 Clojure 的 Python StringIO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3863921/

相关文章:

clojure - 在clojure中构建sitemap.xml?

docker - Nginx没有Docker连接到Docker容器(clojure)

python - 如何修复 "ImportError: cannot import name ' StringIO'"

python - 没有名为 StringIO 的模块

python - StringIO 无法识别图像文件错误

python - 为什么 setuptools 不创建我的入口点?

python - 正则表达式查找带有下划线和可选扩展名的文件

java - 如何从任何地方启动 Clojure REPL?

python - Pandas 无法正确读取 csv

python - Pickle 和 Unpickle dict w/list 作为值