Python debug configuration launch.json example

Requirement description: VScode connects to the server for remote development, requires configuring a debugging environment, and requires passing in commands and file paths. The command to run is Python main. py run -- debug PATh1, PATH2, where debug is a bool value. The configuration method is as follows:

{-->.

" Version:" 0.2.0;

" Configurations: [.

{-->.

" Name":" Start casually;

" Type:" Python;

//" Request":" Launch;

" Request":" Launch;

" LocalRoot":" @{workspaceRoot}"

" RemoteRoot":"/ Home/wuxing/codespace/dp"

" Port: 22.

" Host:" XX XX XX. 1"# My remote host IP.

" Program":"/ Home/wu/codespace/dp/main. py"

//" Console:" IntegratedTerminal;

//" JustMyCode": True.

" Args: [.

" Run"

"/ Home/wu/codespace/dp/par. json"

"/ Home/wu/codespace/dp/m. json"

"-- Debug"

].

}.

].

}.

Parameter parsing in code:

#Run.

Parser_Run= Subparsers.add_Parser(.

" Run"

Help=" Main process of Deep Potential Generator").

Parser_Run.add_Argument (PARAM, type str.

Help=" Parameter file, JSON/YAML format").

Parser_Run.add_Argument (Machine, type str.

Help=" Machine file, JSON/YAML format").

Parser_Run.add_Argument (- d, -- debug, action);

Help=" Log debug info.

Parser_Run. set_Defaults (fun= gen_run).

Action' Store_True; If -- debug or - d is passed in, then the value of this variable is true.