I want to:
As the title says,
run something such as:
python3 program.py [~/home/me/Documents/*.txt]
and I would get
['text1.txt', 'text2.txt', ... , 'textn.txt']
Solutions I found online:
A lot of solutions I found online included using fileinput.input() and sys.argv. The problem is that I am not correctly implementing those solutions (I am a complete noob at Python).
Here's the most promising solution:
import fileinput
for line in fileinput.input():
process(line)
but it keeps telling me that "process is not defined" - - I have yet to find a solution.
Another solution is sys.argv[0]. but it keeps telling me that the list index is out of range.
EDIT: This solution doesn't go over command line argument for python. This is what I'm mostly having trouble with.