Created
March 13, 2015 00:43
-
-
Save deadPix3l/9a3061711a9ff70730fe to your computer and use it in GitHub Desktop.
popen3 loops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
#define x and y here i guess | |
for i in xrange(x,y): | |
(out, err) = os.popen3('cmd -s %s --switch2 %s' %(i, blah))[1:] | |
#Note: [1:] excludes [0], stdin, because I don't care for it. | |
#printing out to outfile and err to .errfile goes here | |
#code excluded because its not the main focus here | |
#authors note to self: | |
#add i to err before printing | |
#to track which iteration caused errors | |
#note: can also be used before printing to .errfile to clean logs of known "ehh no big deal" errors | |
#search err for Keyword(s) | |
if 'Keyword' in err: | |
print str(i) +' Keyword' #alerts to errors without digging through the log | |
else: print i #keeps track of progress | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment