Python Tkinter Linux Repair Question/ Python TCP Socket Example

Discussion in 'Python' started by My Python, Jun 15, 2010.

  1. My Python

    My Python Guest

    I got to target my little GUI app that uses TCP sockets in Python
    2.4.4 for Windows and Linux.


    Question 1
    =========
    Given the above, I installed 2.4.4 on Windows 7 and Tkinter import
    works like a charm. (the install is good)

    The Linux (Red Hat 4.1.2-46) though has python preinstalled with ver
    2.4.4, but Tkinter import fails:

    Type "help", "copyright", "credits" or "license" for more information.
    >>> from Tkinter import *

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, in ?
    import _tkinter # If this fails your Python may not be configured
    for Tk
    ImportError: No module named _tkinter
    >>>


    Could someone please explain how to configure python for Tk or
    (reinstall the Tkinter package by itself will be easier and get rid of
    the issue, if so how to install)??

    I tried reinstall the entire python-2.4.4.tar, followed instructions
    (./configure, make, make install) -- this did not fix Tkinter.

    Question 2
    ========
    Can some one post a URL (or a sample module itself) that shows how to
    write basic TCP socket application?
    Any pointers, tutorials, youtube.com links are welcome if they are
    specific.


    Please post responses to this thread only (the e-mail is dummy)

    TIA!!!
    My Python, Jun 15, 2010
    #1
    1. Advertising

  2. On 06/15/2010 11:35 PM, My Python wrote:
    > I got to target my little GUI app that uses TCP sockets in Python
    > 2.4.4 for Windows and Linux.
    >
    >
    > Question 1
    > =========
    > Given the above, I installed 2.4.4 on Windows 7 and Tkinter import
    > works like a charm. (the install is good)
    >
    > The Linux (Red Hat 4.1.2-46) though has python preinstalled with ver
    > 2.4.4, but Tkinter import fails:
    >
    > Type "help", "copyright", "credits" or "license" for more information.
    >>>> from Tkinter import *

    > Traceback (most recent call last):
    > File "<stdin>", line 1, in ?
    > File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, in ?
    > import _tkinter # If this fails your Python may not be configured
    > for Tk
    > ImportError: No module named _tkinter
    >>>>

    >
    > Could someone please explain how to configure python for Tk or
    > (reinstall the Tkinter package by itself will be easier and get rid of
    > the issue, if so how to install)??


    To build from source with Tkinter, you'll need to install Tcl/Tk first.

    Many Linux distributions split up Python, so that the interpreter
    package doesn't depend on Tk and X11 being installed. Debian GNU/Linux
    has a "python-tk" package. I'm sure there is an equivalent package in
    RHEL. You'll just have to find, it, and install.

    -- Thomas

    >
    > I tried reinstall the entire python-2.4.4.tar, followed instructions
    > (./configure, make, make install) -- this did not fix Tkinter.
    >
    > Question 2
    > ========
    > Can some one post a URL (or a sample module itself) that shows how to
    > write basic TCP socket application?


    I believe the stdlin asyncore/asynchat documentation includes some
    example code...

    > Any pointers, tutorials, youtube.com links are welcome if they are
    > specific.
    >
    >
    > Please post responses to this thread only (the e-mail is dummy)
    >
    > TIA!!!
    >
    Thomas Jollans, Jun 15, 2010
    #2
    1. Advertising

  3. On 2010-06-15, My Python <> wrote:

    > Question 2
    >========
    > Can some one post a URL (or a sample module itself) that shows how to
    > write basic TCP socket application?


    http://docs.python.org/library/socket.html#example

    http://docs.python.org/library/asyncore.html

    http://twistedmatrix.com/trac/

    > Any pointers, tutorials, youtube.com links are welcome if they are
    > specific.


    Youtube videos? Seriously? There are youtube videos of programming
    examples? That sounds horrible...

    --
    Grant Edwards grant.b.edwards Yow! I want to mail a
    at bronzed artichoke to
    gmail.com Nicaragua!
    Grant Edwards, Jun 15, 2010
    #3
  4. My Python

    My Python Guest

    1. Could u also quote some URLs for sample GUI programs written using
    Tkinter. I am looking for any aubstantial app that has Canvas, Frame,
    Button, LIstbox widgets, plus File Open/Save for simple text files.

    2. Some good holistic article for positioning widgets on the frame/
    canvas, basic concepts that are explained visually with diagrams.

    TIA
    My Python, Jun 16, 2010
    #4
    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. Donn Cave
    Replies:
    0
    Views:
    420
    Donn Cave
    Apr 30, 2005
  2. Thomas Heller

    What does 'repair Python 2.5a1' do?

    Thomas Heller, Apr 7, 2006, in forum: Python
    Replies:
    1
    Views:
    283
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 8, 2006
  3. Tiger
    Replies:
    5
    Views:
    954
    Dave Thompson
    May 1, 2006
  4. TsanChung
    Replies:
    5
    Views:
    2,731
    Antoninus Twink
    Oct 18, 2008
  5. TsanChung
    Replies:
    3
    Views:
    1,811
    Antoninus Twink
    Oct 18, 2008
Loading...

Share This Page