Question

This is my best attempt at a multienterbox with Easygui and Python. Would someone please give me a working example?

import easgui

(fieldNames= ['Year','Month','Day','Time Hour','Time Minute', 'AM or PM'])
log = easygui.multenterbox(msg='Fill in the blanks',title='log', fieldNames)

I am running Python 2.5 on OS X 10.6

Was it helpful?

Solution

  1. There are parentheses around your first line - this isn't allowed.
  2. You've haven't used the keyword syntax for your third argument, but you use if for the first two.

Either

log = easygui.multenterbox(msg='Fill in the blanks',title='log', fieldnames=fieldNames)

or

log = easygui.multenterbox('Fill in the blanks', 'log', fieldNames)

would work.

It looks like it'd be useful for you to try typing these commands in an interpreter (open a terminal (search for "Terminal" with spotlight) then type the lines one by one, and look for error you get, or in a terminal type "python yourscript.py" so you can see the error messages. Each of these problems has a helpful error message describing the problem, once you get used to reading these you can debug your own scripts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top