Seite 1 von 1

Linx <>Windows

Verfasst: Mittwoch 14. September 2005, 18:03
von Gast
Hallo !

Kann mir mal bitte einer sagen, warum sich dieser Code unter Windows sich Problemlos ausführen lässt und unter Linux nicht.

Code: Alles auswählen

#!/usr/bin/python


from Tkinter import  Tk, PhotoImage, Label
from random import randrange

usingIDLE = 1

def zufallspixel():
	while running:
		for i in range(20):
			pixel = (randrange(300), randrange(300))
			bild.put('black',pixel)
		root.update()
		
def start(event):
	global running
	running=1
	zufallspixel()
	
def stop(event):
	global running
	running=0
	
root=Tk()
bild=PhotoImage(width=300, height=300)
anzeige=Label(root, image=bild, bg='white')
anzeige.pack()
root.bind('<Button-1>',start) #Maustaste Links
root.bind('<Button-3>',stop) #Maustaste Rechts
if not usingIDLE:
	root.mainloop()
WinXP Profi Editor Standart
Linux Ubuntu Editor Scite

schonmal Dank.

Python Fan

Verfasst: Mittwoch 14. September 2005, 18:19
von rayo
Hi

Und wo ist die Fehlermeldung?

Gruss

Verfasst: Mittwoch 14. September 2005, 18:33
von Python Fan
Hallo,

sorry wegen Doppel Post daoben war nicht meine absicht.

Naja wie soll ich sagen - wie gesagt unter Win geht ohne Probleme unter Linux nicht. Unter linux bekomme ich auch überhaupt garkeine fehlermeldung das ist ja das komische daran.

Gruss
Python Fan

Verfasst: Mittwoch 14. September 2005, 18:35
von Leonidas
Versuche mal IDLE über Bord zu werfen (sowohl unter Windows als auch unter Linux).

Zum Topic:

Code: Alles auswählen

>>> #Linx soll wohl Linux heißen, nehme ich an
>>> #Windows <> Linux
>>> #ist gleichbedeutend mit 
>>> #Windows != Linux
>>> #und da 
>>> Windows = 'comercial' 
>>> #und
>>> Linux = 'freesoftware'
>>> #ist nun
>>> Linux != Windows
True
>>> #alles klar!

Verfasst: Mittwoch 14. September 2005, 18:40
von Python Fan
>>> Linx soll wohl Linux heißen, nehme ich an
>>> #Windows <> Linux
>>> #ist gleichbedeutend mit
>>> #Windows != Linux
>>> #und da
>>> Windows = 'comercial'
>>> #und
>>> Linux = 'freesoftware'
>>> #ist nun
>>> Linux != Windows
True
:) hast wohl recht und ja Linx soll Linux heissen.