[Pythonmac-SIG] RE: [wxPython-mac] downside to just always using pythonw?
Kevin Altis
altis@semi-retired.com
Sun, 2 Feb 2003 15:01:02 -0800
Part of my reasoning which I don't think I made clear in the original
message is that output from print statements, tracebacks, etc. all seem to
go to the Console if you run a script from the Finder. Thus unlike Windows,
you always have a "console window" either in the form of the Terminal you
run the script from or the Mac OS X Console. You shouldn't ever miss output
because of a runtime exception or syntax error. There doesn't seem to be any
advantage to wrapping up Finder script launching with a shell script to use
the Terminal.
Another difference from Windows is that running Python with the -i
command-line option to inspect interactively after running script won't do
you any good unless you are running from the Terminal; perhaps Linux does
something similar? This seems to be the only use for "Run in a Terminal
window" option in PythonLauncher; that is if you need a Python interactive
prompt after a script runs and you are running the script from the Finder.
If you just want to see output, it is all going to go to the Console anyway.
If that is not correct, please let me know.
ka
> -----Original Message-----
> From: Jack Jansen [mailto:Jack.Jansen@oratrix.com]
> Sent: Sunday, February 02, 2003 2:32 PM
> To: pythonmac-sig@python.org
> Cc: Kevin Altis
> Subject: Fwd: [wxPython-mac] downside to just always using pythonw?
>
>
> I'm forwarding this message that Kevin Altis sent to the wxPython
> mailing list earlier today, and I'd like to get feedback on it.
>
> On first thought I think I agree with it (the gist is: "make
> PythonLauncher always use pythonw, so the only difference between its
> treatment of .py and .pyw files is that the former get a console
> window"). There are some drawbacks (if you are developing a script that
> will eventually run in a windowless environment you will not notice it
> if your script calls to the window manager), but I think the advantage
> of more comprehensible behavior for novices outweighs that. Note that
> this would only mean that the default app for .py scripts would change,
> you'll always be able to change it back.
>
> Begin forwarded message:
>
> > From: "Kevin Altis" <altis@semi-retired.com>
> > Date: zon feb 2, 2003 00:00:53 Europe/Amsterdam
> > To: "Wxpython-Mac" <wxpython-mac@lists.wxwindows.org>
> > Subject: [wxPython-mac] downside to just always using pythonw?
> > Reply-To: wxPython-mac@lists.wxwindows.org
> >
> > I know that via the PythonLauncher we can automatically have scripts
> > with a
> > .pyw extension run with pythonw. However, most scripts brought over
> > from
> > Linux and Windows designed to run with wxPython are unlikely to have
> > the
> > .pyw extension set. Normally, the .pyw extension is only useful under
> > Windows when you want to suppress the console window being displayed
> > such as
> > when you run a script from the Explorer by double-clicking the file.
> >
> > So, either you train Mac OS X Python users to rename GUI scripts to
> > .pyw,
> > provide some utility to do the conversion, or setup PythonLauncher to
> > run
> > .py scripts by default with pythonw. The latter seems the simplest.
> > The vast
> > majority of the scripts I'll be running are GUI scripts and I also
> > need to
> > work on files out of cvs where it is not practical to rename the files
> > to
> > .pyw. I can always manually choose to use python instead of pythonw in
> > the
> > Terminal or hold down the Option/Alt key to bring up PythonLauncher if
> > I
> > specifically need to use /usr/local/bin/python.
> >
> > The question then becomes what are the downsides and likely errors that
> > would occur by just always using /usr/local/bin/pythonw instead of
> > /usr/local/bin/python? Is it simply a matter of using more memory and
> > slower
> > script startup because extra libs are loaded? I think we might want to
> > make
> > pythonw the default for even .py scripts if those are the only issues,
> > the
> > user can always change the Preference back to python.
> >
> > If someone could spell out the differences and/or suggest alternative
> > approaches to using pythonw and .pyw scripts that would be welcome.
> > Right
> > now I forsee endless messages on the mailing lists and c.l.py from
> > confused
> > users when scripts don't run or run, but don't work correctly because
> > parts
> > of the framework are unavailable.
> >
> > ka
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-mac-unsubscribe@lists.wxwindows.org
> > For additional commands, e-mail: wxPython-mac-help@lists.wxwindows.org
> >
> --
> - Jack Jansen <Jack.Jansen@oratrix.com>
> http://www.cwi.nl/~jack -
> - If I can't dance I don't want to be part of your revolution -- Emma
> Goldman -
>
>