微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何劫持 swi CLI 并对其进行自定义?

如何解决如何劫持 swi CLI 并对其进行自定义?

我想重用 swi CLI 界面 .. 而不是

1. wait for user to type a line ... plain string
 1.1 if it starts with ! execute it as normal prolog,goto 1  
2. split by space and make a List of atoms or "word-strings"
 - may be cleanup punctuation
3. Pass the List to a clause for processing
4. goto 1

我想保留历史记录功能

附注> 我得到了一个使用 get0() 的解决方案,但它看起来很复杂,而且没有历史记录。

在python中我使用:https://python-prompt-toolkit.readthedocs.io/en/stable/index.html 它具有更多功能,但对于初学者来说,至少保留历史记录和访问权限是可以的。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。