Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.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
从文件在ipython中使用store magic_Ipython - Fatal编程技术网

从文件在ipython中使用store magic

从文件在ipython中使用store magic,ipython,Ipython,%store magic的文档说明您可以将变量存储到文件中 ie:%store foo>a.txt-将foo的值存储到新文件a.txt中 %store foo>>a.txt-将foo的值附加到文件a.txt中 我已经能够成功地将变量写入一个纯文本可读的文件。(尽管它似乎遗漏了一些数据,因为存在椭圆) 如何恢复这些变量?典型的命令是%store-r,但%store不显示任何变量。如果要在命名文件中存储变量,直接使用命令可能更容易;无论如何,商店魔术都在内部使用它。但是,如果你想存档或共享数据,你

%store magic的文档说明您可以将变量存储到文件中

ie:%store foo>a.txt-将foo的值存储到新文件a.txt中 %store foo>>a.txt-将foo的值附加到文件a.txt中

我已经能够成功地将变量写入一个纯文本可读的文件。(尽管它似乎遗漏了一些数据,因为存在椭圆)


如何恢复这些变量?典型的命令是%store-r,但%store不显示任何变量。

如果要在命名文件中存储变量,直接使用命令可能更容易;无论如何,商店魔术都在内部使用它。但是,如果你想存档或共享数据,你可能应该选择另一种格式,比如JSON或CSV,这种格式与你的代码联系不太紧密。看起来像是个bug,目前还没有问题。但在这个问题上缺乏积极性表明很少有人需要它。我要泡菜。