| | |
Python! Thoughts?
Thread Solved |
•
•
Join Date: Jul 2004
Posts: 11
Reputation:
Solved Threads: 1
•
•
•
•
i didn't know that. are you sure??••••Originally Posted by alc6379you can make binary [Python] executables and distribute them, so people who don't have a Python installation to run a program written in it.
I know of at leaset 2 tools which can accomplish this:
1. http://www.py2exe.org/
2. http://pyinstaller.python-hosting.com/
There should be a couple more.
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 1
I'M CURRENTLY LEARNING PYTHON AND I THINK THAT IT IS COOL,I HAVE BEEN ATTEMPTING TO WRITE A PROGRAM FOR A GAME CALLED "NINE MEN'S MORRIS" BUT I RAN OUT OF CREATIVE JUICE AND I AM STRUGGLING TO GO ON, SO FAR I HAVE ONLY BEEN ABLE TO DESIGN THE BOARD AND THE MEN ALSO TEXT THAT HELP WITH STARTING THE GAME,I HAVE THE CODE BELLOW AND IF YOU CAN,PLEASE HELP TO COMPLETE THE PROGRAM.
THIS IS THE PROGRAM SO FAR:
THIS IS THE PROGRAM SO FAR:
python Syntax (Toggle Plain Text)
from graphics import * win =GraphWin("Nine Men's Morris" , 1100,1000) b1 = Circle(Point(900,100), 15) b1.setFill("blue") b1.draw(win) b2 = Circle(Point(900,200), 15) b2.setFill("blue") b2.draw(win) b3 = Circle(Point(900,300), 15) b3.setFill("blue") b3.draw(win) w1 = Circle(Point(50,100), 15) w1.setFill("black") w1.draw(win) w2 = Circle(Point(50,200), 15) w2.setFill("black") w2.draw(win) b4 = Circle(Point(900,400), 15) b4.setFill("blue") b4.draw(win) b5 = Circle(Point(900,500), 15) b5.setFill("blue") b5.draw(win) b6 = Circle(Point(900,600), 15) b6.setFill("blue") b6.draw(win) b7 = Circle(Point(900,700), 15) b7.setFill("blue") b7.draw(win) b8 = Circle(Point(900,800), 15) b8.setFill("blue") b8.draw(win) w3 = Circle(Point(50,300), 15) w3.setFill("black") w3.draw(win) b9 = Circle(Point(900,900), 15) b9.setFill("blue") b9.draw(win) w4 = Circle(Point(50,400), 15) w4.setFill("black") w4.draw(win) w5 = Circle(Point(50,500), 15) w5.setFill("black") w5.draw(win) w6 = Circle(Point(50,600), 15) w6.setFill("black") w6.draw(win) w7 = Circle(Point(50,700), 15) w7.setFill("black") w7.draw(win) w8 = Circle(Point(50,800), 15) w8.setFill("black") w8.draw(win) w9 = Circle(Point(50,900), 15) w9.setFill("black") w9.draw(win) a_rectange= Rectangle(Point(100,100), Point(800,800)) a_rectange.draw(win) a_rectange.setOutline("cyan") w1 = Circle(Point(50,100), 15) w1.move(100,15) w1.draw(win) a_rectange= Rectangle(Point(380,380), Point(520,520)) a_rectange.draw(win) a_rectange.setFill("black") a_rectange= Rectangle(Point(100,100), Point(800,800)) a_rectange.draw(win) a_rectange.setFill("white") a_rectange= Rectangle(Point(380,380), Point(520,520)) a_rectange.draw(win) a_rectange= Rectangle(Point(100,100), Point(800,800)) a_rectange.draw(win) a_rectange= Rectangle(Point(250,250), Point(650,650)) a_rectange.draw(win) Line(Point(100,450),Point(380,450)).draw(win) Line(Point(520,450),Point(800,450)).draw(win) Line(Point(450,100),Point(450,380)).draw(win) Line(Point(450,520),Point(450,800)).draw(win) Text(Point(900,100), "b1").draw(win) Text(Point(550,50), " click a MAN you wana move").draw(win) shape_pos =win.getMouse() if shape_pos.getY() <100: Text(Point(550,75),"you selected b1").draw(win) elif shape_pos.getY() <200 and shape_pos.getX() <900: Text(Point(550,75),"you selected b2").draw(win) elif shape_pos.getY() <300 and shape_pos.getX() <900: Text(Point(550,75),"you selected b3").draw(win) elif shape_pos.getY() <400 and shape_pos.getX() <900: Text(Point(550,75),"you selected b4").draw(win) elif shape_pos.getY() <500 and shape_pos.getX() <900: Text(Point(550,75),"you selected b5").draw(win) elif shape_pos.getY() <600 and shape_pos.getX() <900: Text(Point(550,75),"you selected b6").draw(win) elif shape_pos.getY() <700 and shape_pos.getX() <900: Text(Point(550,75),"you selected b7").draw(win) elif shape_pos.getY() <800 and shape_pos.getX() <900: Text(Point(550,75),"you selected b8").draw(win) elif shape_pos.getY() <900 and shape_pos.getX() <900: Text(Point(550,75),"you selected b9").draw(win) win.getMouse() win.close() win.setBackground("green") AND I THINK THE PROGRAM FOR MOVING SHOULD BE SOMETHING LIKE THIS: curcow=getmouse(win) next pos=getmouse(win) i=0 while player1[i]!=curcow: i+=1 nx=nextpos.getx() ny=nextpos.gety() cp=player1[i].counter() cx=cp.getx() cy=cp.gety() dx=cx-nx dy=cy-ny
Last edited by cscgal; Sep 9th, 2008 at 3:49 pm. Reason: Added code tags
What a poor example of Python, violates all the Zen! There is an outcry for loops and functions.
python Syntax (Toggle Plain Text)
import this
Never argue with idiots, they'll just bring you down to their level and beat you with their experience.
![]() |
Other Threads in the Python Forum
- Previous Thread: wxWidget layers
- Next Thread: reading ascii value fails
| Thread Tools | Search this Thread |
abrupt alarm ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib






