why can't I do something like this:
files = [file for file in ['default.txt'].append(sys.argv[1:]) if os.path.exists(file)]
list.append doesn't return anything in Python:
>>> l = [1, 2, 3]
>>> k = l.append(5)
>>> k
>>> k is None
True
You may want this instead:
>>> k = [1, 2, 3] + [5]
>>> k
[1, 2, 3, 5]
>>>
Or, in your code:
files = [file for file in ['default.txt'] + sys.argv[1:] if os.path.exists(file)]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With