Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #52756
| References | <1376873736.85790.YahooMailNeo@web193402.mail.sg3.yahoo.com> <240094707.38267207.1377016657069.JavaMail.root@sequans.com> |
|---|---|
| Date | 2013-08-21 14:26 +0800 |
| From | Sudheer Joseph <sudheer.joseph@yahoo.com> |
| Subject | Re: refresing the edited python function |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.70.1377075520.19984.python-list@python.org> (permalink) |
Thank you, But I wish if there was a foolproof reload with best regards, Sudheer ----- Original Message ----- > From: Jean-Michel Pichavant <jeanmichel@sequans.com> > To: Sudheer Joseph <sudheer.joseph@yahoo.com> > Cc: python-list@python.org > Sent: Tuesday, 20 August 2013 10:07 PM > Subject: Re: refresing the edited python function > > > ----- 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. >
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: refresing the edited python function Sudheer Joseph <sudheer.joseph@yahoo.com> - 2013-08-21 14:26 +0800
csiph-web