Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
%cd
可以使iPython中的%cd魔术命令不显示输出路径吗?如果您传递相对路径或从快捷方式开始,这在共享笔记本时可能会很好,但输出显示可能与观众无关的完整路径。~/
~/
In [1]: %cd ~/GitHub/someplace /Users/accountname/GitHub/someplace In [2]: |
不返回任何内容或返回相对路径会很好......
iPython魔术命令提供了一个安静的选项。使用-q选项不显示输出。
-q
In [1]: %cd -q ~/GitHub/someplace In [2]: |