此C++代码将在终端上显示“加载文本”,主程序呈现图像。我知道这是因为std::clog。我一直在搜索,我认为subprocess模块可以帮助我在Python上复制它,但我完全不知道如何使用它。如何用Python编写这个代码?在
std::stringstream progress_stream;
progress_stream << "\r progress .........................: "
<< std::fixed << std::setw( 6 )
<< std::setprecision( 2 )
<< 100.0 * y / ( buffer_.v_resolution_ - 1 )
<< "%";
std::clog << progress_stream.str();
最接近的等价物是
print(a_string_variable, file=sys.stderr)
。在相关问题 更多 >
编程相关推荐