• 大小: 36KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: Python
  • 标签: 黑白棋  python  

资源简介

同学大一时候的作业,感觉很不错就是算起来有点慢

资源截图

代码片段和文件信息

# graphics.py
“““Simple object oriented graphics library  

The library is designed to make it very easy for novice programmers to
experiment with computer graphics in an object oriented fashion. It is
written by John Zelle for use with the book “Python Programming: An
Introduction to Computer Science“ (Franklin Beedle & Associates).

LICENSE: This is open-source software released under the terms of the
GPL (http://www.gnu.org/licenses/gpl.html).

PLATFORMS: The package is a wrapper around Tkinter and should run on
any platform where Tkinter is available.

INSTALLATION: Put this file somewhere where Python can see it.

OVERVIEW: There are two kinds of objects in the library. The GraphWin
class implements a window where drawing can be done and various
Graphicsobjects are provided that can be drawn into a GraphWin. As a
simple example here is a complete program to draw a circle of radius
10 centered in a 100x100 window:

--------------------------------------------------------------------
from graphics import *

def main():
    win = GraphWin(“My Circle“ 100 100)
    c = Circle(Point(5050) 10)
    c.draw(win)
    win.getMouse() # Pause to view result
    win.close()    # Close window when done

main()
--------------------------------------------------------------------
GraphWin objects support coordinate transformation through the
setCoords method and pointer-based input through getMouse.

The library provides the following graphical objects:
    Point
    Line
    Circle
    Oval
    Rectangle
    Polygon
    Text
    Entry (for text-based input)
    Image

Various attributes of graphical objects can be set such as
outline-color fill-color and line-width. Graphical objects also
support moving and hiding for animation effects.

The library also provides a very simple class for pixel-based image
manipulation Pixmap. A pixmap can be loaded from a file and displayed
using an Image object. Both getPixel and setPixel methods are provided
for manipulating the image.

DOCUMENTATION: For complete documentation see Chapter 4 of “Python
Programming: An Introduction to Computer Science“ by John Zelle
published by Franklin Beedle & Associates.  Also see
http://mcsp.wartburg.edu/zelle/python for a quick reference“““

# Version 4.1 12/29/2009
#     * Merged Pixmap and Image class. Old Pixmap removed use Image.
# Version 4.0.1 10/08/2009
#     * Modified the autoflush on GraphWin to default to True
#     * Autoflush check on close setBackground
#     * Fixed getMouse to flush pending clicks at entry
# Version 4.0 08/2009
#     * Reverted to non-threaded version. The advantages (robustness
#         efficiency ability to use with other Tk code etc.) outweigh
#         the disadvantage that interactive use with IDLE is slightly more
#         cumbersome.
#     * Modified to run in either Python 2.x or 3.x (same file).
#     * Added Image.getPixmap()
#     * Added update() -- stand alone function to cause any pending
#           graphics changes to d

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      27685  2010-11-12 17:11  1\graphics.py

     文件      35394  2011-05-17 12:38  1\graphics.pyc

     文件      10583  2011-05-22 21:03  1\Othello.py

     文件      13083  2010-12-18 15:04  1\Othello.pyc

     文件      43520  2010-12-27 12:32  1\文档.doc

     目录          0  2011-06-09 15:01  1

----------- ---------  ---------- -----  ----

               130265                    6


评论

共有 条评论