Python伪装文件类对象输入输出重定向方法研究  被引量:2

Research on Python Masquerading File Class Object IO Redirection Method

在线阅读下载全文

作  者:亓雪冬 李霞[2] QI Xuedong;LI Xia(Information Construction Department,China University of Petroleum(East China),Qingdao,Shandong 266580,China;College of Information and Control Engineering,China University of Petroleum(East China),Qingdao,Shandong 266580,China)

机构地区:[1]中国石油大学(华东)信息化建设处,山东青岛266580 [2]中国石油大学(华东)信息与控制工程学院,山东青岛266580

出  处:《微型电脑应用》2020年第6期90-92,共3页Microcomputer Applications

摘  要:针对Python程序自动评测过程中被测试程序输入输出流重定向问题进行研究。分析了基于操作系统输入输出重定向方法的缺点与不足,基于Python的动态性提出了Python伪装文件类对象输入输出重定向方法。设计并实现了满足标准输入输出流接口特性的伪装文件对象,在Python程序内部接管输入流和输出流,提高了重定向接口的灵活性,减少磁盘空间占用,严格限制输出流数据尺寸,保障评测过程稳定进行。该方法在实际应用中效果良好。The paper studies problems about the IO stream redirection in the automatic evaluation of python language programs.Thepaper analyzes and points out shortcomings of the OS-based IO redirection method,and proposes an IO redirection method using python masquerading file class object.The paper designsand implement masquerading file class objectwhich meets the characteristics of standard IO stream interfaces.This object takes over IO streams inside a python program,increases flexibility of the redirection interface,reduces disk space usage,limits the output stream data size strictly,ensures the stability of the automatic evaluationprocess.This method works well in practical applications.

关 键 词:PYTHON ONLINE JUDGE 自动测评 输入输出重定向 

分 类 号:TP393[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象