Re: .py and running in Windows:

Discussion in 'Python' started by Andrew Gwozdziewycz, Jun 13, 2006.

  1. You'll have better results posting this to it's own thread.

    On Jun 13, 2006, at 9:29 AM, Michael Yanowitz wrote:

    > Hello:
    >
    > Presently in my Windows 2000 system, when I double-click on a
    > .py file (open it) it automatically runs it in Python. I would
    > like to change that behavour. That is fine for .pyc file, but
    > for .py files, I would either like to have it run in Python but
    > return to the Python shell prompt when finished rather than
    > exit the shell. How do I do that?
    > Or would it cause a problem (so that Python no longer works) if
    > I change the default .py extension to open in an editor rather
    > than execute it if I open it?
    >
    > Thanks:
    > Michael Yanowitz
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list


    ---
    Andrew Gwozdziewycz

    http://23excuses.com | http://ihadagreatview.org | http://and.rovir.us
    Andrew Gwozdziewycz, Jun 13, 2006
    #1
    1. Advertising

  2. Andrew Gwozdziewycz

    Iain King Guest

    Andrew Gwozdziewycz wrote:
    > You'll have better results posting this to it's own thread.
    >


    He certainly should have, but since I've read it here anyway:


    > On Jun 13, 2006, at 9:29 AM, Michael Yanowitz wrote:
    >
    > > Hello:
    > >
    > > Presently in my Windows 2000 system, when I double-click on a
    > > .py file (open it) it automatically runs it in Python. I would
    > > like to change that behavour. That is fine for .pyc file, but
    > > for .py files, I would either like to have it run in Python but
    > > return to the Python shell prompt when finished rather than
    > > exit the shell. How do I do that?
    > > Or would it cause a problem (so that Python no longer works) if
    > > I change the default .py extension to open in an editor rather
    > > than execute it if I open it?
    > >


    In an explorer window, go to Tools->Folder Options
    Go to the File Types tab, find the PY extension, then click on
    Advanced*
    Select the 'open' action, and click Edit...
    change the 'Application used to perform action', inserting a '-i'
    between the exe and the first parameter. For example, I changed mine
    to:

    "C:\Python\python.exe" -i "%1" %*

    The exact line will depend on where your python.exe is.
    OK all the dialogs you've opened, then double click a .py file to test
    it.

    *I'm using WinXP, so the exact name of some of the buttons may be
    different for you.

    Iain
    Iain King, Jun 13, 2006
    #2
    1. Advertising

  3. Michael Yanowitz wrote:

    > I never specified a thread. I think perhaps though because I did
    > open another message in this mailing list (to get the correct
    > email address to send to), but I deleted all its contents i put
    > it under that other thread, however there is no indication of a
    > thread in Outlook email. I am sorry if it came up in another
    > thread that was not my intention.


    your message contains the line

    In-Reply-To: <>

    which indicates that you pressed "reply to", rather than "new message".
    changing the subject doesn't change that; your mail program still
    does what you asked it to do.

    </F>
    Fredrik Lundh, Jun 13, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Innes
    Replies:
    7
    Views:
    422
    Alf P. Steinbach
    Sep 19, 2003
  2. Benjamin Rutt
    Replies:
    2
    Views:
    916
    Peter Hansen
    Dec 20, 2005
  3. Michael Yanowitz

    .py and running in Windows:

    Michael Yanowitz, Jun 13, 2006, in forum: Python
    Replies:
    0
    Views:
    328
    Michael Yanowitz
    Jun 13, 2006
  4. Cedric Fontaine
    Replies:
    1
    Views:
    305
    Jim Langston
    Dec 11, 2007
  5. Mchizi_Crazy
    Replies:
    2
    Views:
    276
    Sumitava Mukherjee
    Sep 9, 2008
Loading...

Share This Page