Simple code and suggestion

g thakuri gbpal13 at gmail.com
Wed Nov 30 08:26:21 EST 2016


Dear Python friends,

I have a simple question , need your suggestion the same

I would want to avoid using multiple split in the below code , what options
do we have before tokenising the line?, may be validate the first line any
other ideas

 cmd = 'utility   %s' % (file)
 out, err, exitcode = command_runner(cmd)
 data = stdout.strip().split('\n')[0].split()[5][:-2]

Love,
PT



More information about the Python-list mailing list