python Program 英文辅导讲解、辅导pyton Program

- 首页 >> Python编程

The Program:

The program is run out of the skel("img_path_to_save.jpg") you will name it skel() and there is 1 argument, which is the name of the final image to be written. The skel() has the user pick 2 colors, the first one is for the background and second is for the pen drawing color. The skel() then has the user pick the 2 images. The skel() then runs three other functions, displays the resulting image to the user, and then writes the image out to disk to the location of the command line argument.

1.First Function: (Typically main() or skel() ) The first function creates an empty picture of a specific size based on the size of one of the images. Then the image is written into with the colored pen in a random fashion 10000 interations. Remember this emptyPicture() is drawn with the 2 colors that the user chose, first one was the background color and the second color chosen was the pen color. The result of this first function is a random scribble drawing of the users color choice whose size is set from the size of one of the images.

2.Second Sub Function: The second function will write one of the images four times into the background drawing in an even symmetrical pattern, with some of the background left showing. (These must be your own images not from the internet). You MAY have your four images in any pattern, as long as there is background showing, and the pictures have some kind of even pattern, or symmetry covering the majority of the canvas.

3.Third Sub Function: Writes the other image into the canvas multiple times in another geometric pattern. Possible patterns: Circular, Square, Rectangle, Triangle etc. As shown in class, you may decide to use a smaller image. You can resize your images in MS paint.

The Files:

Save these three files for your program in your as ~/bin/cis122 subdirectory on shaula.csit.parkland.edu

[your_parkland_username]_proj3.py

[your_parkland_username]_proj3img1.jpg This will be the first image I must select.

[your_parkland_username]_proj3img2.jpg This will be the second image I must select


站长地图