My Common Lisp program writes an HTML file. Then I want to run this file in the default browser.
Is there a way to do this in Common Lisp? Also, is there an OS-independent way to do this?
It depends on the implementation of Common Lisp and, possibly, on the platform on which it works (Windows, Mac, Linux, ...).
LispWorks provides the SYS: OPEN URL function. See http://www.lispworks.com/documentation/lw60/LW/html/lw-1369.htm#pgfId-1219832
(sys:open-url "http://www.foo.com/")
Of course, you can also use the file url.
. , , , , !
, , .
This project is the answer of https://github.com/eudoxia0/trivial-open-browser .
TLDR
You can use uiop:run-programfor this. The argument will depend on the system that works, for example, on MacOS this "open http://www.example.com/"(see https://github.com/eudoxia0/trivial-open-browser/blob/master/src/trivial-open-browser.lisp )
uiop:run-program
"open http://www.example.com/"
Source: https://habr.com/ru/post/1767792/More articles:Floating point and integer ambiguity - c ++Where is DataGridHeaderBorder for WPF DataGrid? - stylesWeb page scraper: click javascript button - pythonWhat happens between the Page.PreLoad and Page.Load events? - asp.netColdfusion cfchart stacks - coldfusionSimple physical modeling in java does not work. - javaUsing the gdb info malloc command in xcode (iphone dev) - iphoneDoes Netbeans Remove Inline Class? - javaThe easiest way to send emails through Python - pythonФильтрация списка друзей, извлеченных графиком Facebook api (больше из вопроса JavaScript/JQuery, чем вопрос API Facebook) - javascriptAll Articles