Questions tagged [readline]

A library for command line editing, or a function to read one line of text.

Readline may refer either the GNU readline library, used for editing a command line; or a function or method in various programming languages which typically reads a line of text from an open file handle.

GNU readline library

The gnu readline library provides applications with an interactive command prompt with features like

  • flexible command editing
  • configurable key bindings to mimic e.g. or
  • a history of past commands

Probably the most prominent application using readline is . Both packages are maintained by the same person. Many programming languages provide bindings for this library.

readline function

Examples of readline functions or methods include

(please extend this list if you know more languages using this name)

1985 questions
285
votes
11 answers

Getting rid of \n when using .readlines()

I have a .txt file with values in it. The values are listed like so: Value1 Value2 Value3 Value4 My goal is to put the values in a list. When I do so, the list looks like this: ['Value1\n', 'Value2\n', ...] The \n is not needed. Here is my code: t…
TDNS
  • 3,075
  • 2
  • 14
  • 16
158
votes
3 answers

Convert InputStream to BufferedReader

I'm trying to read a text file line by line using InputStream from the assets directory in Android. I want to convert the InputStream to a BufferedReader to be able to use the readLine(). I have the following code: InputStream is; is =…
karse23
  • 3,705
  • 5
  • 27
  • 33
155
votes
7 answers

How to wait for a keypress in R?

I want to pause my R script until the user presses a key. How do I do this?
Contango
  • 65,385
  • 53
  • 229
  • 279
112
votes
7 answers

Press alt + numeric in bash and you get (arg [numeric]) what is that?

Press alt + numeric in bash and you get (arg [numeric]) what is that? (This type of question is better suited for asking a human, instead of trying to "guess" for the correct terminology to search on the documentation via internet).
dreftymac
  • 27,818
  • 25
  • 108
  • 169
101
votes
6 answers

How do I use vi keys in ipython under *nix?

Currently in Bash I use set -o vi to enable vi mode in my bash prompt. How do I get this going in ipython?
gak
  • 29,596
  • 24
  • 111
  • 150
84
votes
7 answers

Best method for reading newline delimited files and discarding the newlines?

I am trying to determine the best way to handle getting rid of newlines when reading in newline delimited files in Python. What I've come up with is the following code, include throwaway code to test. import os def getfile(filename,results): f =…
solarce
  • 1,155
  • 1
  • 9
  • 9
59
votes
4 answers

Control-r reverse-i-search in Bash: how do you "reset" the search in Cygwin?

How do you tell Ctrl + R reverse-i-search to "reset itself" and start searching from the bottom of your history every time? Background: When using reverse-i-search in Bash, I always get stuck once it is finished searching up through the history and…
dreftymac
  • 27,818
  • 25
  • 108
  • 169
57
votes
19 answers

TAB completion does not work in Jupyter Notebook but fine in iPython terminal

TAB completion works fine in iPython terminal, but not in Firefox browser. So far I had tried but failed, 1). run a command $ sudo easy_install readline, then the .egg file was wrote in…
55
votes
3 answers

What is the difference between File.ReadLines() and File.ReadAllLines()?

I have query regarding File.ReadLines() and File.ReadAllLines().what is difference between them. i have text file where it contains data in row-wise.File.ReadAllLines() return array and using File.ReadLines().ToArray(); will also i can get same…
sp_m
  • 2,515
  • 7
  • 37
  • 58
52
votes
7 answers

Problems with the rails console, RVM and readline

I've installed rvm as a way of making sure that my local development version of ruby is the same as my server's for a particular app i work on (ruby 1.8.7). I've done this, and installed ruby 1.8.7 ok. However, when i try to start the rails…
Max Williams
  • 30,785
  • 29
  • 115
  • 186
50
votes
6 answers

Return to readline version 6.x in Homebrew to fix Postgresql?

I'm no Homebrew expert but I think it has "upgraded" me from readline version 6.x to 7.0 sometime after 9/15/16: eat@eric-macbook:Homebrew$ brew info readline readline: stable 7.0 (bottled) [keg-only] Library for command-line…
ericky
  • 1,591
  • 2
  • 12
  • 16
47
votes
2 answers

python tab completion Mac OSX 10.7 (Lion)

Before upgrading to lion, I had tab complete working in a python shell via terminal. Following these instructions, it was possible to have tab complete working. Since upgrading to Lion, I am now unable to get tab complete working in a terminal…
Josh Smeaton
  • 43,953
  • 24
  • 121
  • 160
44
votes
5 answers

How to use readline() method in Java?

I am beginner in Java, and I was reading the topic of giving values to variables through the readLine() method from the keyboard. The program for that is given in the book is as follows: import java.io.DataInputStream class Reading { public…
Junior Bill gates
  • 1,798
  • 4
  • 19
  • 31
42
votes
3 answers

Ipython no readline available and pip install readline error

I installed ipython but it doesn't have the readline option. I first downloaded gnu readline and compiled and installed. DIdn't know whether it was a proper solution but was the first thing I thought of. It still wouldn't work to no avail with the…
J Spen
  • 2,434
  • 4
  • 21
  • 36
41
votes
6 answers

Why do I get the "Unhandled exception type IOException"?

I have the following simple code: import java.io.*; class IO { public static void main(String[] args) { BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String userInput; while…
Roman
  • 97,757
  • 149
  • 317
  • 426
1
2 3
99 100