Python 打开 .ipynb.txt 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35324503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Opening a .ipynb.txt File
提问by saurabh gupta
I have got downloaded a file that got downloaded in a format .pynb.txt extension. Can anyone help me to figure how to make it in a readable format? Attaching a screenshot of the file when i tried opening in python notebook.
我已经下载了一个以 .pynb.txt 扩展名格式下载的文件。谁能帮我弄清楚如何以可读的格式制作它?当我尝试在 python notebook 中打开时附上文件的屏幕截图。
Output of the python notebook when tried to open a file with extension .pynb.txt
回答by srj
What you have on your hands is an IPython Notebookfile. (Now renamed to Jupyter Notebook
您手头上有一个IPython Notebook文件。(现在更名为Jupyter Notebook
you can open it using the command ipython notebook filename.ipynb
from the directory it is downloaded on to.
您可以使用ipython notebook filename.ipynb
它下载到的目录中的命令打开它。
If you are on a newer machine, open the file as jupyter notebook filename.ipynb
.
如果您使用的是较新的机器,请将文件打开为jupyter notebook filename.ipynb
.
do not forget to remove the .txt extension.
不要忘记删除 .txt 扩展名。
the file has a series of python code/statements and markdown text that you can run/inspect/save/share. read more about ipython notebook from the website.
该文件有一系列 python 代码/语句和 Markdown 文本,您可以运行/检查/保存/共享。从网站上阅读有关 ipython notebook 的更多信息。
if you do not have IPython installed, you can do
如果你没有安装 IPython,你可以这样做
pip install ipython
pip install ipython
or check out installation instructions at the ipython website
或在ipython 网站上查看安装说明
回答by Nages
Below is the easiest way in case if Anacondais already installed.
如果Anaconda已经安装,下面是最简单的方法。
1) Under "Files", there is an option called,"Upload".
1) 在“文件”下,有一个名为“上传”的选项。
2) Click on "Upload" button and it asks for the path of the file and select the file and click on upload button present beside the file.
2) 点击“上传”按钮,它会询问文件的路径并选择文件,然后点击文件旁边的上传按钮。
回答by niticon
If you have a unix/linux system I'd just rename the file via command line
如果您有 unix/linux 系统,我只需通过命令行重命名文件
mv file_name.pynb.txt file_name.ipynb
worked like a charm for me!
对我来说就像一个魅力!
回答by ra1729i6
Try the following steps:
尝试以下步骤:
- Download the file open it in the Juypter Notebook.
- Go to File-> Renameand remove the .txtextension from the end; so now the file name has just .ipynbextension.
- Now reopenit from the Juypter Notebook.
- 下载文件,在 Juypter Notebook 中打开它。
- 转到File -> Rename并从末尾删除.txt扩展名;所以现在文件名只有.ipynb扩展名。
- 现在从 Juypter Notebook重新打开它。
回答by Ahsan Khan
go to cmd get into file directory and type jupyter notebook filename.ipynb in my case it open code editor and provide local host connection string copy that string and paste in any browser!done
转到 cmd 进入文件目录并键入 jupyter notebook filename.ipynb 在我的情况下它打开代码编辑器并提供本地主机连接字符串复制该字符串并粘贴到任何浏览器中!完成
回答by user3754036
These steps work for me:
这些步骤对我有用:
- Open the file in Jupyter Notebook.
- Rename the file: Click File > Rename, type '.ipynb' behind the name, and click OK
- Close the file.
- From the Jupyter Notebook's directory tree, click the filename to open it.
- 在 Jupyter Notebook 中打开文件。
- 重命名文件:单击“文件”>“重命名”,在名称后面键入“.ipynb”,然后单击“确定”
- 关闭文件。
- 从 Jupyter Notebook 的目录树中,单击文件名将其打开。