Re: [Tutor] serious problem with graphics module
Alan Gauld schrieb: W W sri...@gmail.com wrote Do you (or sombody else) know how to get ipython working with Python 2.6 (you know, the Python release, which has that new turtle module ;-) ) doesn't install on my Windows box... other than that I've got no experience with it I thought the new turtle module could be made to work on 2.5 as well as 2.6? And IPython plays with 2.5 OK. So if its only the turtle module thats needed it should work? Or am I mistaken in the 2.5 turtle compatibility? Not at all. But possibly I'mgoing to give a tutorial on turtle.py at EuroPython (depending on the number of attendees). There I'd like to use Python 2.6 (as it is the most recent release of the 2.x branch and contains turtle.py already). That's why I asked. (There are some postings in some forums on using IPython with Python 2.6 but the advice to install it I found there didn't work for me) And, Alan, some months ago you complained not to come to Pycon. Will you attend EuroPython? Would be nice to meet you there. Regards, Gregor Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
On Wed, Jun 3, 2009 at 5:51 PM, W Wsri...@gmail.com wrote: Do you (or sombody else) know how to get ipython working with Python 2.6 (you know, the Python release, which has that new turtle module ;-) ) doesn't install on my Windows box... other than that I've got no experience with it What trouble did you have? I use IPython with Python 2.6 on Windows. Not sure how I installed it though. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
On Thu, Jun 4, 2009 at 7:47 PM, Kent Johnson ken...@tds.net wrote: On Wed, Jun 3, 2009 at 5:51 PM, W Wsri...@gmail.com wrote: Do you (or sombody else) know how to get ipython working with Python 2.6 (you know, the Python release, which has that new turtle module ;-) ) doesn't install on my Windows box... other than that I've got no experience with it What trouble did you have? I use IPython with Python 2.6 on Windows. Not sure how I installed it though. After install it gave me this: *** run_installscript: internal error 0x *** same error I get trying to install pyreadline. No shortcuts on the desktop/start menu/etc show up. All the files are in the site-packages directory, it seems. -Wayne ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
Forwarding on to the list... -- Forwarded message -- From: Gregor Lingl gregor.li...@aon.at Date: Wed, Jun 3, 2009 at 3:46 PM Subject: Re: [Tutor] serious problem with graphics module To: W W sri...@gmail.com W W schrieb: On Tue, Jun 2, 2009 at 7:12 PM, Gregor Lingl gregor.li...@aon.at mailto: gregor.li...@aon.at wrote: snip Does anyone have experience with using IPython with Tkinter? Plenty, and it works wonderfully. I've never had any errors (that I know of) that weren't of my own making ;) Do you (or sombody else) know how to get ipython working with Python 2.6 (you know, the Python release, which has that new turtle module ;-) ) doesn't install on my Windows box... other than that I've got no experience with it -Wayne ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
W W sri...@gmail.com wrote Do you (or sombody else) know how to get ipython working with Python 2.6 (you know, the Python release, which has that new turtle module ;-) ) doesn't install on my Windows box... other than that I've got no experience with it I thought the new turtle module could be made to work on 2.5 as well as 2.6? And IPython plays with 2.5 OK. So if its only the turtle module thats needed it should work? Or am I mistaken in the 2.5 turtle compatibility? Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
On Tue, May 26, 2009 at 12:28 AM, Gregor Lingl gregor.li...@aon.at wrote: roberto schrieb: Do you use Python from the command line (terminal) or do you use IDLE? I ask this, because these two show different behaviour. i use IDLE, in Python 3.0 i have a problem with python 3.0 graphics module: no problem while importing the module import turtle but when i issue any command like: t = turtle.pen() After performing this command you should be able to observe a blank window with a tiny black arrow - it's the turtle yes, i can see it but each time i try to get into that window, the mouse pointer switch to the hourglass look and i cannot do anything over the windwow; moreover, if i try to click or move it, WS Xp tells me the program pythonw.exe is not responding pen() is a function in the module turtle. It returns a dictionary of the attributes of the turtle's pen. Have a look at it: print(t) {'pensize': 1, 'resizemode': 'noresize', 'pendown': True, 'fillcolor': 'black', 'speed': 3, 'shown': True, 'outline': 1, 'tilt': 0.0, 'pencolor': 'black', 'stretchfactor': (1.0, 1.0), 'shearfactor': 0.0} yes, i get a very similar answer t = turtle.forward(60) nothing appears on the screen, only a blank window, with nothing inside; may you give me some hint ? What happens if you do this? from turtle import * for i in range(4): forward(100) left(90) as i wrote before, i can see the arrow inside the graphic window but i cannot do anything inside it, i mean i cannot move or resize the window etc. anyway, yes i can see the arrow moving and drawing the square correctly ps: i'll answer to your other mails also, thank you very much Gregor -- roberto ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
On Tue, May 26, 2009 at 12:45 AM, Gregor Lingl gregor.li...@aon.at wrote: I know one situation in which can happen what you describe: If you use IDLE, issue the above commands and your Idle-shell-window covers the graphics window - then you have to move the shell window in order to see what's on the graphics window. Alas, in this situation the graphics window may get nonresponsive (to the Windows-event-queue) and may not be refreshed. So it remains apparentl empty. You may also experience problems when trying to close the window (because of the same reasons). right ! *Remedy*: if you use the turtle module interactively, you have to use Idle with the -n flag, which prevents it from using subprocesses for executing scripts. I recommend to prepare a special shortcut on your desktop, something like this: C:\Python30\pythonw.exe C:\Python30\Lib\idlelib\idle.pyw -n When you fire up Idle with this link you will get the text: No Subprocess above your first input prompt. Now you can enter your commands and everything should work fine. ok, it works all right now the minor issue is that i could not create the shortcut with the -n flag as you pointed out, that's why i issued both commands: C:\Python30\pythonw.exe C:\Python30\Lib\idlelib\idle.pyw -n via the C: prompt and the graphic window finally worked correctly thank you again -- roberto ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
roberto wrote: On Tue, May 26, 2009 at 12:45 AM, Gregor Lingl gregor.li...@aon.at wrote: I know one situation in which can happen what you describe: If you use IDLE, issue the above commands and your Idle-shell-window covers the graphics window - then you have to move the shell window in order to see what's on the graphics window. Alas, in this situation the graphics window may get nonresponsive (to the Windows-event-queue) and may not be refreshed. So it remains apparentl empty. You may also experience problems when trying to close the window (because of the same reasons). right ! *Remedy*: if you use the turtle module interactively, you have to use Idle with the -n flag, which prevents it from using subprocesses for executing scripts. I recommend to prepare a special shortcut on your desktop, something like this: C:\Python30\pythonw.exe C:\Python30\Lib\idlelib\idle.pyw -n When you fire up Idle with this link you will get the text: No Subprocess above your first input prompt. Now you can enter your commands and everything should work fine. ok, it works all right now the minor issue is that i could not create the shortcut with the -n flag as you pointed out, that's why i issued both commands: C:\Python30\pythonw.exe C:\Python30\Lib\idlelib\idle.pyw -n via the C: prompt and the graphic window finally worked correctly thank you again Be aware though that using IDLE without subprocess also has its own problems such as leaked variables from previous execution. Although IDLE tries to clear itself up sometimes there are things that still leaves various odd effects here and there especially with Tkinter itself. The real solution would be to give up IDLE and use python from cmd.exe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
Lie Ryan schrieb: roberto wrote: On Tue, May 26, 2009 at 12:45 AM, Gregor Lingl gregor.li...@aon.at wrote: I know one situation in which can happen what you describe: ... ok, it works all right now the minor issue is that i could not create the shortcut with the -n flag as you pointed out, that's why i issued both commands: C:\Python30\pythonw.exe C:\Python30\Lib\idlelib\idle.pyw -n via the C: prompt and the graphic window finally worked correctly thank you again Be aware though that using IDLE without subprocess also has its own problems such as leaked variables from previous execution. That's certainly true, and it was the reason for introducing Idle's feature to execute scripts in their own subprocesses with Python 2.3 Despite of this I like to use Idle when working interactively with the turtle module and also when developing small programs as it is much more comfortable than a cmd-shell window. But I reglularly run them (during development) from the 'normal' Idle (or from a cmd-shell) to assure that effects like those you mention below are not present. Does anyone have experience with using IPython with Tkinter? Regards, Gregor Although IDLE tries to clear itself up sometimes there are things that still leaves various odd effects here and there especially with Tkinter itself. The real solution would be to give up IDLE and use python from cmd.exe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
roberto wrote: hello everyone i have a problem with python 3.0 graphics module: no problem while importing the module import turtle but when i issue any command like: t = turtle.pen() t = turtle.forward(60) Your code fails for me at turtle.pen AttributeError: 'module' object has no attribute 'pen' If I replace pen with Pen then it works as desired. nothing appears on the screen, only a blank window, with nothing inside; may you give me some hint ? OS: win Xp thank you in advance ! -- Bob Gailer Chapel Hill NC 919-636-4239 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
roberto schrieb: hello everyone i have a problem with python 3.0 graphics module: no problem while importing the module import turtle but when i issue any command like: t = turtle.pen() t = turtle.forward(60) nothing appears on the screen, only a blank window, with nothing inside; may you give me some hint ? I know one situation in which can happen what you describe: If you use IDLE, issue the above commands and your Idle-shell-window covers the graphics window - then you have to move the shell window in order to see what's on the graphics window. Alas, in this situation the graphics window may get nonresponsive (to the Windows-event-queue) and may not be refreshed. So it remains apparentl empty. You may also experience problems when trying to close the window (because of the same reasons). *Remedy*: if you use the turtle module interactively, you have to use Idle with the -n flag, which prevents it from using subprocesses for executing scripts. I recommend to prepare a special shortcut on your desktop, something like this: C:\Python30\pythonw.exe C:\Python30\Lib\idlelib\idle.pyw -n When you fire up Idle with this link you will get the text: No Subprocess above your first input prompt. Now you can enter your commands and everything should work fine. hth Gregor OS: win Xp thank you in advance ! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
bob gailer schrieb: roberto wrote: hello everyone i have a problem with python 3.0 graphics module: no problem while importing the module import turtle but when i issue any command like: t = turtle.pen() t = turtle.forward(60) Your code fails for me at turtle.pen AttributeError: 'module' object has no attribute 'pen' Do you use Python 3.0? import turtle turtle.pen function pen at 0x0179A4F8 If I replace pen with Pen then it works as desired. Then you use the Pen-class to create a Turtle t. Then you have to call the forward method for this turtle: import turtle t = turtle.Pen() t.forward(60) Regards, Gregor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] serious problem with graphics module
roberto schrieb: hello everyone Hello Roberto, First question: Do you use Python from the command line (terminal) or do you use IDLE? I ask this, because these two show different behaviour. i have a problem with python 3.0 graphics module: no problem while importing the module import turtle but when i issue any command like: t = turtle.pen() After performing this command you should be able to observe a blank window with a tiny black arrow - it's the turtle pen() is a function in the module turtle. It returns a dictionary of the attributes of the turtle's pen. Have a look at it: print(t) {'pensize': 1, 'resizemode': 'noresize', 'pendown': True, 'fillcolor': 'black', 'speed': 3, 'shown': True, 'outline': 1, 'tilt': 0.0, 'pencolor': 'black', 'stretchfactor': (1.0, 1.0), 'shearfactor': 0.0} t = turtle.forward(60) nothing appears on the screen, only a blank window, with nothing inside; may you give me some hint ? Hmm, in my window the turtle goes 60 pixels to the right and draws a black line. The statement t = turtle.forward(60) doesn't make much sense, though. It calls the forward() function of the turtle module and names it's return value t. Alas: print(t) None Not really useful. turtle.forward(60) is sufficient. What happens if you do this? from turtle import * for i in range(4): forward(100) left(90) Regards, Gregor OS: win Xp thank you in advance ! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor