[Tutor] Two questions on MS-DOS

Kalle Svensson kalle@gnupung.net
Sat, 13 Jan 2001 02:02:00 +0100

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sez Fabrizio:
> 1 - How can I keep my DOS shell from closing automatically upon the end o=
f a
> Python scipt ? (It does not give time to read the parser exceptions and
> errors messages !)

Oh, I wish I knew...  The best I've come up with is either run the program
from a DOS window you've opened "manually", or put a line like

raw_input("Press enter...")

at the end of your program.  Both are bad, but I don't know a better way.

> 2 - How can I keep the DOS shell from opening up upon the start of a Pyth=
> script ? (I need this when using TKInter, and I do not want to see the DOS
> window under TKInter's).

Rename the file with a .pyw extension.  .pyw's use pythonw.exe to launch,
which is the same as python.exe but without the DOS window.

Email: kalle@gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org