bur*_*res 7 python ipython-notebook
我希望能够使用变量在IPython Notebook中输出一些文本。我可以使用%% writefile命令从IPython Notebook中写入文件。我还可以使用变量使用$ varaible_name命名文件。
file_name = "file.out"
some_variable = "text"
Run Code Online (Sandbox Code Playgroud)
新细胞
%%writefile $file_name
????some_varaible #<-what command goes here
Run Code Online (Sandbox Code Playgroud)
这样输出文件(名为“ file.out”)看起来像这样:
文本
归档时间: |
|
查看次数: |
853 次 |
最近记录: |