Skip to content

Instantly share code, notes, and snippets.

@CodeMaster7000
CodeMaster7000 / Repo-Stars.py
Created February 15, 2023 12:30
A Python program to print the number of stars a Github repo has.
from github import Github
g_cred = Github("<Paste Your Token Here>")
f_repo = input("Enter repository name to see its stars (eg. user/repo): ")
repo = g_cred.get_repo(f_repo)
print(repo.stargazers_count)
@CodeMaster7000
CodeMaster7000 / Sine Wave Graph.py
Last active February 15, 2023 16:42
A Python graph coded with matplotlib to visualise a sine wave.
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-np.pi,np.pi,100)
y = np.sin(x)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.spines['left'].set_position('center')
ax.spines['bottom'].set_position('center')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')