I have a list of files in the same directory that are systematically named, eg. 'test01.ext','test02.ext','test03.ext'...'test99.ext'. I want to, in Python, pass a certain range of these files to a loop. However, I want to be able to determine which files I want to loop in a command line, eg. 'test45.ext' to 'test62.ext'. How would I do this?
Currently I’m using the following code:
for fname in sys.stdin :
Some_loop(fname)
How would I choose (without manually entering all files from eg. 45 to 62) a range of files when prompted?
Thanks!
1 Answer