Clearing the screen

Ishwor ishwor.gurung at gmail.com
Sun Dec 26 02:42:15 CET 2004


On Sat, 25 Dec 2004 16:34:26 -0800, Scott David Daniels
<Scott.Daniels at acm.org> wrote:
> Nick Coghlan wrote:
> > Jeff Epler wrote:
> >
> >> I don't know about idle, but the "real" python supports the
> >> PYTHONSTARTUP environment variable.
> >
> > I just tried it - IDLE ignores PYTHONSTARTUP, as does PythonWin (I just
> > started using PYTHONSTARTUP to switch the standard prompt from '>>>' to
> > "Py>').
> >
> > I believe PYTHONSTARTUP is handled by CPython's main function before it
> > gets to the interactive interpreter.
> >
> > Cheers,
> > Nick.
> > 
> From the Fine Manual:
>     Command line usage
>     idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...
> 
>     -c command  run this command
>     -d          enable debugger
>     -e          edit mode; arguments are files to be edited
>     -s          run $IDLESTARTUP or $PYTHONSTARTUP first
>     -t title    set title of shell window
> 
> On Windows, it is likely to be idle.pyw.  So, add a -s to the command
> line used in the shortcut to start Idle.

okay since i couldn't find .pythonrc in my computer. what i did in the
idle.bat which starts idle.pyw is added the '-r' switch which
basically runs the script from the file -
@echo off
rem Working IDLE bat for Windows - uses start instead of absolute pathname
start idle.pyw -s -r "C:\Python24\file\Pyfiles\clear.py" %1 %2 %3 %4
%5 %6 %7 %8 %9

and it works fine but i have to do
>>>clear.cls();
instead of just plain
>>> cls();
but i'll walk with that. ;-)

I hope this will be clear as i gradually read the text. It has to do
something with the
__builtins__ probably.
Thanks everyone. ;-)

> 
> --Scott David Daniels
> Scott.Daniels at Acm.Org
> --
> http://mail.python.org/mailman/listinfo/python-list
> 


-- 
cheers,
Ishwor Gurung



More information about the Python-list mailing list