Python Forum
auto supply values to a python script(function) from text file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
auto supply values to a python script(function) from text file
#1
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
Reply
#2
show script
Reply
#3
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
Reply
#4
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
Reply
#5
Override sys.stdin.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Script that alternates between 2 text messages DiscoMatic 1 513 Dec-12-2023, 03:02 PM
Last Post: buran
  Replace a text/word in docx file using Python Devan 4 3,222 Oct-17-2023, 06:03 PM
Last Post: Devan
  Python script that deletes symbols in plain text nzcan 3 686 Sep-05-2023, 04:03 PM
Last Post: deanhystad
  save values permanently in python (perhaps not in a text file)? flash77 8 1,187 Jul-07-2023, 05:44 PM
Last Post: flash77
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,164 Jun-29-2023, 11:57 AM
Last Post: gologica
  Python Script to convert Json to CSV file chvsnarayana 8 2,487 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Adding values with reduce() function from the list of tuples kinimod 10 2,623 Jan-24-2023, 08:22 AM
Last Post: perfringo
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,105 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  How to modify python script to append data on file using sql server 2019? ahmedbarbary 1 1,211 Aug-03-2022, 06:03 AM
Last Post: Pedroski55
  Writing into 2 text files from the same function paul18fr 4 1,667 Jul-28-2022, 04:34 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020