【发布时间】:2015-06-24 01:27:35
【问题描述】:
我可以使用具有魔术功能的环境变量,例如writefile in my ipthon notebook吗?
%env WORKING_DIR=/my/path/to/my/file
!echo $WORKING_DIR
/my/path/to/my/file
但是
%%writefile $WORKING_DIR/myfile.txt
sometext
IOError: [Errno 2] 没有这样的文件或目录:'$WORKING_DIR/myfile.txt'
【问题讨论】:
标签: python ipython ipython-magic