Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Jupyter中使用自定义ContentsManager创建新文件_Python_Jupyter Notebook_Jupyter_Jupyter Lab - Fatal编程技术网

Python 在Jupyter中使用自定义ContentsManager创建新文件

Python 在Jupyter中使用自定义ContentsManager创建新文件,python,jupyter-notebook,jupyter,jupyter-lab,Python,Jupyter Notebook,Jupyter,Jupyter Lab,我正在为Jupyter笔记本编写一个自定义管理器,并开始创建新文件 最初,我的文件\u存在函数始终返回True,并且我得到无法发布到文件,请改用PUT错误,与相同 接下来,我修改了file\u exists函数以返回False,但是现在Jupyter陷入了调用file\u exists的循环中: /dir /dir/Untitled.ipynb /dir/Untitled1.ipynb /dir/Untitled2.ipynb ... 我的问题是-我应该从文件返回什么?如果存在,笔记本创建就可

我正在为Jupyter笔记本编写一个自定义管理器,并开始创建新文件

最初,我的
文件\u存在
函数始终返回
True
,并且我得到
无法发布到文件,请改用PUT
错误,与相同

接下来,我修改了
file\u exists
函数以返回
False
,但是现在Jupyter陷入了调用
file\u exists
的循环中:

/dir
/dir/Untitled.ipynb
/dir/Untitled1.ipynb
/dir/Untitled2.ipynb
...
我的问题是-我应该从
文件返回什么?如果存在
,笔记本创建就可以进行了


我想可能是
get
save
file\u存在后被调用
,但情况似乎并非如此。

存在
-错误

exist\u dir
for dir-true

文件的
存在\u dir
错误

那是票