We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c52790f commit a65c7b3Copy full SHA for a65c7b3
nbopen.py
@@ -31,10 +31,14 @@ def nbopen(filename, profile='default'):
31
webbrowser.open(url, new=2)
32
elif filename.startswith(home_dir):
33
print("Starting new server")
34
- notebookapp.launch_new_instance(file_to_run=os.path.abspath(filename),
35
- notebook_dir=home_dir,
36
- open_browser=True,
+ filename = os.path.abspath(filename)
+ if os.path.isdir(filename):
+ kw = {'notebook_dir': filename}
37
+ else:
38
+ kw = {'file_to_run': filename}
39
+ notebookapp.launch_new_instance(open_browser=True,
40
argv=[], # Avoid it seeing our own argv
41
+ **kw,
42
)
43
else:
44
raise OutsideHomeDir
0 commit comments