How can I change drive letter while in IPython under windows? For example, !cd W: does not make W: the current path, it just changes the path if you would change to drive W. Changing to a dos shell with !cmd and then changing to W: does not have any effect to the IPython shell.
From the cd ? command:
Note that !cd doesn't work for this purpose because the shell where !command runs is immediately discarded after executing 'command'.
So, just use the cd, and make sure to quote path so the colon after the drive letter isn't misinterpreted.
cd 'W:'
I have a Win 10 machine with Anaconda 2020.11 python installed, out of the box no updates. ipython 7.19.0. The only way I can cd to somewhere on another drive letter is
cd d:/
No other permutation works: cd d:, cd d:, cd d:\, cd 'd:', cd 'd:', etc.
So there's an answer but it's quite annoying to figure out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With