Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52738 > unrolled thread

Re: refresing the edited python function

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2013-08-20 18:37 +0200
Last post2013-08-20 18:37 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Re: refresing the edited python function Jean-Michel Pichavant <jeanmichel@sequans.com> - 2013-08-20 18:37 +0200

#52738 — Re: refresing the edited python function

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2013-08-20 18:37 +0200
SubjectRe: refresing the edited python function
Message-ID<mailman.62.1377016726.19984.python-list@python.org>
----- Original Message ----- 

> Hi,
> I have been using ipython and ipython with qtconsole and working on a
> code with functions. Each time I make a modification in function

> I have to quit IPTHON console (in both with and with out qt console )
> and reload the function freshly. If I need to see the changed I made
> in the function. I tried below options
> del function name

> import the module again by issuing "from xxx.py import yy"
> import xxx.py
> make changes
> reload(xxx.py)
> this works only if the the function in the code has same name as the
> code. But even this do not reflect the changes made by editing the
> code.
> So what is the standard way to update the function for further tests
> after an edit?
> with best regards,
> Sudheer

Hi,

My "standard" way ;) :
1/ create a file
2/ edit the code
3/ run ipython (with %pdb on)
4/ within ipython "run myfile.py"
5/ check / introspect /debug
6/ change the code
7/ exit ipython
8/ reenter ipython
9/ using the ipython shell history, reexecute the file (2 key press) and go back to 5/

I used to reload my objects, it's been useful until one time when I lost a lot of time because of some nasty side effect. In the end it's not worth it. Always quit the shell, always.

JM



-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web