Wenn du in den Weiten des Webs nichts findest, gib doch einfach mal folgendes in die Pythonshell ein:
Code: Alles auswählen
help(tk.Tk().after)
Code: Alles auswählen
help(tk.Tk().after)
Code: Alles auswählen
IDLE 1.2.1
>>> help(tk.Tk().after)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
help(tk.Tk().after)
NameError: name 'tk' is not defined
>>>
Code: Alles auswählen
import Tkinter as tk
Code: Alles auswählen
MainWindow.after(20000, func=new_watch)
MainWindow.after(30000, func=new_specialdonut)
Fast richtig. Das "func=" ist zuviel. Die Signatur der Funktion (...ms, func = None...) sagt Dir nur, dass, wenn keine Funktion angegeben wird, der Parameter mit None belegt wird. Hast Du eine Funktion, gib sie einfach an, ohne das "func = "Saob hat geschrieben:Code: Alles auswählen
MainWindow.after(20000, func=new_watch) MainWindow.after(30000, func=new_specialdonut)
Code: Alles auswählen
def countdown(count):
global Secondsremaining, GameStarted, Speed
while GameStarted == 1 and Secondsremaining > 0:
time.sleep(1)
Secondsremaining=Secondsremaining - 1
TimeLabel["text"]="Time remaining: \n" + str(Secondsremaining) + " Seconds"
if Secondsremaining == 0:
game_over()
Code: Alles auswählen
elif MarioY == WatchY and MarioX == WatchX:
Score=Score + 500
Secondsremaining=Secondsremaining + 10
TotalTime=TotalTime + 10
WatchCount=WatchCount + 1
WatchesCountLabel["text"]="x " + str(WatchCount)
MainWindow.after(20000, new_watch)
verstehe da den fehler net?File "O:\GameCanvasAlt(FastFertig)\Kopie von DunkinDonutsFreak.py", line 387, in move_ghost
move_ghost()
File "O:\GameCanvasAlt(FastFertig)\Kopie von DunkinDonutsFreak.py", line 408, in move_ghost
way6_forwards()
File "O:\GameCanvasAlt(FastFertig)\Kopie von DunkinDonutsFreak.py", line 330, in way6_forwards
move_left(), move_left(), move_up(), move_left(), move_left(), move_left(), move_up(), move_up(), move_up(), move_up()
File "O:\GameCanvasAlt(FastFertig)\Kopie von DunkinDonutsFreak.py", line 269, in move_left
Field.move(Ghost, -1, 0)
File "D:\Python\lib\lib-tk\Tkinter.py", line 2256, in move
self.tk.call((self._w, 'move') + args)
TclError: invalid command name ".23710016.23710456"
Sollte keinen Unterschied machen, da man Funktionen so immer mit Keywort-Argumenten aufrufen kann.arris hat geschrieben:Fast richtig. Das "func=" ist zuviel. Die Signatur der Funktion (...ms, func = None...) sagt Dir nur, dass, wenn keine Funktion angegeben wird, der Parameter mit None belegt wird. Hast Du eine Funktion, gib sie einfach an, ohne das "func = "Saob hat geschrieben:Code: Alles auswählen
MainWindow.after(20000, func=new_watch) MainWindow.after(30000, func=new_specialdonut)
Code: Alles auswählen
elif event.keysym == "g":
Field.delete(Info1, Info2, Info3, Info4, Info5, Info6, Info7, Info8, Info9, Info10, Info11, Info12, Info13, Info14, Info15)
if GameStarted == 0:
GameStarted=1
new_donut()
ghost()
MainWindow.after(1000, countdown)
MainWindow.after(20000, new_watch)
MainWindow.after(30000, new_specialdonut)
Code: Alles auswählen
Traceback (most recent call last):
File "O:/PyOGame(todo)/Client.py", line 4, in <module>
print s.pow(2,3) # Returns 2**3 = 8
File "D:\Python25\lib\xmlrpclib.py", line 1147, in __call__
return self.__send(self.__name, args)
File "D:\Python25\lib\xmlrpclib.py", line 1437, in __request
verbose=self.__verbose
File "D:\Python25\lib\xmlrpclib.py", line 1185, in request
errcode, errmsg, headers = h.getreply()
File "D:\Python25\lib\httplib.py", line 1195, in getreply
response = self._conn.getresponse()
File "D:\Python25\lib\httplib.py", line 924, in getresponse
response.begin()
File "D:\Python25\lib\httplib.py", line 385, in begin
version, status, reason = self._read_status()
File "D:\Python25\lib\httplib.py", line 343, in _read_status
line = self.fp.readline()
File "D:\Python25\lib\socket.py", line 331, in readline
data = recv(1)
error: (10054, 'Connection reset by peer')