How do I enter the pound symbol (£) in the Python interactive shell on Mac OS X?

Update: Thanks for the suggestions. After further research, Ive formulated the question here: Python / editline on OS X: £ seems to be related to a pre-pre-word

On Mac OS X, I cannot enter the pound sign (£) in the interactive Python shell.

  • Mac OS X 10.5.5
  • Python 2.5.1 (r251: 54863, January 17, 2008, 19:35:17)
  • European keyboard (£ - shift-3)

When I type "£" (i.e., press shift-3) in an empty Python shell, nothing appears.

If Ive already typed a few characters, for example

>>> 1234567890 1234567890 1234567890

... then pressing shift-3 will make the cursor position by itself after the very last space or the beginning of the line, if there are no spaces between the cursor and the beginning of the line.

bash shift-3 "£" , .

, "£" Python?

+5
5

, . , , , ?

+1

, :

 pound = u'\u00A3'

, .

+5

00A003. Unicode u '\ u00a003'.

: @Patrick McElhaney , 00A3.

+2

u'\N{pound sign}'

ipython,

execute pound = u'\N{pound sign}'

in your ipythonrc file (under the "Python code to execute" section) this way you will always have a "pound" defined as a pound symbol in the interactive shell.

+2
source

There should be your setup, I can use E (also a European keyboard) under IDLE or on the python command line. (python 2.5).

edit: I use windows, so there may be a problem with how python works under Mac OS?

0
source

All Articles