How do I redirect Tornado shell ouptput?

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

In Tornado ,we can’t copy data from the terminal. And, as the data increases, the previous data is overwritten.

SoHow do I redirect Tornado shell ouptput

After trying many methods, I found one that worked.

The main code as follows

file = open("file.txt", 0x102, 0777)
cur = ioGlobalStdGet(1)
ioGlobalStdSet(1, file)
/*
// your code
*/
ioGlobalStdSet(1, cur)

In the above code, you first open a file that redirects the output data. Then save the current output path. Then set the path of the standard output to the open file, and restore the original path of the standard output after the execution of the code to be tested.

In addition, it is effective against the 2.1 version of tornado. It is up to readers to verify whether the later version of tornado will work.

Header fileioLib

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: shell

“How do I redirect Tornado shell ouptput?” 的相关文章