![]() Turning this setting on also requires you to create and store a default associations configuration file, locally or on a network share. I verified that the strings I tried all worked in python, so the only way to be sure would be to look at the jupyter source code.Īnyway, since registering a browser with the module does not persist, if your browser isn't already registered by default, it is probably best to use a literal browser command with the backslashes replaced with forward slashes. Open your Group Policy editor and go to the Computer Configuration\Administrative Templates\Windows Components\File Explorer\Set a default associations configuration file setting. In the search bar, type in Chrome and click it when. #SET CHROME AS DEFAULT BROWSER HOW TO#I for the life of me couldn't get unicode/raw string commands or commands where I escaped each backslash with an extra backslash to work, so replacing the backslashes with forward slashes may be the only option. Here’s how to do it: On your Windows 11 device, head into Settings. 'C:\Home\AppData\Local\Google\Chrome\Application\chrome.exe %s' 'C:/Home/AppData/Local/Google/Chrome/Application/chrome.exe %s' The easiest way is to replace the backslashes in the command with foward slashes, e.g., Any backslashes in the browser command need to be be escaped or replaced. The backslash is used in python string literals to escape any characters that otherwise have any special meaning (e.g., to include a quote or double quote inside the string literal). Since this question is about how to run the browser on Windows, the browser command will probably contain backslashes. #SET CHROME AS DEFAULT BROWSER REGISTRATION#This browser registration does not persist, so the process must be repeated every time the server is launched.Īlternatively, if the string does contain the characters %s, it is interpreted as a literal browser command. Webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'))Īnd finally, the jupyter server is fed the browser name The chrome browser is registered with the module Open Google Chrome and click on the Actions menu in the top right. ![]() This is why Abhirup Das's answer works, first the webbrowser module is imported How to set Google Chrome as my default browser 1. It is interpreted as a browser name and the module checks if it has a browser registered with that name (see the python documentation for which browsers are registered by default). If the string does not contain the characters %s If you do specify a value here, it can be interpreted in one of two ways, depending on whether or not the value you specified ends with the characters %s. ![]() If no value is specified, the function selects the user's default browser. jupyter is using python's webrowser module to launch the browser by passing the value for c.NotebookApp.browser to the webbrowser.get(using=None) function. I'd like to offer a little more information about what to put in your jupyter_notebook_config.py file than is included in any of the other answers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |