MCPcopy Create free account
hub / github.com/ipython/ipython / pwd

Method pwd

IPython/core/magics/osm.py:284–297  ·  view source on GitHub ↗

Return the current working directory path. Examples -------- :: In [9]: pwd Out[9]: '/home/tsuser/sprint/ipython'

(self, parameter_s='')

Source from the content-addressed store, hash-verified

282 @skip_doctest
283 @line_magic
284 def pwd(self, parameter_s=''):
285 """Return the current working directory path.
286
287 Examples
288 --------
289 ::
290
291 In [9]: pwd
292 Out[9]: '/home/tsuser/sprint/ipython'
293 """
294 try:
295 return os.getcwd()
296 except FileNotFoundError:
297 raise UsageError("CWD no longer exists - please use %cd to change directory.")
298
299 @skip_doctest
300 @line_magic

Callers

nothing calls this directly

Calls 1

UsageErrorClass · 0.90

Tested by

no test coverage detected