Skip to content

Update to Run Fully Create.py #8

Description

@ctv99

import sys
import os
from github import Github

path = "/home/cstevens/Documents/Code/"

username = "" #Insert your github username here
password = "" #Insert your github password here
password2 = "" #Insert your github web formated password here

def create():
folderName = str(sys.argv[1])
os.makedirs(path + str(sys.argv[1]))
user = Github(username, password).get_user()
repo = user.create_repo(sys.argv[1])
os. chdir(path + str(sys.argv[1]))
with open("README.md", "w") as text_file:
print("#Demo")
os.system("git init")
os.system("git add README.md")
os.system("git commit -m 'first commit'")
os.system("git remote add origin https://github.com/{0}/{1}.git".format(username,sys.argv[1]))
os.system("git push https://{0}:{1}@github.com/{0}/{2}.git --all".format(username,password2,sys.argv[1]))
print("Succesfully created repository {}".format(sys.argv[1]))

if name == "main":
create()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions