0

I installed IPython and readline through pip like this:

sudo pip install ipython

sudo pip install readline

but I find that I can't input '<' in either Python shell or IPython shell. When I type '<' my mac would alarm.

I think this may be related to readline because when I remove readline from my computer it works okay and I can type '<' in shell.

I'm using macbook pro, iTerm2, 10.8.3, python2.7.2

tonicbupt
  • 997
  • 5
  • 6

1 Answers1

0
import sys
print sys.stdin.readline()

and do:

python2 script.py < script.py

and you should get the contents of your own file :)

Torxed
  • 22,866
  • 14
  • 82
  • 131
  • you didn't get my point... I mean that I can't type '<' in shell. Like in IPython: In[1]: (I type <, nothing typed in and my mac alarms that I press the wrong button.) – tonicbupt May 31 '13 at 16:51
  • Have you tried a different terminal emulator? – bjou May 31 '13 at 17:21
  • MAC... why the bloody f*** didn't you say so.. I'm outahere *poff*.. You'll have to tell your terminal to not treat < as a command character. This has nothing what so ever to do with Python sorry to say (i own a mac, for a very specific project, other than that.. it's a expensive junk to write anything except facebook updates on). Here try http://stackoverflow.com/questions/1856437/command-key-as-meta-key-in-os-x-terminal-app – Torxed May 31 '13 at 17:28
  • Previous comment is intended partially as humor, i'm aware that you sad you're using a mac (i just missed it obviously) – Torxed May 31 '13 at 17:29