Juypter changes the default path and solves the problem of not automatically jumping after changing the default path

Table of contents

change the default path

The first step is to enter the following code in the environment of your installed juypter

 The second step is to find this directory in your own folder and open it with Notepad

 The third step is to change the shortcut

Solve the browser does not switch method 


Compared with juypter, it is still very easy to use, and I feel better than pycharm.

The default path of juypter is on the c drive. When we process data and change the code, if it is always on the c drive, it will cause memory problems.

Then we will change the path of juypter

change the default path

The first step is to enter the following code in the environment of your installed juypter

Jupyter notebook --generate-config

After inputting, a file on the c drive will be generated, as shown in the figure below

 The second step is to find this directory in your own folder and open it with Notepad

 After opening it with Notepad, about 390 lines, #c.NotebookApp.notebook_dir = '' Find this sentence

Remove the # sign and replace the quotes with the path you want to change.

 The third step is to change the shortcut

Find juypter on the start interface and right click to open the file location. 

 Find juypter, right click on the starting position to modify the folder location that your own juypter wants to open, and remove the variables behind the above target, as shown in the figure below after removal:

Note: Here you must first click Apply and then confirm, otherwise it may not change.

 After the modification, click on juypter, but at this time the transfer has not been realized on my computer.

It's possible to copy this path into the browser, but I still don't feel comfortable.

Solve the browser does not switch method 

The first step is to open this file with Notepad. We are going to add browser jumps to this configuration file

import webbrowser
webbrowser.register("Edge",None,webbrowser.GenericBrowser("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe")) #The path is the path of your own browser c.NotebookApp
. browser = 'Edge' #browser name

 Add these three lines of code in it, here I use the edge browser, just add it in any location.

Then click juypter to run as shown below

 

 Can realize automatic jump, over

Guess you like

Origin blog.csdn.net/qq_61897141/article/details/131086150