Python Forum

Full Version: auto supply values to a python script(function) from text file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to provide values to my python script which is asking for the following prompts.
TotalPeople = int(input("Please enter number: "))
Min = int(input("Please enter min value: "))
Max = int(input("Please enter max value: "))
MaxMil = int(input("Please enter max value: "))
MinMil = int(input("Please enter min value: "))
Ms = int(input("Please enter number of Ms: "))

I want to supply the following values in this order only.

30 10 20 15 10 0
30 10 20 15 10 1
30 10 20 15 10 2
30 10 20 15 10 3
30 10 20 15 10 4
29 10 20 15 10 0
29 10 20 15 10 1
29 10 20 15 10 2
29 10 20 15 10 3
29 10 20 15 10 4
28 10 20 15 10 0
................
................
................
1 10 20 15 10 0
1 10 20 15 10 1
1 10 20 15 10 2
1 10 20 15 10 3
1 10 20 15 10 4


How do I do this ?
Thanks
show script
What do you mean bye supply values from text file?
Do want to read theses values from a text file?
Now only store user input in variables.
And use Code tags
I do not want to manually enter those values.
As you see I need to enter them 150 times starting from 30...1
So is there a way I can have those 150 lines of user input into the code automatically?
Thanks
Override sys.stdin.