[Tutor] [Q] from Python Tkinter programming

Young-Jin Lee ylee12@uiuc.edu
Thu, 1 Nov 2001 13:24:54 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_006F_01C162D8.97E04580
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi, I'm trying to learn Python programming and I ran into an odd =
problem.
I was reading the sample chapter of "Python and Tkinter programming" to =
learn how to use Tkinter in Python.
I downloaded the sample code and tried to run them in IDLE.=20
For some reason, I couldn't run them in IDLE with the following error.

Traceback (innermost last)
  File "c:\yjlee\worx\dissertation\python-related\python and tkinter =
programming\grayson\examples\chapter11\plot.py", line 404, in ?
    graph.draw(graphObject, 'automatic', 'automatic')
  File "c:\yjlee\worx\dissertation\python-related\python and tkinter =
programming\grayson\examples\chapter11\plot.py", line 226, in draw
    xticks =3D self._ticks(xaxis[0], xaxis[1])
  File "c:\yjlee\worx\dissertation\python-related\python and tkinter =
programming\grayson\examples\chapter11\plot.py", line 363, in _ticks
    ticks.append(t, format % (t,))
TypeError: append() takes exactly 1 argument (2 given)

Program disconnected.

The example seems to provide wrong number of argument and I wanted to =
look up the append() method of Python List. But I don't know where I to =
look up. Is there on-line document for all the methods in Python?
According to the error message, the example code was wrong, but it is =
hard to believe. I think a lot of people already read this article and =
if so, it should have been updated a long time ago, shouldn't it?

Thanks.=20

------=_NextPart_000_006F_01C162D8.97E04580
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3315.2870" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi, I'm trying to learn Python =
programming and I=20
ran into an odd problem.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I was reading the sample chapter of =
"Python and=20
Tkinter programming" to learn how to use Tkinter in Python.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I downloaded the sample code and tried =
to run them=20
in IDLE. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>For some reason, I couldn't run them in =
IDLE with=20
the following error.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Traceback (innermost last)<BR>&nbsp; =
File=20
"c:\yjlee\worx\dissertation\python-related\python and tkinter=20
programming\grayson\examples\chapter11\plot.py", line 404, in=20
?<BR>&nbsp;&nbsp;&nbsp; graph.draw(graphObject, 'automatic',=20
'automatic')<BR>&nbsp; File =
"c:\yjlee\worx\dissertation\python-related\python=20
and tkinter programming\grayson\examples\chapter11\plot.py", line 226, =
in=20
draw<BR>&nbsp;&nbsp;&nbsp; xticks =3D self._ticks(xaxis[0], =
xaxis[1])<BR>&nbsp;=20
File "c:\yjlee\worx\dissertation\python-related\python and tkinter=20
programming\grayson\examples\chapter11\plot.py", line 363, in=20
_ticks<BR>&nbsp;&nbsp;&nbsp; ticks.append(t, format % =
(t,))<BR>TypeError:=20
append() takes exactly 1 argument (2 given)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Program disconnected.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The example seems to provide wrong =
number of=20
argument and I wanted to look up the append() method of Python List. But =
I don't=20
know where I to look up. Is there on-line document for all the methods =
in=20
Python?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>According to the error message, the =
example code=20
was wrong, but it is hard to believe. I think a lot of people already =
read this=20
article and if so, it should have been updated a long time ago, =
shouldn't=20
it?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks. </FONT></DIV></BODY></HTML>

------=_NextPart_000_006F_01C162D8.97E04580--