From a config file, I would like to iterate over a list that contains users
, repositories
, and a password
and then assign those values to variables to create a repository object using github3.py.
The user
and repo_name
lists will not be equal length. For now, there's two users and several repos, but this can change over time. I've tried to use zip
, but it is only working if the lists are the same length. I would like for it to keep the last value in the user
list and map that with the last repo in the repo_name
list (user2,repo3
).
user = ["user1","user2"]
repo_name = ["repo1","repo2","repo3"]
password = "xxxxxxxxx"
The code below is where I would like to use those values.
from global_var import *
for users, repos in zip(user, repo_name)
gh = login(users, password)
repo = gh.repository(users, repos)
list_all_prs()