3

I'm trying to create a program in python that will get 2 inputs from 2 different locations e.g. 2 command prompts

import threading
def function1():
    someinput=input("input1")
    print(someinput)

def function2():
    anotherinput=input("input2")
    print(anotherinput)

thread1 = threading.Thread(target=function1())
thread1.start()
thread2 = threading.Thread(target=function2())
thread2.start()

i want it to ask me for input 1 in one command prompt and input 2 in another and then input 1 should be printed to the first command prompt and input 2 to the second.

codingcat3423
  • 121
  • 1
  • 7
  • 1
    You can only use one console at a time [reference](https://stackoverflow.com/q/39997081/7690862) – Jake P Jul 18 '19 at 15:37
  • is there somewhere else I could get an input from? – codingcat3423 Jul 18 '19 at 15:37
  • 1
    You could try using a GUI or check out [this answer](https://stackoverflow.com/a/19797600/7690862) as well – Jake P Jul 18 '19 at 15:40
  • why can't you get the inputs one after the other? – Matt Ellen Jul 18 '19 at 15:43
  • @MattEllen I want it so you can answer it in any order. you dont have to give it the first input before you can give it the second input – codingcat3423 Jul 18 '19 at 15:45
  • I think the simplest way to meet the spirit of what you're trying to achieve, might be to use a dict to store your inputs, and parse the key from the input itself. Depending on your needs, the input might be called in a loop until all the keys you need have been stored. – Amir Almusawi Jul 18 '19 at 15:56

0 Answers0