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)

2233 questions
0
votes
1 answer

Save array made with readline module

I have the next piece of code. It's a function that has to return an array based on a txt file. The problem is when I print piece by piece the array, it prints well. But when I print the array out of the Interface, the array is empty. const fs =…
Carlos Vallejo
  • 3,290
  • 3
  • 9
  • 13
0
votes
0 answers

C# unneccesary enter while using voice recognition

class Program { static void Main(string[] args) { Brain b = new Brain(); b.start(); } } public class Map { public string key; public string value; public Map(string key, string value) { this.key =…
Patrick Visi
  • 100
  • 1
  • 7
0
votes
2 answers

How do I process the next line when looping through the current lines?

Having a go at converting a vba macro to python. 1st step in python so don't throw stones if so obvious. Reading a text file processing each line if the line contains a keyword I want to process the next 2 lines (which have the data I…
JXB
  • 29
  • 5
0
votes
2 answers

Get readline input as an array

I'm doing a programming challenge right now but I'm struggling with getting the input right. There is no feedback on my output, only "error" which makes it really hard to debug for me. Here is the input: 4 2 1 4 2 9 4 7 5 8 and I want to collect it…
marius
  • 13
  • 5
0
votes
1 answer

Getting input in Kattis challenges - readline js

I am doing a Kattis challenge, Booking a Room. Basically, I get initial input - let's say 6, 4. I have to store that input somewhere and then ask for another x inputs where x = the first value, ie. 6. Those inputs are stored elsewhere, in an array…
tachko
  • 161
  • 1
  • 8
0
votes
1 answer

Node.js builtin module readline keeps reading lines after being closed

I have following code: const fs = require("fs"); const {createInterface} = require("readline"); const {join} = require("path"); const {once} = require("events"); async function readMeta (path) { const meta = {}; const rs =…
0
votes
1 answer

Reading first lines from textfile without loading whole textfile into memory

I have a large amount of small textfiles where the first 4 or less lines contain metadata; following is an example Lorem Ipsum Tag1 Tag2 Tag3 Text 4204 ‎‎‎‎‎‎ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt…
0
votes
0 answers

Do the read(bytes) function with readline() in python subprocess.pipe

I'm trying to read non-blocking from subprocess pipe on windows python3. I made an implementation that pipes a FFMPEG video stream. It works on Linux but since FNCTL doesn't work on windows I'm looking at other ways of avoiding read/write blocking.…
Grebtsew
  • 192
  • 5
  • 13
0
votes
1 answer

TypeError: callback is not a function in readline

I am learning nodejs and getting error. After defining the callback inside readline.question() and passing the argument i am getting TypeError: callback is not a function. Please help me with this. rl.question("./dict ", function(inputDictCmd,…
0
votes
2 answers

Swift: how to convert readLine() input " [-5,20,8...] " to an Int array

I already run the search today and found a similar issue here, but it not fully fix the issue. In my case, I want to convert readLine input string "[3,-1,6,20,-5,15]" to an Int array [3,-1,6,20,-5,15]. I'm doing an online coding quest from one…
Zhou Haibo
  • 1,681
  • 1
  • 12
  • 32
0
votes
5 answers

Java BufferedReader readLine() suddenly not working after read()

I am currently having a problem with my loop. After I inputted a string once, it prompts the user and when the loop conditions were met, it just keeps asking the user "do you want to continue?" and was unable to enter another string. public static…
steveee26
  • 27
  • 3
0
votes
1 answer

Can I transform string to pyomo variable?

I have a .txt file which contains a variable for my model. If I copy and paste the contents of the file in my program as def Wind_phi_definition(model, i): return m.Wind_phi[i] ==-19.995904426195736*Sinc(0.04188790204786391*(0. +…
slow_learner
  • 337
  • 1
  • 2
  • 15
0
votes
3 answers

java - avoid outputting first line that is inputted by user

So I'm trying to create a program that reads in user input and outputs the current line only if it is smaller than some previous line. My program works fine but it keeps printing the first line I input which shouldn't be valid because there is no…
Grayish
  • 187
  • 1
  • 10
0
votes
2 answers

Why "!!" is required when converting the readline string value into int

I am new to kotlin, and I have been doing research on the syntax of the language. It is to my understanding that in kotlin you can cast data types using integrated functions like : .toInt() converting 3.14 to an integer : 3.14.toInt() since it is…
RonsJurisdiction
  • 240
  • 1
  • 2
  • 15
0
votes
3 answers

Trying to create Login System in C#

I'm trying to create a simple Login system for my program, however I am experiencing errors when it comes to adding more than one username and password,as the implemented error message appears when I attempt a secondary username and password,…
user12540531
1 2 3
99
100