How do I run an executable using Lua?

拈花ヽ惹草 提交于 2019-12-28 01:30:01

问题


I have an executable I want to run using Lua ... how do I do this?

Can't seem to find any documentation anywhere about this.


回答1:


You can use Lua's native 'execute' command.

Example:

os.execute("c:\\temp\\program.exe")

Sources: Lua Guide / os.execute




回答2:


If you need the output of the program, use io.popen




回答3:


Use os.execute.



来源:https://stackoverflow.com/questions/2829404/how-do-i-run-an-executable-using-lua

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!