如何将io.stringio升级为w文件

https://docs.python.org/3.7/library/io.html#text-i-oio.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()

有没有办法做到这一点?

wgzh107109 回答:如何将io.stringio升级为w文件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3103177.html

大家都在问