Is there is way to show the current directory in IPython prompt?
Instead of this: In [1]: Something like this: In<~/user/src/proj1>[1]:
The easiest way is to run easy_install ipython[all] as an administrator (start button, type cmd , shift+right click on “cmd.exe” and select “Run as administrator”). This installs the latest stable version of IPython including the main required and optional dependencies.
You can use os.getcwd
(current working directory) or in the native os command pwd
.
In [8]: import os In [9]: os.getcwd() Out[9]: '/home/rockwool' In [10]: pwd Out[10]: '/home/rockwool'
Using ! before pwd will show the current directory
In[1]: !pwd /User/home/
When interactive computing it is common to need to access the underlying shell. This is doable through the use of the exclamation mark ! (or bang) To execute a command when present in beginning of line.
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