In python, it\'s common to have vertically-oriented lists of string. For example:
subprocess.check_output( [
\'application\',
\'-first-flag\',
\'-secon
maybe for this particular case:
arglist = 'application -first-flag -second-flag -some-additional-flag'
arglist = arglist.split()
subprocess.check_output(arglist)
Or if you find yourself writing many unique lists like this make a macro that concatenates lines into a list form, so you avoid manually putting the comma.
Here's another alternative:
subprocess.check_output('''
application
-first-flag
-second-flag
-some-additional-flag
'''.split())
Let Python insert the commas for you, this is especially useful for long lists of strings in configuration files
You can have commas at the end of a line after whitespace, like this:
subprocess.check_output( [
'application' ,
'-first-flag' ,
'-second-flag' ,
'-some-additional-flag' ,
] )
Doing it that way looks a little worse, but it is easy to spot if you have missed any arguments.
You could wrap each string in parens:
subprocess.check_output( [
('application'),
('-first-flag'),
('-second-flag'),
('-some-additional-flag'),
] )
And btw, Python is fine with a trailing comma, so just always use a comma at the end of the line, that should also reduce errors.