FAQ
Can a Tkinter GUI be run in Win98 without the useless DOS window? I'm not
sure if I expressed that correctly or clearly, but I am using the Python
script at http://answers.google.com/answers/main?cmd=threadview&id1280 ,
calling it with a shortcut to grepper.py. Grepper works well, but is there
a way to call grepper.py without that useless DOS window opening as well?

Thanks,

Jack Crane

Search Discussions

  • Vincent wehren at Feb 1, 2003 at 11:41 am
    "Jack Crane" <jdcrane at yahoo.com> schrieb im Newsbeitrag
    news:Xns93151D69F34FAjdcrane7yahoocom at 130.133.1.4...
    Can a Tkinter GUI be run in Win98 without the useless DOS window? I'm not
    sure if I expressed that correctly or clearly, but I am using the Python
    script at http://answers.google.com/answers/main?cmd=threadview&id1280 ,
    calling it with a shortcut to grepper.py. Grepper works well, but is there
    a way to call grepper.py without that useless DOS window opening as well?
    Try calling your modules *.pyw instead of *.py.
    HTH
    Vincent Wehren

    (BTW: I wouldn't call the command prompt useless..Once you run your code as
    *.pyw any exceptions that you do not particularly catch and output via a
    Tkinter message box will never surface. So I'd leave the *.pyw suffix alone
    during the entire process of writing/debugging, and rename the when *ready*
    to deploy...)



    Thanks,

    Jack Crane
  • Jack Crane at Feb 1, 2003 at 12:51 pm
    "vincent wehren" <v.wehren at home.nl> wrote in
    news:b1gbar$o6g$1 at news3.tilbu1.nb.home.nl:
    "Jack Crane" <jdcrane at yahoo.com> schrieb im Newsbeitrag
    news:Xns93151D69F34FAjdcrane7yahoocom at 130.133.1.4...
    Can a Tkinter GUI be run in Win98 without the useless DOS window? I'm
    not sure if I expressed that correctly or clearly, but I am using the
    Python script at
    http://answers.google.com/answers/main?cmd=threadview&id1280 ,
    calling it with a shortcut to grepper.py. Grepper works well, but is
    there a way to call grepper.py without that useless DOS window opening
    as well?
    Try calling your modules *.pyw instead of *.py.
    Nope. Still get the DOS window.
    (BTW: I wouldn't call the command prompt useless..Once you run your
    code as *.pyw any exceptions that you do not particularly catch and
    output via a Tkinter message box will never surface. So I'd leave the
    *.pyw suffix alone during the entire process of writing/debugging, and
    rename the when *ready* to deploy...)
    Thanks for this info.

    Jack Crane
    jdcrane7 at yahoo.com
  • Vincent wehren at Feb 1, 2003 at 3:25 pm
    "Jack Crane" <jdcrane7 at yahoo.com> schrieb im Newsbeitrag
    news:Xns9315316F1819Ejdcrane7yahoocom at 130.133.1.4...
    "vincent wehren" <v.wehren at home.nl> wrote in
    news:b1gbar$o6g$1 at news3.tilbu1.nb.home.nl:
    "Jack Crane" <jdcrane at yahoo.com> schrieb im Newsbeitrag
    news:Xns93151D69F34FAjdcrane7yahoocom at 130.133.1.4...
    Can a Tkinter GUI be run in Win98 without the useless DOS window? I'm
    not sure if I expressed that correctly or clearly, but I am using the
    Python script at
    http://answers.google.com/answers/main?cmd=threadview&id1280 ,
    calling it with a shortcut to grepper.py. Grepper works well, but is
    there a way to call grepper.py without that useless DOS window opening
    as well?
    Try calling your modules *.pyw instead of *.py.
    Nope. Still get the DOS window.
    Well, I don't...
    How are you starting the module exactly?

    Vincent Wehren
    (BTW: I wouldn't call the command prompt useless..Once you run your
    code as *.pyw any exceptions that you do not particularly catch and
    output via a Tkinter message box will never surface. So I'd leave the
    *.pyw suffix alone during the entire process of writing/debugging, and
    rename the when *ready* to deploy...)
    Thanks for this info.

    Jack Crane
    jdcrane7 at yahoo.com
  • Jack Crane at Feb 1, 2003 at 5:23 pm
    "vincent wehren" <v.wehren at home.nl> wrote in
    news:b1goh2$b5e$1 at news2.tilbu1.nb.home.nl:
    Try calling your modules *.pyw instead of *.py.
    Nope. Still get the DOS window.
    Well, I don't...
    How are you starting the module exactly?
    Not sure what you mean by "module", but the script is "qs.pyw". I call it
    by clicking on its icon in the Python2.2 folder, or by clicking on a
    shortcut to it.

    If I start it through IDLE by opening the script and then running it, it
    runs with no DOS window, but IDLE then becomes unusable, and also won't
    close in the normal way.

    Did you take a look at grepper.py at
    http://answers.google.com/answers/main?cmd=threadview&id1280 ?

    Jack Crane
  • Vincent wehren at Feb 1, 2003 at 9:25 pm
    "Jack Crane" <jdcrane7 at yahoo.com> schrieb im Newsbeitrag
    news:Xns93155F8399040jdcrane7yahoocom at 130.133.1.4...
    "vincent wehren" <v.wehren at home.nl> wrote in
    news:b1goh2$b5e$1 at news2.tilbu1.nb.home.nl:
    Try calling your modules *.pyw instead of *.py.
    Nope. Still get the DOS window.
    Well, I don't...
    How are you starting the module exactly?
    Not sure what you mean by "module", but the script is "qs.pyw". I call it
    by clicking on its icon in the Python2.2 folder, or by clicking on a
    shortcut to it.

    If I start it through IDLE by opening the script and then running it, it
    runs with no DOS window, but IDLE then becomes unusable, and also won't
    close in the normal way.
    Did you take a look at grepper.py at
    http://answers.google.com/answers/main?cmd=threadview&id1280 ?

    Jack Crane
    That's what I tested...
    No DOS window when you call grepper.py grepper.pyw..
    But now your telling me about a file called qs.pyw..?
    - vwe
    >
  • Jack Crane at Feb 2, 2003 at 4:56 am
    "vincent wehren" <v.wehren at home.nl> wrote in
    news:b1hhm4$jdf$1 at news1.tilbu1.nb.home.nl:
    Did you take a look at grepper.py at
    http://answers.google.com/answers/main?cmd=threadview&id1280 ?

    Jack Crane
    That's what I tested...
    No DOS window when you call grepper.py grepper.pyw..
    But now your telling me about a file called qs.pyw..?
    - vwe
    Sorry. qs.pyw is exactly the same as grepper except that it "greps" a
    different text file, qs.txt. And qs.pyw when executed through IDLE (not how
    I want to use it), also opens with no DOS window, but leaves IDLE unusable
    and uncloseable (hanging?). IOW it's behavior is exactly the same as
    grepper.pyw.

    Thanks for sticking with me. I love Python so far, but Tkinter is giving me
    a lot of trouble. I've tried Tk with Tcl with no problems, but I really
    don't want to abandon Python for creating GUIs.

    Jack Crane
  • John Roth at Feb 2, 2003 at 12:16 pm
    "Jack Crane" <jdcrane7 at yahoo.com> wrote in message
    news:Xns9315D4F58B6D8jdcrane7yahoocom at 130.133.1.4...
    "vincent wehren" <v.wehren at home.nl> wrote in
    news:b1hhm4$jdf$1 at news1.tilbu1.nb.home.nl:
    Did you take a look at grepper.py at
    http://answers.google.com/answers/main?cmd=threadview&id1280 ?

    Jack Crane
    That's what I tested...
    No DOS window when you call grepper.py grepper.pyw..
    But now your telling me about a file called qs.pyw..?
    - vwe
    Sorry. qs.pyw is exactly the same as grepper except that it "greps" a
    different text file, qs.txt. And qs.pyw when executed through IDLE (not how
    I want to use it), also opens with no DOS window, but leaves IDLE unusable
    and uncloseable (hanging?). IOW it's behavior is exactly the same as
    grepper.pyw.

    Thanks for sticking with me. I love Python so far, but Tkinter is giving me
    a lot of trouble. I've tried Tk with Tcl with no problems, but I really
    don't want to abandon Python for creating GUIs.
    Tkinter in Win9x is pretty much unusable. It supposedly works OK
    in the WinNT, Win2000, WinXP series. The problem is exactly what
    you report: anything goes wrong, and it does something wierd to the
    system
    that causes programs to not end, and also causes problems on exit.

    I've never heard of the foobar.pyw suffix not working to suppress
    the DOS window, however. That's what it's supposed to do.

    John Roth

    Jack Crane
  • Lukasz Pankowski at Feb 2, 2003 at 1:50 pm
    hi,

    may be *.pyw files are associated with python.exe (not pythonw.exe)
    the only reasonable reason I can think of.

    --

    =*= Lukasz Pankowski =*=

    t o t f s h i m o f p h t s s w
    h n h i a o s o f o r o o a o i
    e e a r i p t o o p y m s
    t s d e h l b e e e
    t e s a d t
    r b h
    l i
    y n
    g
  • Jack Crane at Feb 2, 2003 at 2:48 pm
    Lukasz Pankowski <lupan at zamek.gda.pl> wrote in
    news:87ptqayepf.fsf at zamek.gda.pl:
    may be *.pyw files are associated with python.exe (not pythonw.exe)
    the only reasonable reason I can think of.
    That was it! I changed the association, and now grepper.pyw and qs.pyw work
    perfectly by clicking on their icons or shortcuts. No DOS window. However,
    given John Roth's warning, I'll be looking out for Tkinter problems in my
    future Python scripts.

    Thanks very much!

    Jack Crane
  • Jack Crane at Feb 2, 2003 at 3:51 pm
    Jack Crane <jdcrane7 at yahoo.com> wrote in
    news:Xns93164541F5027jdcrane7yahoocom at 130.133.1.4:
    Lukasz Pankowski <lupan at zamek.gda.pl> wrote in
    news:87ptqayepf.fsf at zamek.gda.pl:
    may be *.pyw files are associated with python.exe (not pythonw.exe)
    the only reasonable reason I can think of.
    That was it! I changed the association, and now grepper.pyw and qs.pyw
    work perfectly by clicking on their icons or shortcuts. No DOS window.
    However, given John Roth's warning, I'll be looking out for Tkinter
    problems in my future Python scripts.

    Thanks very much!
    Just found this at http://www.python.org/doc/2.2.1/whatsnew/node12.html :

    "Files ending in ".pyw" can now be imported on Windows. ".pyw" is a
    Windows-only thing, used to indicate that a script needs to be run using
    PYTHONW.EXE instead of PYTHON.EXE in order to prevent a DOS console from
    popping up to display the output. This patch makes it possible to import
    such scripts, in case they're also usable as modules. (Implemented by David
    Bolen.)"

    Jack Crane

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 1, '03 at 10:53a
activeFeb 2, '03 at 3:51p
posts11
users5
websitepython.org

People

Translate

site design / logo © 2022 Grokbase