running gui py script

Discussion in 'Python' started by Verde Denim, Dec 26, 2012.

  1. Verde Denim

    Verde Denim Guest

    I'm learning py in this environment -
    PyCrust 0.9.5 - The Flakiest Python Shell
    Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
    [GCC 4.4.5] on linux2

    When I type a tkinter program in pycrust (or pyshell), it executes as
    expected, but when I call it from a command line, it doesn't. What I'm
    getting back is this -

    python my_first_gui_in_py.py
    Traceback (most recent call last):
    File "my_first_gui_in_py.py", line 2, in <module>
    class myapp_tk(Tkinter.Tk):
    File "my_first_gui_in_py.py", line 14, in myapp_tk
    app = myapp_tk(None)
    NameError: name 'myapp_tk' is not defined

    Trying to call the file in pycrust doesn't seem to work for me either.
    If I invoke pycrust either as
    $ pycrust ./my_first_gui_in_py.py or
    $ pycrust < ./my_first_gui_in_py.py

    the editor opens, but with an empty buffer.

    What is it that I'm not understanding?

    Thanks, as always for the help.
    Verde Denim, Dec 26, 2012
    #1
    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. Benjamin Rutt
    Replies:
    2
    Views:
    915
    Peter Hansen
    Dec 20, 2005
  2. Replies:
    2
    Views:
    134
    Sean O'Halpin
    Dec 17, 2008
  3. Replies:
    4
    Views:
    175
    Josef Moellers
    Oct 27, 2007
  4. Replies:
    4
    Views:
    285
    ccc31807
    Jul 29, 2011
  5. Dave Angel

    Re: running gui py script

    Dave Angel, Dec 26, 2012, in forum: Python
    Replies:
    0
    Views:
    162
    Dave Angel
    Dec 26, 2012
Loading...

Share This Page