I have some python script
def task(start, stop):
#"doing something with start and stop"
return
if __name__ == '__main__':
print ("input start, stop")
start = int(input())
stop = int(input())
task(start,stop)
I run my script by CMD command "python task.py" If I input
start = 1 and stop = 1000
My script running very slow. I could open 10 CMD windows then input
start = 1, stop = 10 in CMD first
start = 11, stop = 20 in CMD second
... and finally start = 90, stop = 100 in final CMD
How can I write a BAT file to run instead of open 10 CMD windows then input by myself.
startandstopvalue as options on command line and would prompt the user for thestartand/or thestopvalue only if the appropriate argument was not specified on Python script command line. That would make it possible to use a batch file with a FOR loop much easier. For example, see Command Line Arguments in Python.python.exefor interpreting your Python script with suitablestartandstopvalues not more often than the number of cores of your CPU minus 1. One core should be reserved for Windows and all other running processes and the other 1 to X cores can be used to run 1 to Xpython.exe task.py start=n stop=mor(echo n& echo m) | python.exe task.pyif the Python script is not enhanced to support optional arguments forstartandstopvalues.