Skip to main content

All Questions

Tagged with
0 votes
1 answer
21 views

undetectable Dart-Input in Visual Code Studio

I made a script in in Visual Studio Code using Dart that grabs the user's input. The problem is, that if I enter something in the input line in vscode, which is located below the debug console and ...
Bluefy's user avatar
  • 3
0 votes
1 answer
115 views

Input, left arrow key - Rust

I wrote this code for create an user input. std::io::stdout().flush().expect("Failed to flush stdout"); std::io::stdin().read_line(stdin_buffer).expect("Failed to read from stdin");...
Saviam's user avatar
  • 37
0 votes
2 answers
105 views

How can I read from stdin in a test with Maven?

I'd like to read from stdin as part of a test for my Java project, which uses Maven as its build tool. My Java code is something like this (simplified for demonstration purposes): try (Scanner stdin = ...
C0urante's user avatar
2 votes
1 answer
101 views

How can I read one byte from stdin in Dyalog APL?

I’m trying to make a terminal user interface in Dyalog APL and need a way to read a single byte of user input from stdin. How can I do this? In Python for example, you can use sys.stdin.read(1). I’ve ...
rabbitgrowth's user avatar
-2 votes
1 answer
500 views

Hardcode/overwrite value for `input()` in python

What are the details of your problem? There are several ways to take external input - stdin, CLI arguments, or files, etc. In python3, keywords respectively are: input, sys.argv, open. The most ...
user8395964's user avatar
0 votes
0 answers
137 views

How to input() after reading stdin in python?

This simple code: #!/usr/bin/env python3 import argparse import socket import shlex import subprocess import sys import textwrap import threading def execute(cmd): cmd = cmd.strip() if not ...
milanHrabos's user avatar
  • 2,045
1 vote
1 answer
235 views

How to test nested input in Go

I have function for getting user input using os.Stdin func (i input) GetInput(stdin io.Reader) (string, error) { reader := bufio.NewReader(stdin) data, err := reader.ReadString('\n') if ...
Vlad's user avatar
  • 197
1 vote
1 answer
304 views

Not quoting $input in Powershell, and its value is "Current"

I was writing a PowerShell script, and forgot to quote $input when piping to a command. The command unexpectedly appeared to receive the string Current on stdin, so I investigated further and typed ...
craig65535's user avatar
  • 3,533
0 votes
1 answer
142 views

How to read both a char and an int from input

I'm currently working on a function that takes user input to select a point on a Battleship game board. The rows are represented with the letters A-J while the columns are represented by numbers 0-9. ...
spookikitti's user avatar
2 votes
1 answer
465 views

How to read stdin keys in rust with termion using dynamic char values?

I have the following code to read user input keys from terminal using termion use std::io::{stdin, stdout}; use termion::event::Key; fn main() { let mut stdout = stdout().into_raw_mode().unwrap();...
Slava.In's user avatar
  • 931
0 votes
1 answer
502 views

c function getline includes the '\n' character

Is there a way to not get in my string the new line character when using getline(&string, &len, stdin)? Or someone know a way to get input from stdin? I'm using C11 with the gcc compiler Any ...
Proth's user avatar
  • 39
0 votes
1 answer
246 views

User input function C

User input function C Hi all! I've got a problem with reading user input from a console. I am trying to implement function that reads and allocates memory from the console in chunks. First issue First ...
Muszo's user avatar
  • 3
1 vote
1 answer
85 views

How to prevent users from pressing key too early in a reaction time test

I try to make a reaction time test in python. The code works fine but users can press enter key too early which results in their reaction time being 0.0. Code import time import random print('When ...
Ultra Legend's user avatar
1 vote
1 answer
405 views

Taking string input of exact size from stdin in C

I've written a function that requires the user to enter a string of size 13, 15, or 16. The function keeps looping till the required length is entered. I am new to C. This function is part of one of ...
kbl's user avatar
  • 169
1 vote
0 answers
35 views

Function inputElements() taking input only once

I am trying to create a program to find the transpose of a matrix my dynamic memory allocation. However, while entering the elements of the matrix I can't input more than one element, its only taking ...
Mir Miracle's user avatar

15 30 50 per page
1
2 3 4 5
13