Movatterモバイル変換


[0]ホーム

URL:


Classes, OOP, Tkinter general comments and detailed questions...

Paul Prescodpaulp at ActiveState.com
Thu Apr 5 20:44:44 EDT 2001


Ron Stephens wrote:>> I love Python. But I am having trouble getting to understand classes> well enough to use them. This is especially a problem because I want to> use Tkinter. I programmed a little in assembler, Basic, PL/1, and> Fortran in college (math and physics majors). Procedural programming> seems logical to me. Programs must follow the logic, and programs thus> can do only one thing. I am appealing for help from the group, seeking> ideas to help me find a way to understand the use of Python classes.I'm not sure if your problem is *really* with OO programming. Have youever created a GUI in a non-OO language? The basic difference betweenordinary programming and GUI programming is that in GUIs, things happenwhen the use decides they happen and your program has to be organized soit is ready for whatever happens. In a procedural program you lay outthe order of things from the start. Even if you program a GUI in (let's say) C or FORTRAN, you need to getused to event-driven programming. That's different from OO. You canfollow the logic in an OO program from top to bottom just as you do aprocedural program. You just need to remember that when you callfoo.bar, the actual "bar" you call will depend on the "foo" you aredealing with.-- Take a recipe. Leave a recipe.  Python Cookbook!http://www.ActiveState.com/pythoncookbook


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp