Open webpage with python on mac

I’m wanting my python script to open a browser window. The following works fine on Windows, but not on the one mac that I have access to. Is there a way that would work on both platforms?

"rs.Command (’-Run "https://www.food4rhino.com/app/peters-tools"’)"

Hi @phcreates, please see reply from @dale here

_
c.

Thanks!

Also natively in python :

import webbrowser
webbrowser.open(url)
1 Like

Why would you even want to do this? *creepy*

So that a user can click a button to open a website where they can see if they have the latest version.

OK :roll_eyes:

Hi @Dancergraham, did you try this on a mac ? I’ve recently got one and using the default install, webbrowser.open(url) did not work in Rhino 7.9 on a mac mini M1.

_
c.

It doesn’t work on my Intel mac either. :slight_smile: It’s probably due to IronPython running encapsulated inside the Rhino enclave and not having the right system access to open or control your webbrowser?

Ahh no I’ve used this in CPython on a Mac and on rhino for windows but not in Rhino for Mac

I did it to open the pdf user guide I put on our company intranet

1 Like

I wonder if this is a security thing. My mac os seems to be extra restricive, the first time i programmatically tried to capture a view, it asked me for a password :slight_smile:
_
c.