View Full Version : Run *py program on xbox?
skaterdomi
2004-12-17, 22:19
i´m now able to write little programs with python.
what should i do, if i would like to run this programs in the xbmc?
(i hope that somebody can help me, because my english is very bad! if there are some "german-launguage-people" in here, pleas write in german!)
skaterdomi
2004-12-17, 22:22
here is the little program, which i want to get run on the xbox!
(the "print"-orders are in german)
from turtle import *
from random import randrange
def quadrat():
* *for i in range(4):
* * * *forward(80)
* * * *left(90)
def dreieck():
* *for i in range(3):
* * * *forward(80)
* * * *left(120)
def rechteck():
* *for i in range(2):
* * * *forward(100)
* * * *left(90)
* * * *forward(40)
* * * *left(90)
def muster():
* *for i in range(9):
* * * *forward(randrange(10,100))
* * * *left(randrange(10,100))
def achteck():
* *for i in range(8):
* * * *forward(50)
* * * *left(45)
def farbe():
* *print "in welcher farbe möchtest du zeichnen?"
* *print "für blau gib 1 ein."
* *print "für rot gib 2 ein."
* *print "für grün gib 3 ein."
* *print "für gelb gib 4 ein."
def dicke():
* *print "mit welcher dicke möchtest du malen?"
* *print "für dünn gib 1 ein."
* *print "für dick gib 2 ein."
* *print "für sehr dick gib 3 ein."
def geschwindigkeit():
* *print "wie schnell möchtest du malen?"
* *print "für langsam gib 1 ein."
* *print "für schnell gib 2 ein."
def form():
* *print "was möchtest du zeichnen?"
* *print "für ein quadrat gib 1 ein."
* *print "für ein dreieck gib 2 ein."
* *print "für ein rechteck gib 3 ein."
* *print "für ein seltsames muster gib 4 ein."
* *print "für ein achteck gib 5 ein."
* *
print "das ist mein kleines zeichenprogramm!!!"
print "---------------------------------------"
print "---------------------------------------\n"
user = raw_input("wie heisst du?\n")
print "hallo %s!" %user
print ""
frage1 = raw_input("willst du etwas zeichnen? ja/nein?\n")
print ""
def spiel():
* *if frage1 != "ja":
* * * *print "ok!\nauf wiedersehen!"
* *if frage1 == "ja":
* * * *farbe()
* * * *frage2 = raw_input()
* * * *if frage2 == "1":
* * * * * *color("blue")
* * * * * *print "du hast die farbe blau gewählt.\n"
* * * *if frage2 == "2":
* * * * * *color("red")
* * * * * *print "du hast die farbe rot gewählt.\n"
* * * *if frage2 == "3":
* * * * * *color("green")
* * * * * *print "du hast die farbe grün gewählt.\n"
* * * *if frage2 == "4":
* * * * * *color("yellow")
* * * * * *print "du hast die farbe gelb gewählt.\n"
* *if frage1 == "ja":
* * * *dicke()
* * * *frage3 = raw_input()
* * * *if frage3 == "1":
* * * * * *width(5)
* * * * * *print "du hast die dicke dünn gewählt.\n"
* * * *if frage3 == "2":
* * * * * *width(10)
* * * * * *print "du hast die dicke dick gewählt.\n"
* * * *if frage3 == "3":
* * * * * *width(30)
* * * * * *print "du hast die dicke sehr dick gewählt.\n"
* *if frage1 == "ja":
* * * *geschwindigkeit()
* * * *frage5 = raw_input()
* * * *if frage5 == "2":
* * * * * *tracer(0)
* * * * * *print "du möchtest schnell zeichnen.\n"
* * * *if frage5 == "1":
* * * * * *tracer(1)
* * * * * *print "du möchtest langsam zeichen.\n"
* *if frage1 == "ja":
* * * *form()
* * * *frage4 = raw_input()
* * * *if frage4 == "1":
* * * * * *quadrat()
* * * * * *print "das ist aber ein schönes quadrat, %s.\n" %user
* * * *if frage4 == "2":
* * * * * *dreieck()
* * * * * *print "das ist aber ein schönes dreieck, %s.\n" %user
* * * *if frage4 == "3":
* * * * * *rechteck()
* * * * * *print "das ist aber ein schönes rechteck, %s.\n" %user
* * * *if frage4 == "4":
* * * * * *muster()
* * * * * *print "das ist aber ein schönes muster, %s.\n" %user
* * * *if frage4 == "5":
* * * * * *achteck()
* * * * * *print "das ist aber ein schönes achteck,%s.\n" %user
* *if frage1 == "ja":
* * * *print "möchtest du deine bisherige zeichnung löschen? ja/nein?"
* * * *frage7 = raw_input()
* * * *if frage7 == "ja":
* * * * * *reset()
* * * * * *print "die zeichnung wurde gelöscht."
* *if frage1 == "ja":
* * * *print "möchtest du noch etwas zeichnen? ja/nein?"
* * * *frage6 = raw_input()
* * * *if frage6 == "ja":
* * * * * *spiel()
* * * *if frage6 != "ja":
* * * * * *print "ok!\nauf wiedersehen."
* * * * * *
spiel()
skaterdomi
2004-12-17, 22:39
here i wrote the same program in english!!!!
dont forget:::::its my first program
from turtle import *
from random import randrange
def quadrat():
* *for i in range(4):
* * * *forward(80)
* * * *left(90)
def dreieck():
* *for i in range(3):
* * * *forward(80)
* * * *left(120)
def rechteck():
* *for i in range(2):
* * * *forward(100)
* * * *left(90)
* * * *forward(40)
* * * *left(90)
def muster():
* *for i in range(9):
* * * *forward(randrange(10,100))
* * * *left(randrange(10,100))
def achteck():
* *for i in range(8):
* * * *forward(50)
* * * *left(45)
def farbe():
* *print "in which color do you want to paint?"
* *print "for blue press 1."
* *print "for red press 2."
* *print "for green press 3."
* *print "for yellow press 4."
def dicke():
* *print "how fat do you want to paint?"
* *print "for thin press 1."
* *print "for fat press 2."
* *print "for extremly fat press 3."
def geschwindigkeit():
* *print "how fast do you want to paint?"
* *print "for slow press 1."
* *print "for fast press 2."
def form():
* *print "what do you want to paint?"
* *print "for a quadrat press 1."
* *print "for a triangle press 2."
* *print "for a rectangle press 3."
* *print "for a strange archetype press 4."
* *print "for a octagon press 5."
* *
print "this is my little painting-program!!!"
print "---------------------------------------"
print "---------------------------------------\n"
user = raw_input("what´s your name?\n")
print "hello %s!" %user
print ""
frage1 = raw_input("do you want to paint something? yes/no?\n")
print ""
def spiel():
* *if frage1 != "yes":
* * * *print "ok!\ngood bye!"
* *if frage1 == "yes":
* * * *farbe()
* * * *frage2 = raw_input()
* * * *if frage2 == "1":
* * * * * *color("blue")
* * * * * *print "you chose the color blue.\n"
* * * *if frage2 == "2":
* * * * * *color("red")
* * * * * *print "you chose the color red.\n"
* * * *if frage2 == "3":
* * * * * *color("green")
* * * * * *print "you chose the color green.\n"
* * * *if frage2 == "4":
* * * * * *color("yellow")
* * * * * *print "you chose the color yellow.\n"
* *if frage1 == "yes":
* * * *dicke()
* * * *frage3 = raw_input()
* * * *if frage3 == "1":
* * * * * *width(5)
* * * * * *print "you chose thin.\n"
* * * *if frage3 == "2":
* * * * * *width(10)
* * * * * *print "you chose fat.\n"
* * * *if frage3 == "3":
* * * * * *width(30)
* * * * * *print "you chose extremly fat.\n"
* *if frage1 == "yes":
* * * *geschwindigkeit()
* * * *frage5 = raw_input()
* * * *if frage5 == "2":
* * * * * *tracer(0)
* * * * * *print "you chose to paint fast.\n"
* * * *if frage5 == "1":
* * * * * *tracer(1)
* * * * * *print "you chose to paint slow.\n"
* *if frage1 == "yes":
* * * *form()
* * * *frage4 = raw_input()
* * * *if frage4 == "1":
* * * * * *quadrat()
* * * * * *print "that´s a beautiful quadrat, %s.\n" %user
* * * *if frage4 == "2":
* * * * * *dreieck()
* * * * * *print "that´s a beautiful triangle, %s.\n" %user
* * * *if frage4 == "3":
* * * * * *rechteck()
* * * * * *print "that´s a beautiful rectangle, %s.\n" %user
* * * *if frage4 == "4":
* * * * * *muster()
* * * * * *print "that´s a beautiful archetype, %s.\n" %user
* * * *if frage4 == "5":
* * * * * *achteck()
* * * * * *print "that´s a beautiful octagon,%s.\n" %user
* *if frage1 == "yes":
* * * *print "do you want to delete your picture? yes/no?"
* * * *frage7 = raw_input()
* * * *if frage7 == "yes":
* * * * * *reset()
* * * * * *print "the picture has been deleted."
* *if frage1 == "yes":
* * * *print "do you want to paint more? yes/no?"
* * * *frage6 = raw_input()
* * * *if frage6 == "yes":
* * * * * *spiel()
* * * *if frage6 != "yes":
* * * * * *print "ok!\ngood bye."
* * * * * *
spiel()
solexalex
2004-12-17, 23:53
don't think 'turtle' library is ported to xbox...
to know if it is :
import turtle
print dir(turtle)
then go and watch in the debug window (white button on the pad after running the script)