[Tutor] functions to integrate, multiply and divide polynomials,GUI; classes and fcns.

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Sat, 21 Apr 2001 14:41:53 -0700 (PDT)


On Sat, 21 Apr 2001, Julieta wrote:

> How can I write a programm that will build functions to integrate,
> multiply, and divide polynomials, and test these functions?  I am new
> at programming so Python is my first language, therefore whatever

Hello!  How much do you know about programming already?  It sounds like
you're just starting off, so some of the suggestions we can give might not
make much sense for a while.

Also, as we talked about on python-help, because this sounds like a
homework assignment, we cannot help you directly; we can only direct you
toward things that might help you.  Believe us: it's not because we want
to be mean, but because the point of the work is for you to figure out how
the pieces come together.


Have you tried one of the Python tutorials yet?  They're made to help you
learn how effectively use the language.  Many of them are located here:

    http://python.org/doc/Intros.html

and the one that you'll want to look at is Alan Gauld's "Learning To
Program":

    http://www.crosswinds.net/~agauld/

Alan frequents this mailing list, so if the tutorial is confusing, you
have at least one person here who knows what he's talking about.  *grin*


One thing that helps is to try doing a lot of examples of polynomial
multiplication "by hand", and think about what kind of "procedure" you're
running internally in your head.  A lot of programming deals with trying
to capture these ideas into a form that's extraordinarily unambiguous, and
it does take some practice to do this.  This is admittedly hard, so try
simpler problems first, and you'll build up this skill.


> input or help you might offer will be truly appreciated.  Write to
> julieta_rangel@hotmail.com. if you have any suggestions or can help me
> with this.  Also, I'm trying to learn about the Graphical User
> Interface (GUI) and about classes and functions. If someone can
> explain to me how these work, or if someone has a program that makes
> use of all three and won't mind showing it to me, I will appreciate it
> to the tenth.

You might want to look at Useless Python, a web site that collects bits of
Python programs.  If you'd like to see examples of Python programs,
Useless Python is a good resource:

    http://www.lowerstandard.com/python/pythonsource.html


About classes: Alan Gauld's tutorial talks about Object Oriented
Programming (OOP), and you can learn about classes there.  It's a slightly
advanced topic, so I'd recommend putting it on hold until you learn about
how to write functions in Python.


GUI programming is handled by a module called Tkinter, and you can
learn more about Tkinter here:

    http://python.org/topics/tkinter/

However, the material there might be a little dense, so feel free to ask
us questions about how to work with Tkinter.


Good luck to you.