Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Clearing the screen

Reply
Thread Tools

Re: Clearing the screen

 
 
Nick Coghlan
Guest
Posts: n/a
 
      12-25-2004
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.

--
Nick Coghlan | http://www.velocityreviews.com/forums/(E-Mail Removed) | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
 
Reply With Quote
 
 
 
 
Scott David Daniels
Guest
Posts: n/a
 
      12-26-2004
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.


--Scott David Daniels
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Steven Bethard
Guest
Posts: n/a
 
      12-26-2004
Scott David Daniels 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.


Anyone know if there is a similar option to PythonWin? I looked around
a bit, but couldn't find one...

Steve
 
Reply With Quote
 
Ishwor
Guest
Posts: n/a
 
      12-26-2004
On Sun, 26 Dec 2004 01:47:42 GMT, Steven Bethard
<(E-Mail Removed)> wrote:
> Scott David Daniels 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.

>
> Anyone know if there is a similar option to PythonWin? I looked around
> a bit, but couldn't find one...


i was just tinkering with it actually.
In your command prompt just do
Pythonwin.exe /run "C:\Python24\file\PyFiles\clear.py"

or if you hate doing that then just create a batch script (.bat) as such-

@echo off
start "C:\Python24\Lib\site-packages\pythonwin\Pythonwin.exe /run
"C:\Python24\file\PyFiles\clear.py" "

see the pythonwin reference manual for more option
>
> Steve
> --
> http://mail.python.org/mailman/listinfo/python-list
>



--
cheers,
Ishwor Gurung
 
Reply With Quote
 
John Machin
Guest
Posts: n/a
 
      12-26-2004

Ishwor wrote:

> i was just tinkering with it actually.
> In your command prompt just do
> Pythonwin.exe /run "C:\Python24\file\PyFiles\clear.py"


It's not a very good idea to store your own scripts in the PythonXY
directory -- other than tested working modules which you install in
PythonXY\lib\site-packages.
E.g. what will you do when Python 2.5 arrives?

 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      12-27-2004
John Machin wrote:

> Ishwor wrote:
>
>
>>i was just tinkering with it actually.
>>In your command prompt just do
>>Pythonwin.exe /run "C:\Python24\file\PyFiles\clear.py"

>
>
> It's not a very good idea to store your own scripts in the PythonXY
> directory -- other than tested working modules which you install in
> PythonXY\lib\site-packages.
> E.g. what will you do when Python 2.5 arrives?
>


As has been recently pointed out in another thread, the interpreter
(actually, code in the "site" module) searches for a "sitecustomize"
module when starting up. This is the easiest way to implement required
startup behavior no matter what environment the interpreter's running
in. For more information, RTFM concerning the "site" module, whose
documentation includes the following:

"""After these path manipulations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary site-specific
customizations. If this import fails with an ImportError exception, it
is silently ignored."""

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing the output screen Colin Hemmings Java 3 02-21-2006 12:20 AM
Newbie question - clearing screen @ interactive prompt Kaizer Python 3 12-10-2005 08:40 AM
Clearing Screen Sebastian Becker C++ 2 01-12-2005 09:28 PM
Clearing the screen Ishwor Python 4 01-01-2005 09:07 PM
Clearing IDLE's screen? Miki Tebeka Python 3 02-09-2004 09:13 PM



Advertisments