Skip to content

Instantly share code, notes, and snippets.

@tadone
Created October 16, 2017 11:31
Show Gist options
  • Save tadone/3cd63ded8d42649da7877fe9eb67b837 to your computer and use it in GitHub Desktop.
Save tadone/3cd63ded8d42649da7877fe9eb67b837 to your computer and use it in GitHub Desktop.
[Read password lines from file] Read values #python
# Use this format
# username:value
# password:value
# Assuming no : characters in your usernames or passwords
with open('myfile.txt') as f:
credentials = [x.strip().split(':') for x in f.readlines()]
for username,password in credentials:
# your code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment