代码之家  ›  专栏  ›  技术社区  ›  danza

“webbrowser”Python包是否有Haskell等价物?[已关闭]

  •  1
  • danza  · 技术社区  · 8 年前

    Python有非常方便的 webbrowser 包,其中包括 webbrowser.open() 该函数允许在某个位置打开浏览器,甚至在本地文件系统中的文件上。这样,Python程序可以生成一个web文档作为输出,并将其呈现给用户。哪些Haskell包公开了类似的功能?

    1 回复  |  直到 8 年前
        1
  •  2
  •   Sibi    8 年前

    有一个名为的包 open-browser :

    $ stack ghci open-browser
    Run from outside a project, using implicit global project config
    Using resolver: lts-6.14 from implicit global project's config file: /home/sibi/.stack/global-project/stack.yaml
    open-browser-0.2.1.0: using precompiled package
    Configuring GHCi with the following packages:
    GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
    λ> import Web.Browser
    λ> openBrowser "https://www.google.com"
    True
    

    这将在默认浏览器Firefox中打开google页面。