我有一根绳子
a = """
---
title: Just a test
author: Me
date: 2022-01-03
---
# Test Header
Some text.
"""
Run Code Online (Sandbox Code Playgroud)
我想从中创建一个文件foobar.jmd。这样做的最佳方法是什么?
fname = "foobar.jmd"
dirpath = "/tmp"
fpath = joinpath(dirpath, fname)
open(fpath, "w") do file
write(file, a)
end
Run Code Online (Sandbox Code Playgroud)
更多示例,例如此处https://en.wikibooks.org/wiki/Introducing_Julia/Working_with_text_files
| 归档时间: |
|
| 查看次数: |
2094 次 |
| 最近记录: |