[issue4832] idle filename extension

2009-05-13 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Trying to patch the latest revision 72608 and it didnt work, here on winxp. 

C:\prg\Python30\Lib\idlelibsvn update
Restored 'IOBinding.py'
At revision 72608.

C:\prg\Python30\Lib\idlelibpatch IOBinding.py defaultextension.patch
--verbose
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--
|Index: Lib/idlelib/IOBinding.py
|===
|--- Lib/idlelib/IOBinding.py   (revision 72282)
|+++ Lib/idlelib/IOBinding.py   (working copy)
--
Patching file IOBinding.py using Plan A...
Hunk #1 succeeded at 480 (offset -45 lines).
Hmm...  Ignoring the trailing garbage.
done


If I do the patch by hand, it works. All files are saved with ext. .py.
When set 'defaultextension = ', it is save well too, but then IDLE
crashed immediately.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4832
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



patch

2009-01-06 Thread Pavel Kosina

sorry, pls forget ...

--
geon
Pavel Kosina
--
http://mail.python.org/mailman/listinfo/python-list


[issue4832] idle filename extension

2009-01-04 Thread Pavel Kosina

New submission from Pavel Kosina g...@post.cz:

There should not be necessity to write filename *with extension* at the
saving dialog. It should be enough, at least on Windows, to put there
just hello and get hello.py. It is really complication especially
for beginners. If they, as they are used to from another programs, put
there just hello, it is saved without extension .py what have 2
result: they cannot see any icons at that file and they are not able to
run in, cause python.exe is bind with .py.

Hoping its not duplicate I haven't found anything like this here.

--
components: IDLE
messages: 79062
nosy: geon
severity: normal
status: open
title: idle filename extension
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4832
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-04 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

With this file  - hello.py (attached) - I should be also asked for
converting to utf8. When I open it, nothing changes, after making
changes and saving then the encodings is my windows standard cp1250 

Added file: http://bugs.python.org/file12582/hello.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



patch

2009-01-03 Thread Pavel Kosina
Týká se to Pythonu okrajově, přesto to dávám sem. Myslím, že by se mohlo 
hodit i ostatním, kdo chtějí zkoušet pod Windows nové věci z development 
verze:


Jak opatchovat (pythonýrský) soubor pod Windows? Co jsem udělal:

1/ stáhl jsem http://gnuwin32.sourceforge.net/packages/patch.htm
2/ nainstaloval pod amin, přidal cestu do ..bin .. do PATH
3/ stáhl http://bugs.python.org/file12561/conv.diff a uložil do Lib/idlelib
4/ cmd: patch  conf.diff hází chybu:

C:\prg\Python30\Lib\idlelibpatch  conv.diff
patching file IOBinding.py
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual 
way.

Please contact the application's support team for more information.

Patchuje někdo tady pod Windows? Díky


--
geon
Pavel Kosina

--
http://mail.python.org/mailman/listinfo/python-list


[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

You can open script made in python 2.x and it stops immediately working
after saving, if it is coding-aware. You can have bigger project and use
idle for editing config and text files from this project too. It is
unfair to change without notification the encodings. Or do you
consider IDLE just for beginners for learning?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

I forgot about Perhaps IDLE should offer to convert it on opening.
That would be nice, too.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Sorry, where is the patch?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

OK, I got it. 

In my opinion it would nice if user can either convert file to utf8 or
to do nothing and add new encodings declaration or cancel. Current
Cancel gives an Decoding error. If you give an encodings that doesn't
exist, it shouldn't  destroy IDLE. Hoping its not my mistake, cause I do
not have all files from 3.1a  - just those from idlelib.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

seems to be working.

Seems to me now I get it. The file encoding is ruled by the encoding
declaration. When I stated 

# -*- coding: cp1250 -*-

then the file would be saved in cp1250. 

Now hoping that I would keep this issue, cause it comes with this
patches: when I open file *with* say # -*- coding: cp1250 -*-, I am
asked to change to utf8. This behaviour was not before and is probably
unwanted.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Well, thanks a lot. 

(aware this is really off this issue): Now I even get the system of
patches  - issue 4008 solved the inconvenience in print Unicode signs
inside IDLE. Still not sure how works patches for Python versions. I
vote for including this a that patch about IDLE even in some 3.0.1, not
only in branch 3.1. In non-English speaking countries troubles with
encodings are more common, more beginners-frustrating than you can believe.

HNY 2009
Pavel Kosina

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4823] idle height and place

2009-01-03 Thread Pavel Kosina

New submission from Pavel Kosina g...@post.cz:

Nearly always (after opening) is IDLE window outside visible area.
Mainly the status bar is hidden under bottom windows menu bar. Same
situation happens when choosing Window-Zoom Height from IDLE menu.

xpsp3, 1024x768, py2.x-3.x

--
components: IDLE
messages: 78983
nosy: geon
severity: normal
status: open
title: idle height and place
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4823
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4823] idle height and place

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

sorry it is duplicate to issue 3286
pls close

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4823
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3286] IDLE opens window too low on Windows

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

+1

--
nosy: +geon
versions: +Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3286
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

I might have another problem with this patch and maybe also that one in
issue 4008. Having a file with

print (ěščřžýáíé)
# saved in cp1250

Open - confirm converting to utf8 - F5 - error: see attached file
idleunicode1.jpg

Added file: http://bugs.python.org/file12576/idleunicode1.jpg

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Martin v. Löwis napsal(a), dne 3.1.2009 22:24:
 I can't reproduce the problem. Can you please attach the
 exact file that failed to work?
   

You can use that one that is already here: cp1250.py. It is the same 
error with me.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Microsoft Windows XP [Verze 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\prg\Python30\Lib\idlelibsvn update# from 
http://svn.python.org/projects/python/branches/py3k/Lib/idlelib
Restored 'AutoCompleteWindow.py'
Restored 'ToolTip.py'
Restored 'UndoDelegator.py'
Restored 'Bindings.py'
Restored '__init__.py'
Restored 'AutoComplete.py'
Restored 'configHandler.py'
Restored 'HyperParser.py'
Restored 'ColorDelegator.py'
Restored 'Delegator.py'
Restored 'ObjectBrowser.py'
Restored 'testcode.py'
Restored 'configSectionNameDialog.py'
Restored 'ZoomHeight.py'
Restored 'PyShell.py'
Restored 'ParenMatch.py'
Restored 'config-keys.def'
Restored 'Debugger.py'
Restored 'CREDITS.txt'
Restored 'configDialog.py'
Restored 'StackViewer.py'
Restored 'HISTORY.txt'
Restored 'SearchEngine.py'
Restored 'ReplaceDialog.py'
Restored 'ScriptBinding.py'
Restored 'ChangeLog'
Restored 'tabbedpages.py'
Restored 'keybindingDialog.py'
Restored 'configHelpSourceEdit.py'
Restored 'WidgetRedirector.py'
Restored 'GrepDialog.py'
Restored 'FormatParagraph.py'
Restored 'EditorWindow.py'
Restored 'help.txt'
Restored 'config-highlight.def'
Restored 'PyParse.py'
Restored 'README.txt'
Restored 'rpc.py'
Restored 'OutputWindow.py'
Restored 'aboutDialog.py'
Restored 'idle.bat'
Restored 'TODO.txt'
Restored 'config-main.def'
Restored 'IdleHistory.py'
Restored 'PathBrowser.py'
Restored 'IOBinding.py'
Restored 'WindowList.py'
Restored 'ScrolledList.py'
Restored 'ClassBrowser.py'
Restored 'FileList.py'
Restored 'CallTips.py'
Restored 'idle.py'
Restored 'CodeContext.py'
Restored 'textView.py'
Restored 'SearchDialogBase.py'
Restored 'CallTipWindow.py'
Restored 'SearchDialog.py'
Restored 'RemoteObjectBrowser.py'
Restored 'idlever.py'
Restored 'RemoteDebugger.py'
Restored 'TreeWidget.py'
Restored 'NEWS.txt'
Restored 'idle.pyw'
Restored 'run.py'
Restored 'config-extensions.def'
Restored 'AutoExpand.py'
Restored 'Percolator.py'
Restored 'dynOptionMenuWidget.py'
Restored 'extend.txt'
Restored 'MultiStatusBar.py'
Restored 'MultiCall.py'
Restored 'macosxSupport.py'
At revision 68230.

C:\prg\Python30\Lib\idlelibpatch  conv.diff
patching file IOBinding.py

C:\prg\Python30\Lib\idlelibpatch  idle_encoding_4.patch
patching file ScriptBinding.py
patching file IOBinding.py

-

Run IDLE - Open cp1250.py - confirm converting to utf8 - F5 (immediately, no 
change in code!) - error: see attached file
idleunicode1.jpg

All the other python code base is clean 3.0.
xpsp3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Yes. God job. ;-)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Thank you. Not sure, what to do now, cause the putting down of IDLE is
fixed, but still within IDLE I get wrong output:

x=ěščřžýáíé
print (x)

 
ěščřžýáíé

when running this script under python command line form another editor,
I get the output readable as expected. Shall I open another issue?

Added file: http://bugs.python.org/file12547/q.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

Moreover: do you think its good idea to change the file encoding at
opened and then saved file without any question when there is no
encoding declaration? :-( Users do not edit just python programs, they
can edit also config files, text files, etc 

It could be that at first saving we are asked to use 
*utf8 
*used one.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4815] idle 3.1a1 utf8

2009-01-02 Thread Pavel Kosina

New submission from Pavel Kosina g...@post.cz:

When you open file without encoding declaration, make changes and save,
then IDLE changes without any question encodings to utf8. You can try it
on attached file that is cp1250 now. 

It could be that at first saving we are asked to use 
*utf8 
*current one.

--
components: IDLE
files: cp1250.py
messages: 78932
nosy: geon
severity: normal
status: open
title: idle 3.1a1 utf8
versions: Python 3.1
Added file: http://bugs.python.org/file12559/cp1250.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4008] IDLE: checksyntax() doesn't support Unicode?

2009-01-02 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

I vote for fixing this too. This might be simplified/another example of
above mentioned issues:

# -*- coding: utf-8 -*-
print (ěščřžýáíé)

in IDLE prints this:
 
ěščřžýáíé

When running this script under python command line from another editor,
I get the output readable as expected.

--
nosy: +geon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4008
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



idle 3.0 unicode

2009-01-01 Thread Pavel Kosina
As for unicode in Python 2.5 everything works fine in program running 
either in IDLE or under Command line:

# -*- coding: utf-8 -*-
print uěščřžýáíé

In 3.0 there is an error.  The same program, moved to 3.0 syntax, in 
IDLE editor :

# -*- coding: utf-8 -*-
print (ěščřžýáíé)

prints:
ěščřžýáíé

The same program running in Command line from PSPad editor works fine.  
Is it mistake of my misunderstanding or of IDLE?


-

The same program without coding declaration (but saved in utf8) :
print (ěščřžýáíé)

even immediately destroyed my IDLE window without any error message.

--
geon
Pavel Kosina

--
http://mail.python.org/mailman/listinfo/python-list


Re: idle 3.0 unicode

2009-01-01 Thread Pavel Kosina

小楼 napsal(a), dne 1.1.2009 10:32:

#coding=utf-8
#中国
print('a')

saved in utf8
alt+x,destroyed IDLE...
me too,why?
  


Are you sure? Run (F5) with  print('a') is OK here. Maybe you have
redefined key bindings in IDLE ...

--
geon
Pavel Kosina
--
http://mail.python.org/mailman/listinfo/python-list


[issue2827] IDLE 3.0a5 cannot handle UTF-8

2008-12-31 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

the following very simple example might be the the same issue:

x=ěščřžýáíé
print (x)

It reliably puts down IDLE entirely without any error message. It is
saved in UTF-8. 
python +idle 3.0, wxp sp3

--
nosy: +geon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: tkinter 3.0 multiple keyboard events together

2008-12-28 Thread Pavel Kosina

janislaw napsal(a):

Um, I could be only guessing what are you meant to do, unless you
describe your problem in more detailed way. I.e. describe the desired
behaviour, show code which you have, and describe the current
behaviour.

  


well, I am working on a tutorial for youngster (thats why i need to stay 
the code as easy as possible). In this game you are hunted by robots. I 
could use key7 on numeric keypad for left-up moving but seems to me, 
that 4+8 is much more standard for them.

This solution has disadvantage that after you release one key, that the
function keyPressHandler stopped to be called by the other pressed keys.
I would have not to build moving the player in KeyPresshandler, but on
another new function that would have to read periodically keys and to
act afterwards



Hmmm. Maybe you'd like to hook into Tkinter event loop, i.e. by custom
events if you don't like periodical polling.
  
No, that would be even more difficult. I already have a code that use 
your idea:


from Tkinter import *
root = Tk()

pressedKeys=set()

def onKeyPress(event):
   pressedKeys.add(event.keysym)

def onKeyRelease(event):
   pressedKeys.remove(event.keysym)

def move():
   print list(pressedKeys)
   root.after(100,move)

root.bind(KeyPress, onKeyPress)

root.bind(KeyRelease, onKeyRelease)
root.after(100,move)
root.mainloop()


well, I thought that gui´s have such a problem already built-in - so 
that i am not pressed to code it. You know, its not exactly about me - 
if I do it for myself, for my program, that there is no problem, but I 
need to explained it to begginners . And I do not want, as might be 
more usual, do my module, that would cover this insanity (look at it 
with 13-years old boy eyes ;-) ). Do you like to say me, that this is 
not a standard function neither in tkinter, not say gtk or the others, 
too?


I would expect something like this:

def onKeyTouch(event):
   print (event.keysymAll)
  
root.bind(KeyPress, onKeyTouch)


and all the pressed keys are printed all the functions OnKeyPress, 
OnKeyRelease, move, even set pressedKeys are in onKeyTouch



P.

--
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter 3.0 multiple keyboard events together

2008-12-27 Thread Pavel Kosina

janislaw napsal(a):

Use google to find the appropriate site, or browse this site, there
are plenty of examples. You may want to examine the code I wrote to
you to catch the idea:
#--
import Tkinter
import pprint

tk = Tkinter.Tk()
f = Tkinter.Frame(tk, width=100, height=100)
msg = Tkinter.StringVar()
msg.set('Hello')
l = Tkinter.Label(f,  textvariable=msg)
l.pack()
f.pack()

keys = set()

def keyPressHandler(event):
keys.add(event.char)
display()

def keyReleaseHandler(event):
keys.remove(event.char)
display()

def display():
msg.set(str(keys))

f.bind_all('KeyPress', keyPressHandler)
f.bind_all('KeyRelease', keyReleaseHandler)

f.mainloop()
  


Is this really the most simple solution how to do this in Tkinter? Is 
there nothing cleaner build inside?


This solution has disadvantage that after you release one key, that the 
function keyPressHandler stopped to be called by the other pressed keys. 
I would have not to build moving the player in KeyPresshandler, but on 
another new function that would have to read periodically keys and to 
act afterwards


I really tried to search for words mentioned in this subject, but 
nothing, not even this solution, was found by me.


PK


--
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter 3.0 multiple keyboard events together

2008-12-26 Thread Pavel Kosina

janislaw napsal(a):

On 26 Gru, 05:52, Pavel Kosina g...@post.cz wrote:
  

Is it possible to catch in an event more that one key from keyboard? In
my code, I can handle always the only one, the first I press, the others
are omitted. Say, I press both 4 and 8 and only 4 is catched.

def movePlayer(event):
print (event.keysym)


Each keypress triggers another event. Fortunately there are two types
of events: reaction to press and release. The logic to write to
recognize those as simultaneous clicks is up to you :)
  


Might you give me a little bit more? Just a link to a site where this is 
explained and showed would be OK. I really did my best but everything is 
bad.


geon
--
http://mail.python.org/mailman/listinfo/python-list


tkinter 3.0 multiple keyboard events together

2008-12-25 Thread Pavel Kosina
Is it possible to catch in an event more that one key from keyboard? In 
my code, I can handle always the only one, the first I press, the others 
are omitted. Say, I press both 4 and 8 and only 4 is catched.


def movePlayer(event):
   print (event.keysym)


Thank you.

--
geon
Pavel Kosina

--
http://mail.python.org/mailman/listinfo/python-list


tkinter, livewires: slow moving on Canvas

2006-08-14 Thread Pavel Kosina





Hi, 

I have two similar programs-  one in Livewires and one in Tkinter. Just 
moving the player on a canvas. Why is that one in Tkinter so slow? What 
did I miss? Livewires is based on Tkinter, so it should be the same. I 
looked at the code of Livewires, tried something, but no success. Maybe  
its because of sleeping part in event handler in Tkinter, that is 
somehow (how?) bypassed in Livewires by magic 
tkinter.dooneevent(tkinter.DONT_WAIT). Neither this worked with me.

Could anyone help?
Both programs attached.

livewires: http://www.livewires.org.uk/python/lwpackage.html



-- 
geon
Pavel Kosina



from livewires import *
from random import randint

def makePlayer():
global player_body, player_x, player_y
player_x=randint(0,640)
player_y=randint(0,480)
player_body=circle(player_x, player_y,5, filled=1)

def movePlayer():
global finito, player_body, player_x, player_y
keys=keys_pressed()

if '2' in keys:
player_y=player_y-krok
if '4' in keys:
player_x=player_x-krok
if '6' in keys:
player_x=player_x+krok
if '8' in keys:
player_y=player_y+krok
if 'q' in keys:
finito=1

move_to(player_body, player_x, player_y)


begin_graphics()
allow_moveables()
makePlayer()
finito=0
krok=0.1

while not finito:
movePlayer()

end_graphics()

from Tkinter import * 
import random


def makeCanvas():
global canvas, root

root=Tk()
canvas=Canvas(root, width=640, height=480, bg=white)
canvas.pack()

def makePlayer():
global player
x1,y1=random.randint(0,640), random.randint(0,480)
x2,y2=x1+10, y1+10
player=canvas.create_oval(x1,y1,x2,y2, fill=blue)
root.bind(Key, movePlayer)

def movePlayer(event):
if event.char==8:  # nahoru
dx,dy= 0,-step
elif event.char==6:  # vpravo
dx,dy= step, 0
elif event.char==2:  # dolu
dx,dy= 0, step
elif event.char==4:  # vlevo
dx,dy= -step,0
else:
return

canvas.move(player, dx, dy)

# --- root program 

step=1
makeCanvas()
makePlayer()

mainloop()

-- 
http://mail.python.org/mailman/listinfo/python-list