https://docs.python.org/3.7/library/io.html#text-i-o说 io.Stringio在open()文件对象内部创建。如果我想 从Stringio开始,然后将其刷新到文件对象中 去做?显然我可以打开新的文件对象,然后 将Stringio写入对象,但是有没有更干净的方法?
error[E0599]: no method named `join` found for type `std::vec::Vec<&std::string::String>` in the current scope
--> src/main.rs:11:21
|
11 | println!("{:?}",v3.join(",")); // error
| ^^^^ method not found in `std::vec::Vec<&std::string::String>`
除了
from io import *
buf = StringIO()
buf.write('here is my text in stringio')
buf.flush('filename')
buf.close()
有没有办法做到这一点?