[IPython-user] Fail to reload file on %run

Joachim B Haga cjhaga at fys.uio.no
Wed Jun 21 16:37:42 CDT 2006


Joachim B Haga <cjhaga at fys.uio.no> writes:

> I just started using ipython (0.7.1 on ubuntu, 0.7.2 on debian),
> and I have this problem: the %run command fails to pick up changes

To follow up on this: It fails to reload when the file (PmtReader.py)
looks like this,

  ----------------------
  class PmtReader:
      ...snip...

  if __name__ == "__main__":
      import PmtReader
      p = PmtReader.PmtReader('ggxy')
  ----------------------

but it works if the "import" etc is removed,

  ----------------------
  class PmtReader:
      ...snip...

  if __name__ == "__main__":
      p = PmtReader('ggxy')
  ----------------------

The -deep_reload parameter to ipython makes no difference.

-j.




More information about the IPython-user mailing list