Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:47:27+00:00 2026-06-18T06:47:27+00:00

Being new to both Python and urwid I was trying out the tutorial examples

  • 0

Being new to both Python and urwid I was trying out the tutorial examples here http://excess.org/urwid/docs/tutorial/

However while the first ones do work fine, most of the later ones do not seem to work. For instance, trying to run this particular one:

import urwid

choices = u'Chapman Cleese Gilliam Idle Jones Palin'.split()

def menu(title, choices):
    body = [urwid.Text(title), urwid.Divider()]
    for c in choices:
        button = urwid.Button(c)
        urwid.connect_signal(button, 'click', item_chosen, c)
        body.append(urwid.AttrMap(button, None, focus_map='reversed'))
    return urwid.ListBox(urwid.SimpleFocusListWalker(body))

def item_chosen(button, choice):
    response = urwid.Text([u'You chose ', choice, u'\n'])
    done = urwid.Button(u'Ok')
    urwid.connect_signal(done, 'click', exit_program)
    main.original_widget = urwid.Filler(urwid.Pile([response,
        urwid.AttrMap(done, None, focus_map='reversed')]))

def exit_program(button):
    raise urwid.ExitMainLoop()

main = urwid.Padding(menu(u'Pythons', choices), left=2, right=2)
top = urwid.Overlay(main, urwid.SolidFill(u'\N{MEDIUM SHADE}'),
    align='center', width=('relative', 60),
    valign='middle', height=('relative', 60),
    min_width=20, min_height=9)
urwid.MainLoop(top, palette=[('reversed', 'standout', '')]).run()

Presents me with the following error:

Traceback (most recent call last):
  File "example.py", line 23, in <module>
    main = urwid.Padding(menu(u'Pythons', choices), left=2, right=2)
  File "example.py", line 11, in menu
    return urwid.ListBox(urwid.SimpleFocusListWalker(body))
AttributeError: 'module' object has no attribute 'SimpleFocusListWalker'

Am I doing something wrong?
If it helps in any way I’m running Ubuntu 12.10 64bit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:47:29+00:00Added an answer on June 18, 2026 at 6:47 am

    I figured it out, I’m answering this myself just in case someone runs into the same problem.

    The root of this problem is that the tutorial examples use calls not present on earlier versions of urwid, like the one available on the Ubuntu repositories. Installing from source solves the problem.

    If you run into problems installing from source, make sure you have the python-dev package installed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to both python and Aptana. I am trying to use the
Im trying to get crossroads.js working with require.js, being new to both projects. Crossroads
Being new to both WPF and MVVM, I'm studying Josh Smith's article on the
Being new to both .NET and Silverlight, I have noticed that many of the
I'm trying to write an ajax slider of sorts. Of course being new to
I'm relatively new to python and scipy, being a convert from MATLAB. I was
I'm learning JavaScript right now, quite a task being new to both the syntax
I'm trying to create new GTK Notebook tabs that contain both a name (as
I am trying to create an addon with the new addons builder preview (https://builder.addons.mozilla.org/),
Being new to c#, I don't understand how variables are passed between objects. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.