Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f30793a

Browse files
committed
Fix PEP-8 violation in argparse usage example (similar examples in argparse.rst do follow PEP-8)
1 parent d7cde5d commit f30793a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Doc/whatsnew/3.2.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ or more positional arguments is present, and making a required option::
100100

101101
import argparse
102102
parser = argparse.ArgumentParser(
103-
description = 'Manage servers', # main description for help
104-
epilog = 'Tested on Solaris and Linux') # displayed after help
103+
description='Manage servers', # main description for help
104+
epilog='Tested on Solaris and Linux') # displayed after help
105105
parser.add_argument('action', # argument name
106-
choices = ['deploy', 'start', 'stop'], # three allowed values
107-
help = 'action on each target') # help msg
106+
choices=['deploy', 'start', 'stop'], # three allowed values
107+
help='action on each target') # help msg
108108
parser.add_argument('targets',
109-
metavar = 'HOSTNAME', # var name used in help msg
110-
nargs = '+', # require one or more targets
111-
help = 'url for target machines') # help msg explanation
109+
metavar='HOSTNAME', # var name used in help msg
110+
nargs='+', # require one or more targets
111+
help='url for target machines') # help msg explanation
112112
parser.add_argument('-u', '--user', # -u or --user option
113-
required = True, # make it a required argument
114-
help = 'login as user')
113+
required=True, # make it a required argument
114+
help='login as user')
115115

116116
Example of calling the parser on a command string::
117117

0 commit comments

Comments
 (0)