Why does python output this b and newline characters and how can I may it return just what I need, the number 8 w/no special characters? See below. I tried str(scratch), but no go, still prints that garbage.
#!/bin/env python3 cmdstr = "/usr/bin/dsmadmc" id = "-id=dereksmith" pw = "-password=xxxx" do = "-dataonly=yes" from subprocess import check_output scratch = check_output( [ cmdstr, id, pw, do, "select", "count(*)", "from", "libvolumes", "where", "status='Scratch'", "and", "library_name='TS3200'" ] ) print (scratch) __OUTPUT__ # ./ts3200_scratchcount_check.py email sent successfully b' 8\n' Thx!! Derek Smith | Unix/TSM Administrator | Racksquared Data Centers :: [email protected] *: www.racksquared.com<http://www.racksquared.com/> | www.racksquared.jobs<http://www.racksquared.jobs/> [cid:[email protected]] _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
