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


Groups > comp.lang.python > #52679

Re: refresing the edited python function

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <sudheer.joseph@yahoo.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.070
X-Spam-Evidence '*H*': 0.86; '*S*': 0.00; 'modified': 0.07; 'imported': 0.09; 'objects,': 0.09; 'restart': 0.09; 'thus,': 0.09; 'python': 0.11; 'changes': 0.15; '"from': 0.16; '"in': 0.16; '>in': 0.16; '>the': 0.16; '>they': 0.16; 'email addr:yahoo.com&gt;': 0.16; 'object).': 0.16; 'reload': 0.16; 'unchanged': 0.16; 'subject:python': 0.16; 'modification': 0.16; 'code.': 0.18; 'module': 0.19; 'solution.': 0.20; 'code,': 0.22; 'import': 0.22; '(in': 0.22; 'tests': 0.22; 'to:name:python- list@python.org': 0.22; 'skip:\xa0 20': 0.24; 'developers': 0.25; 'options': 0.25; '&gt;': 0.26; 'required.': 0.27; 'header:In- Reply-To:1': 0.27; 'to:2**1': 0.27; 'tried': 0.27; 'function': 0.29; 'points': 0.29; 'wonder': 0.29; 'url:mailman': 0.30; 'code': 0.31; 'getting': 0.31; 'issuing': 0.31; 'reflected': 0.31; 'writes:': 0.31; 'this.': 0.32; 'url:python': 0.33; 'running': 0.33; 'monday,': 0.33; 'subject:the': 0.34; 'something': 0.35; 'done.': 0.35; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'functions.': 0.36; 'limitations': 0.36; 'module.': 0.36; 'reflect': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'application': 0.37; 'email addr:python.org': 0.37; 'thank': 0.38; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'does': 0.39; 'subject:': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'hope': 0.61; 'august': 0.61; 'simple': 0.61; 'further': 0.61; 'complete': 0.62; 'name': 0.63; 're:': 0.63; 'skip:n 10': 0.64; 'email name:python- list': 0.65; 'header:Reply-To:1': 0.67; 'approaches': 0.68; 'received:106': 0.68; 'received:106.10': 0.68; 'received:106.10.166': 0.68; 'received:bullet.mail.sg3.yahoo.com': 0.68; 'received:mail.sg3.yahoo.com': 0.68; 'received:sg3.yahoo.com': 0.68; '8bit%:100': 0.72; 'repeat': 0.74; 'day': 0.76; 'partial': 0.84; 'received:106.10.151': 0.84; 'old,': 0.85; 'received:115': 0.91; 'task,': 0.91; '2013': 0.98
X-Yahoo-Newman-Property ymail-3
X-Yahoo-Newman-Id 487698.7584.bm@omp1014.mail.sg3.yahoo.com
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1376897268; bh=as9UCe2CXdxJwq6fJUBD866uJbmT+h5WfTc0hSbUpkE=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=EIjsC6Xze1dlIfxu2Ap2W1AedCtP7fB09Qxu5MN9cyFxELnOGizgxrMvPVr0fRBGqCAtvu6VLeCmRc0qj6myWHeAJrYCl0Usn7LiIDvlf63Z7/EdXjIQzZXwoEbjBgc1fdaZMCCKlPMakXrf1y+IimlpdTQYrvSLIC1VnC0USpA=
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=j9RonLCccZmjyxUtloj65nhNG7wxmbKISHIewbegn/5ESXV/yRAO2va586sTIEkTpv5Ej1yEHd7RN5Zt/MHd3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XJ5IHRpbWUgYSBmdW5jdGlvbiBpcyBtb2RpZmllZCBvbmUgaGFzIHRvIHJlc3RhcnQgdGhlIGNvbnNvbGUgaXMgYSABMAEBAQE-
X-Mailer YahooMailWebService/0.8.154.571
References <1376873736.85790.YahooMailNeo@web193402.mail.sg3.yahoo.com> <87haemjj92.fsf@handshake.de>
Date Mon, 19 Aug 2013 15:27:47 +0800 (SGT)
From Sudheer Joseph <sudheer.joseph@yahoo.com>
Subject Re: refresing the edited python function
To dieter <dieter@handshake.de>, "python-list@python.org" <python-list@python.org>
In-Reply-To <87haemjj92.fsf@handshake.de>
MIME-Version 1.0
Content-Type multipart/alternative; boundary="897404883-350692608-1376897267=:58372"
X-Mailman-Approved-At Mon, 19 Aug 2013 10:39:38 +0200
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To Sudheer Joseph <sudheer.joseph@yahoo.com>
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18.1376901579.19984.python-list@python.org> (permalink)
Lines 95
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376901579 news.xs4all.nl 15897 [2001:888:2000:d::a6]:44410
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52679

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Thank you Dieter,
                     I never thought it will be so difficult task, All I was thinking was that, I just do not know how it is done. I wonder how the code developers work in this case every time a function is modified one has to restart the console is a nightmare... Hope one day some solution will be evolved.
with best regards,
Sudheer




>________________________________
> From: dieter <dieter@handshake.de>
>To: python-list@python.org 
>Sent: Monday, 19 August 2013 11:48 AM
>Subject: Re: refresing the edited python function
> 
>
>Sudheer Joseph <sudheer.joseph@yahoo.com> writes:
>
>> 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?
>
>Getting changes into a running application is difficult.
>Python has not been designed to make this easy.
>
>The "reload" above is one partial way to achieve something like this.
>The "reload" causes the module to be reloaded. If you have changed
>the modules code, these changes will be reflected *inside* the reloaded
>module. However, other modules may have imported objects from
>this module (as  in your "from xxx.py import yy"). To see changes
>in those objects, they, too, must repeat the import (otherwise,
>they continue to use the old, unchanged object).
>
>There is an additional approach, used e.g. by "plone.reload".
>In this approach, the objects are modified "in place". All usage
>points of the modified object will see changes.
>However, there are (quite severe) limitations to what changes
>can be made "in place". Thus, this, too, does not give a complete
>solution.
>
>In simple cases, one of those approaches can avoid a restart
>after modifications. However, in general, a restart is required.
>
>-- 
>http://mail.python.org/mailman/listinfo/python-list
>
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: refresing the edited python function Sudheer Joseph <sudheer.joseph@yahoo.com> - 2013-08-19 15:27 +0800

csiph-web