3
Would anyone know how to print a tuple as follows:
  amount_of_commits,author  
  148, Steve Ellis     
  2, Alex Kwiatkowski   
  2, Thomas  
  1, Dan Forbes  
  1, David Parker  
  1, John Barker  
  1, Thomas Hodges  
  1,dependabot[bot]  
The return I’m getting is from command git shortlog -s -n whose code is below:
for token in tokens:
insights = open("repositories_insights/" + token + "_insights.csv", "w")
insights.write("amount_of_commits,author\n")
   
data = subprocess.Popen(["git", "-C", "github_repos/" + token + "/" + token, "shortlog",  "-s", "-n"], stdout=subprocess.PIPE).communicate()
print(str(data))
insights.write(data)
insights.close()
When printing tuple value data the result is as follows:
(b'   148\tSteve Ellis\n     2\tAlex Kwiatkowski\n     2\tThomas\n     1\tDan Forbes\n     1\tDavid Parker\n     1\tJohn Barker\n     1\tThomas Hodges\n     1\tdependabot[bot]\n', None)
Thank you very much, it helped a lot :)
– Alan Rodrigues Chaves