user-input

Can't enter a variable in DOS

a 夏天 提交于 2020-06-08 20:00:12
问题 I'm trying to run a batch file in vDOS (DOS emulator), where I want the user to input two variables. Every time I run the file, it doesn't let me enter the variables. SET /P in=Input: SET /P out=Output: What I expected to happen was that It'd let me enter the input for the variables. Instead, it executes both of the commands as they are (without letting me enter the input). 回答1: Windows cmd and MS-DOS are very different things and one of the differences is the set command. In MS-DOS the only

How can I read multiple (variable length) arguments from user input and store in variables and pass it to functions

落花浮王杯 提交于 2020-05-30 08:41:29
问题 Trying to create a calculator, which can take variable length of integers separated by space. I am able to create a basic calculator that would read two args and do operations. Below is what I am trying to achieve. select operation: Add Enter nos: 1 65 12 (this length can increase and any variable lenght of integers can be given) I am not sure how would I pass this variable length of int to functions, suppose addition function. I can do it for two variables. Adding what I am aware of: x =

Python - How to make user input not case sensitive?

吃可爱长大的小学妹 提交于 2020-05-29 10:14:48
问题 I'm new to Python and could really use some help on this. I want to create a function to filter which files I want to open and which months and day specifically. That way, the users need to input which city(files) they want to analyze on which particular month or day. However, I want the user to be able to input something that is not case sensitive. For example, the user can input 'chicago'/'CHICAGO"/"ChIcAgO" and the it still give you the right output and not the error handling message. Here

How to pass user input to constructor in java

安稳与你 提交于 2020-04-18 05:49:08
问题 So I was just testing some things out first before I do my actual homework. My goal is to have the user enter his/her name, course, and student number, right? now the activity said to have a "student" object. now, I want to pass those user inputs to the constructor and display it. unfortunately, there is an error "non-static variable cannot be referenced" (this is my first time getting this error) Also, I kinda based my on this post here: Can I pass user input to my constructor any help would

Java Math.min Math.max Errors

心不动则不痛 提交于 2020-03-25 22:01:50
问题 My goal is to have the java program receive input from a user, display the inputted number, between 1 and 5. So if a user enters a number greater than 5, it shows as 5, and if the number is lower than 1, it shows as 1. However the program is only showing an output of 1 regardless of the number entered. import java.util.Scanner; public class TestMax { int minNum = 1; int maxNum = 5; public int inputNum() { Scanner userInput = new Scanner(System.in); int userinput = Integer.parseInt(userInput

How to have a user select a value from array and pass that into a variable in KSH

僤鯓⒐⒋嵵緔 提交于 2020-03-06 07:23:06
问题 Overview: I would like my KSH script to test for the presence of certain files in a directory, present the user with a list of those files along with a number. The user then chooses the number they want and the relevant value from the array is assigned to a variable. So far I have the following: ### Create test files in directory #### touch ABCDEF.jar touch BCDEFG.jar touch CDEFGH.jar touch DEFGHI.jar touch EFGHIJ.jar touch FGHIJK.jar touch GHIJKL.jar set -A JARS ` ls -1 | grep .jar | cut -d'

How to have a user select a value from array and pass that into a variable in KSH

Deadly 提交于 2020-03-06 07:23:05
问题 Overview: I would like my KSH script to test for the presence of certain files in a directory, present the user with a list of those files along with a number. The user then chooses the number they want and the relevant value from the array is assigned to a variable. So far I have the following: ### Create test files in directory #### touch ABCDEF.jar touch BCDEFG.jar touch CDEFGH.jar touch DEFGHI.jar touch EFGHIJ.jar touch FGHIJK.jar touch GHIJKL.jar set -A JARS ` ls -1 | grep .jar | cut -d'

How do I store user input from three different variables in a function and into a structure? [closed]

倖福魔咒の 提交于 2020-03-04 18:37:00
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 days ago . I am struggling to explain this. I need help understanding how to make a program where a user inputs information for a address and it is stored in a address book. I am using structures for three variables for the name, amount, notes but I am not sure how to save those values to the arrays in the

Wait set time for user input C# console app

不想你离开。 提交于 2020-02-20 05:27:02
问题 For a Console app, I need to know how to wait at set amount of time (about 10 seconds), for a user to input a key or set of keys, before proceeding with an 'auto run' portion of the application. This is bugging me because I can't quite figure out how the timer works, or threading.sleep, what should I use? Been googling all day. some psuedocode: 1.app opens 2.app waits 10 secs for user to hit the "k" key. 3.if user hits k, go to 4. if user does not, go to 5. 4.run a function(open a form) 5.run

How to provide credentials as user input runtime during python automation?

时光怂恿深爱的人放手 提交于 2020-02-15 06:50:25
问题 How to automate the Facebook login without hard-coding my username and password? 回答1: To automate the Facebook Login without hard-coding the username and password you can use the input() function to take the user input from the console as follows : from selenium import webdriver driver = webdriver.Firefox(executable_path=r'C:\Utility\BrowserDrivers\geckodriver.exe') driver.get("https://www.facebook.com/") emailid = input("What is your emailid?(Press enter at the end to continue):") driver