I want to create this multi-line function call. The examples that I find for nested constructs they assume that there is a character starting each line i Cannot find an example where a bracket [
is followed by a parenthesis (
without anything in between.
So how would I format this:
JavaScript
x
5
1
subprocess.run(['docker-compose', '-f', 'docker-compose.test.yml', '-f',
2
'docker-compose.services.yml', '-f', 'docker-compose.dev.yml', 'down'],
3
stdout=subprocess.DEVNULL
4
)
5
where should the bracket go? How should i format the list of arguments? Is it ok if I have multiple on the same line? Or should each argument has its own line
Advertisement
Answer
You can do something like this
JavaScript
1
10
10
1
import subprocess
2
3
subprocess.run(
4
[
5
'docker-compose', '-f', 'docker-compose.test.yml', '-f',
6
'docker-compose.services.yml', '-f', 'docker-compose.dev.yml', 'down'
7
],
8
stdout=subprocess.DEVNULL
9
)
10