[Tutor] Redirecting output + calling dos commands with input tail

cino hilliard hillcino368@hotmail.com
Tue Jun 17 23:44:02 2003


Bravo! Jeff. This works!

Still I am curious, why the compiler can't overwrite the old session. It 
seems to me it could internally
create another >>> session and then kill itself as a crude solution. I am 
lazy and like the clean,crisp
function call pycall vs the shell.pycall(). Seems to be a minor challenge 
for a master programmer to
quickly make this modification or better "evolution" in an improving 
language.


>From: "Jeff Shannon" <jeff@ccvcorp.com>
>To: tutor@python.org
>CC: cino hilliard <hillcino368@hotmail.com>
>Subject: Re: [Tutor] Redirecting output + calling dos commands with input 
>tail
>Date: Tue, 17 Jun 2003 16:21:46 -0700
>
>cino hilliard wrote:
>
>>3. When I make a modification to shell.py I have to close the current 
>>python.exe chevron >>>
>>window and start another and  from shell import * again or open another 
>> >>> and from shell import *
>>Any way around this? I want to keep the last >>> because the previous 
>>commands can be
>>retreived with f3 and the arrow keys. The import shell.pycall etc doesn't 
>>work in xp pro p4 either.
>
>
>Yes, there's a simple way around this.  First, don't use 'from shell import 
>*', use 'import shell' instead.  Now, every function that you're using from 
>the file will be referred to as, e.g., shell.pypari() or shell.pycall().  
>This requires a tiny bit more typing (unless you have an IDE that does 
>autocompletion, where it might *save* typing!), but it makes keeping track 
>of which functions are yours and which are built-in to Python much simpler. 
>  (It also reduces the risk of having one of your functions hide a built-in 
>function by "stealing" its name.)  Now, when you make changes to your 
>shell.py file, you can simply type 'reload(shell)', and the module will be 
>reloaded from the file (with your changes).
>
>Jeff Shannon
>Technician/Programmer
>Credit International
>
>


  3         3        3         3        3        6            2              
  (0^0)
2   +  13  +  33  +  43  =  49   =  7    =  343   = 117649

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail