Discussion:
trying idle
Rustom Mody
2014-10-09 06:52:57 UTC
Permalink
Been using emacs for over 20 years and teaching python for 10.
And getting fed up that my audience looks at me like Rip van Winkle
each time I start up emacs...

So trying out Idle...

Some specific and some general questions:
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
[Remember seeing some adventures with Tkinter...]
Particularly with macs my knowledge is at the level:
"How the ^%*)( do you right click without a right-click button?"
So I would like to avoid something that is not quite working.

Specific:
Is there a way to cut-paste a snippet from the interpreter window
containing ">>> " "... " into the file window and auto-remove the prompts?
[I have a vague recollection of Terry showing somethin...]
Terry Reedy
2014-10-09 09:26:25 UTC
Permalink
Post by Rustom Mody
Been using emacs for over 20 years and teaching python for 10.
And getting fed up that my audience looks at me like Rip van Winkle
each time I start up emacs...
So trying out Idle...
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
If macbook runs OSX, and the linux has recent tcl/tk installed, the
answer should be Yes
Post by Rustom Mody
[Remember seeing some adventures with Tkinter...]
One may have to install activestate tkc/tk on mac, depending on osx
version. This page has details:
https://www.python.org/download/mac/tcltk
Post by Rustom Mody
"How the ^%*)( do you right click without a right-click button?"
I believe control-click, but Macs users could say better.
Post by Rustom Mody
So I would like to avoid something that is not quite working.
Is there a way to cut-paste a snippet from the interpreter window
containing ">>> " "... " into the file window and auto-remove the prompts?
[I have a vague recollection of Terry showing somethin...]
I doubt I said anything. I have said there is a tracker issue for the
feature (something similar to dedent). I would like to add a general
facility for users to define reformat/transform functions to do
precisely what they want. In particular, what to do with output lines?
--
Terry Jan Reedy
random832
2014-10-09 12:47:14 UTC
Permalink
Post by Terry Reedy
Post by Rustom Mody
"How the ^%*)( do you right click without a right-click button?"
I believe control-click, but Macs users could say better.
Control-click was the canonical way to do it when right click menus were
introduced in Mac OS itself. Some programs (notably Netscape) supported
them via click-hold before that. And it's been nearly a decade since
Apple sold a mouse with no ability to right-click.
Mark H Harris
2014-10-10 07:53:39 UTC
Permalink
Post by random832
Post by Terry Reedy
I believe control-click, but Macs users could say better.
Control-click was the canonical way to do it when right click menus were
introduced in Mac OS itself. Some programs (notably Netscape) supported
them via click-hold before that. And it's been nearly a decade since
Apple sold a mouse with no ability to right-click.
The apple mouse has only one click in the hardware... but, through the
software (settings) the apple hardware 'know' which side of the mouse
you are pushing over. You can configure the mouse through the settings
to make the left or right side function alternately. The same is true
for the magic mouse (wireless, swipe-able); it also only has one clicker
but 'senses' which side of the mouse the fingers are over when the push
occurs. At any rate, right mousing on the mac has been happening for
several years.
random832
2014-10-10 19:32:38 UTC
Permalink
Post by Mark H Harris
The apple mouse has only one click in the hardware... but, through the
software (settings) the apple hardware 'know' which side of the mouse
you are pushing over.
It only has one physical switch (I'm not sure the latest ones have any
at all), but AFAIK that doesn't mean it doesn't send right-click events
to systems that just see it as a dumb HID mouse.
wxjmfauth
2014-10-09 12:21:46 UTC
Permalink
Post by Rustom Mody
So trying out Idle...
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
---

No.
Mark H Harris
2014-10-10 07:54:49 UTC
Permalink
Post by Rustom Mody
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
---
No.
Huh?
Rustom Mody
2014-10-09 12:53:36 UTC
Permalink
Post by Terry Reedy
Post by Rustom Mody
Is there a way to cut-paste a snippet from the interpreter window
containing ">>> " "... " into the file window and auto-remove the prompts?
[I have a vague recollection of Terry showing somethin...]
I doubt I said anything. I have said there is a tracker issue for the
feature (something similar to dedent). I would like to add a general
facility for users to define reformat/transform functions to do
precisely what they want. In particular, what to do with output lines?
I was looking for something more simplistic:

eg in emacs there are rectangle commands; also following MS office there are
'column' commands. Using either of these its a couple of keystrokes/clicks
to 'de-prompt' a region/selection all of whose lines start with ">>> " or
"... "
Rustom Mody
2014-10-09 13:12:08 UTC
Permalink
Post by Terry Reedy
Post by Rustom Mody
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
If macbook runs OSX, and the linux has recent tcl/tk installed, the
answer should be Yes
I get this traceback on closing idle. Otherwise seems to be working.
Still...
[idle3 on linux]

Exception ignored in: <bound method _ComplexBinder.__del__ of <idlelib.MultiCall._ComplexBinder object at 0x7f2a98e914e0>>
Traceback (most recent call last):
File "/usr/lib/python3.4/idlelib/MultiCall.py", line 244, in __del__
self.widget.unbind(self.widgetinst, seq, id)
File "/usr/lib/python3.4/tkinter/__init__.py", line 1071, in unbind
self.tk.call('bind', self._w, sequence, '')
_tkinter.TclError: can't invoke "bind" command: application has been destroyed
Exception ignored in: <bound method _ComplexBinder.__del__ of <idlelib.MultiCall._ComplexBinder object at 0x7f2a98eb2240>>
Traceback (most recent call last):
File "/usr/lib/python3.4/idlelib/MultiCall.py", line 244, in __del__
self.widget.unbind(self.widgetinst, seq, id)
File "/usr/lib/python3.4/tkinter/__init__.py", line 1071, in unbind
self.tk.call('bind', self._w, sequence, '')
_tkinter.TclError: can't invoke "bind" command: application has been destroyed
Exception ignored in: <bound method _ComplexBinder.__del__ of <idlelib.MultiCall._ComplexBinder object at 0x7f2a98eb25f8>>
Traceback (most recent call last):
File "/usr/lib/python3.4/idlelib/MultiCall.py", line 244, in __del__
self.widget.unbind(self.widgetinst, seq, id)
File "/usr/lib/python3.4/tkinter/__init__.py", line 1071, in unbind
self.tk.call('bind', self._w, sequence, '')
_tkinter.TclError: can't invoke "bind" command: application has been destroyed
Exception ignored in: <bound method _ComplexBinder.__del__ of <idlelib.MultiCall._ComplexBinder object at 0x7f2a98eb29b0>>
Traceback (most recent call last):
File "/usr/lib/python3.4/idlelib/MultiCall.py", line 244, in __del__
self.widget.unbind(self.widgetinst, seq, id)
File "/usr/lib/python3.4/tkinter/__init__.py", line 1071, in unbind
self.tk.call('bind', self._w, sequence, '')
_tkinter.TclError: can't invoke "bind" command: application has been destroyed
Terry Reedy
2014-10-09 20:49:11 UTC
Permalink
Post by Rustom Mody
Post by Terry Reedy
Post by Rustom Mody
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
If macbook runs OSX, and the linux has recent tcl/tk installed, the
answer should be Yes
I get this traceback on closing idle. Otherwise seems to be working.
[snip]
Post by Rustom Mody
_tkinter.TclError: can't invoke "bind" command: application has been destroyed
Are you running 3.4.0? This was a 3.4 regression that was only reported
to occur if one opened Idle with a editor window and closed without ever
running it. This was fixed in
http://bugs.python.org/issue20167
but I believe too late for 3.4.0. If you see this with 3.4.2 (strongly
recommended, especially forthcoming OSX) or even 3.4.1, please add a
note to the issue with exact details -- how start, what do, how close.
--
Terry Jan Reedy
Rustom Mody
2014-10-10 02:03:03 UTC
Permalink
Post by Terry Reedy
Post by Rustom Mody
Post by Terry Reedy
Post by Rustom Mody
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
If macbook runs OSX, and the linux has recent tcl/tk installed, the
answer should be Yes
I get this traceback on closing idle. Otherwise seems to be working.
[snip]
Post by Rustom Mody
_tkinter.TclError: can't invoke "bind" command: application has been destroyed
Are you running 3.4.0? This was a 3.4 regression that was only reported
to occur if one opened Idle with a editor window and closed without ever
running it. This was fixed in
http://bugs.python.org/issue20167
but I believe too late for 3.4.0. If you see this with 3.4.2 (strongly
recommended, especially forthcoming OSX) or even 3.4.1, please add a
note to the issue with exact details -- how start, what do, how close.
Added the backtrace there.

3.4.1-1 on debian testing
Mark H Harris
2014-10-10 08:08:13 UTC
Permalink
Post by Rustom Mody
Been using emacs for over 20 years and teaching python for 10.
And getting fed up that my audience looks at me like Rip van Winkle
each time I start up emacs...
(sigh)
Post by Rustom Mody
So trying out Idle...
Good for you! ... and even better for your students. IDLE is
fabulous as a native python interactive development environment these
days. It really works well, is clean and does what it advertises; its
very nice!
Post by Rustom Mody
My audience consists of people having linux and windows and macbooks.
Does Idle run on all these?
Absolutely. The ONLY problem you might run into on the (macs) apple
systems is that tcl/tk tkinter might be at the wrong level. Use ActiveTCL:

https://www.python.org/download/mac/tcltk

Depending on the apple system the wrong (built-in tcl/tk tkinter)
will cause problems. If you ActiveTCL you'll have no problem. Just point
your students at the appropriate pages.

Cheers
Rustom Mody
2014-10-16 13:29:03 UTC
Permalink
Post by Terry Reedy
One may have to install activestate tkc/tk on mac, depending on osx
https://www.python.org/download/mac/tcltk
Ok Ive some more information:
The people in the audience using macs are using mavericks

Whats the best way to setup python3 for that?

I remember seeing some two different repos (if that what they are called
in mac-land) for python. With some different tradeoffs which I dont understand.

Another related question for mac-python usage:

I asked one of the mac-users:
Please start your default python in a shell and tell me what version it is.

Answer: Mac has no shell.

I find this hard to believe. Is a shell called something else
in mac-maverick?? Where/how to find it?
MRAB
2014-10-16 14:04:43 UTC
Permalink
Post by Rustom Mody
Post by Terry Reedy
One may have to install activestate tkc/tk on mac, depending on osx
https://www.python.org/download/mac/tcltk
The people in the audience using macs are using mavericks
Whats the best way to setup python3 for that?
I remember seeing some two different repos (if that what they are called
in mac-land) for python. With some different tradeoffs which I dont understand.
Please start your default python in a shell and tell me what version it is.
Answer: Mac has no shell.
I find this hard to believe. Is a shell called something else
in mac-maverick?? Where/how to find it?
In Macland it's called the terminal emulator:

http://en.wikipedia.org/wiki/Terminal_%28OS_X%29
Chris Angelico
2014-10-16 15:23:34 UTC
Permalink
Post by MRAB
http://en.wikipedia.org/wiki/Terminal_%28OS_X%29
To be strictly correct, the "shell" would be the thing you run that
gives you a prompt, and the "terminal emulator" would be the thing you
run that gives you a black box on your GUI. On my Linux box here
(Debian Wheezy with Xfce), I use xfce4-terminal as my terminal
emulator, and bash as my shell. You could alternatively use
gnome-terminal, or you could use csh for your shell, or whatever
strikes your fancy. Macs are no different here; they have a terminal
emulator (which is usually just called "Terminal" aiui), and a shell
(usually bash, though not quite the bash I know from my systems -
maybe a different version).

It's Windows that is the oddball. You can't easily find the terminal
emulator, though it does have one. People think of "running cmd.exe"
to get a "shell", which in reality is both a terminal and a shell
inside that terminal. But ultimately, it's still the same.

ChrisA
Grant Edwards
2014-10-16 16:23:55 UTC
Permalink
Post by Chris Angelico
Post by MRAB
http://en.wikipedia.org/wiki/Terminal_%28OS_X%29
To be strictly correct, the "shell" would be the thing you run that
gives you a prompt, and the "terminal emulator" would be the thing
you run that gives you a black box on your GUI.
Infidel! The correct color for an empty terminal box is _white_.

You probably eat your soft-boiled eggs from the wrong end too.

;)
--
Grant Edwards grant.b.edwards Yow! Everybody is going
at somewhere!! It's probably
gmail.com a garage sale or a disaster
Movie!!
Chris Angelico
2014-10-16 16:33:36 UTC
Permalink
Post by Grant Edwards
Post by Chris Angelico
Post by MRAB
http://en.wikipedia.org/wiki/Terminal_%28OS_X%29
To be strictly correct, the "shell" would be the thing you run that
gives you a prompt, and the "terminal emulator" would be the thing
you run that gives you a black box on your GUI.
Infidel! The correct color for an empty terminal box is _white_.
You probably eat your soft-boiled eggs from the wrong end too.
I probably do! Though I haven't yet figured out how to eat them from the inside.

ChrisA
Cameron Simpson
2014-10-16 21:48:27 UTC
Permalink
Post by Rustom Mody
Post by Terry Reedy
One may have to install activestate tkc/tk on mac, depending on osx
https://www.python.org/download/mac/tcltk
The people in the audience using macs are using mavericks
Whats the best way to setup python3 for that?
I remember seeing some two different repos (if that what they are called
in mac-land) for python. With some different tradeoffs which I dont understand.
I use MacPorts. Also popular are Brew and Fink. You can even use them all at
once; they install to separate trees.

My Python 3 comes from MacPorts.
Post by Rustom Mody
Please start your default python in a shell and tell me what version it is.
Answer: Mac has no shell.
I find this hard to believe. Is a shell called something else
in mac-maverick?? Where/how to find it?
As pointed out elsewhere, OSX ships with "Terminal" as a terminal emutator.
Another popular terminal emulator is iTerm2, which is what I prefer. You can
run X11 also, and use any of the many terminal emulators that run in it, though
the experience is clunkier.

As far as shells go, OSX ships with /bin/sh, /bin/bash and /bin/zsh. Or for the
perverse, /bin/csh and /bin/tcsh (it is, after all, a BSD derived OS). I use
zsh, getting my copy from MacPorts instead of OSX's native one.

So it is a perfectly normal UNIX system in this regard.

Cheers,
Cameron Simpson <cs at zip.com.au>

No electrons were harmed in the production of this message.
- Dr. P. Gensheimer <paulg at fs1.mpifr-bonn.mpg.de>
Rustom Mody
2014-10-17 01:08:36 UTC
Permalink
Post by Cameron Simpson
Post by Rustom Mody
Post by Terry Reedy
One may have to install activestate tkc/tk on mac, depending on osx
https://www.python.org/download/mac/tcltk
The people in the audience using macs are using mavericks
Whats the best way to setup python3 for that?
I remember seeing some two different repos (if that what they are called
in mac-land) for python. With some different tradeoffs which I dont understand.
I use MacPorts. Also popular are Brew and Fink. You can even use them all at
once; they install to separate trees.
Ok and is the MacPorts python3 one monolithic package or a bunch of separate
ones (like debian/ubuntu) for core-python, tkinter, idle etc?
Cameron Simpson
2014-10-17 05:03:11 UTC
Permalink
Post by Rustom Mody
Post by Cameron Simpson
Post by Rustom Mody
Post by Terry Reedy
One may have to install activestate tkc/tk on mac, depending on osx
https://www.python.org/download/mac/tcltk
The people in the audience using macs are using mavericks
Whats the best way to setup python3 for that?
I remember seeing some two different repos (if that what they are called
in mac-land) for python. With some different tradeoffs which I dont understand.
I use MacPorts. Also popular are Brew and Fink. You can even use them all at
once; they install to separate trees.
Ok and is the MacPorts python3 one monolithic package or a bunch of separate
ones (like debian/ubuntu) for core-python, tkinter, idle etc?
It is one package. (You can install distinct packages for python 3.2, 3.3, 3.4
... and select which one is default.) That gets you Python and the stdlib.

There's a whole suite of extra packages for various third party libraries. And
of course the user can use pip and/or virtualenv to arrange things on their
own, also.

Cheers,
Cameron Simpson <cs at zip.com.au>

People are paid for coming in the morning and leaving at night, and for
saying "Good morning" in the morning and "Good afternoon" in the afternoon
and never confusing the two.
- Albert Shanker, president of the American Federation of Teachers
Loading...