Last active
February 5, 2016 05:27
-
-
Save Node0/52559302d1083625b4cc to your computer and use it in GitHub Desktop.
business@node-0.com
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
#!/usr/bin/env python | |
import os; | |
import sys; | |
def printf(fmt, *varargs): | |
sys.stdout.write(fmt % varargs) | |
domainListFile = "/root/acctWorkFiles/domainList.txt"; | |
userListFile = "/root/acctWorkFiles/userList.txt"; | |
passwordListFile = "/root/acctWorkFiles/passwordList.txt"; | |
dlHandle = open(domainListFile); | |
ulHandle = open(userListFile); | |
plHandle = open(passwordListFile); | |
domainList = [domListItem.rstrip('\n') for domListItem in dlHandle]; | |
userList = [usrListItem.rstrip('\n') for usrListItem in ulHandle]; | |
passwordList = [passListItem.rstrip('\n') for passListItem in plHandle]; | |
dlHandle.close(); ulHandle.close(); plHandle.close(); | |
for i in range(len(domainList)): | |
printf("%s:", domainList[i]); | |
printf("%s:", userList[i]); | |
printf("%s\n", passwordList[i]); |
Nice, were you going for number of lines saved?
I actually wrote arrayLoops.py as an excercise in
how to write self documenting code i.e. Make things obvious
to a non-python programmer.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bored at the NOC, so code...