如何在Lua程序中清除控制台 [英] How do I clear the console in a Lua Program

查看:214
本文介绍了如何在Lua程序中清除控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用控制台创建我的第一个Lua程序,我需要找出如何删除控制台中的所有文本,而不仅仅添加一吨\ n。

p>在Windows上:

  os.execute(cls)
pre>

在Unix上:

  os.execute )


I'm making my first Lua program with the console, and I need to find out how to remove all the text in the console without just appending a ton of \n's.

解决方案

You can use os.execute().

On Windows:

os.execute("cls")

On Unix:

os.execute("clear")

这篇关于如何在Lua程序中清除控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆