Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Output to a zip
#1
I tried to do some searching, however I was unable to find how to do this. I wanted to see if anyone has any suggestions on this. I am trying to get the output of this program to end up in a zip file. Thank you

import base64
from github import Github
from pprint import pprint
from shutil import make_archive
from zipfile import ZipFile
file = "github-repo"  # zip file name
directory = "output"

# Github username
name = input()
username = name
# pygithub object
g = Github()
# get that user by username
user = g.get_user(username)

for repo in user.get_repos():
    print(repo)
make_archive(file, "zip", directory)  # zipping the directory
Yoriz write Mar-10-2022, 06:27 AM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Output to a zip - by keyboardkomando - Mar-10-2022, 04:11 AM
RE: Output to a zip - by DeaD_EyE - Mar-10-2022, 10:39 AM
RE: Output to a zip - by keyboardkomando - Mar-10-2022, 04:48 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020