8000 two python scripts updated · optimist2309/python-scripts@daa89fb · GitHub
[go: up one dir, main page]

Skip to content

Commit daa89fb

Browse files
committed
two python scripts updated
1 parent cb448c2 commit daa89fb

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
< 8000 div class="ml-1 text-small text-bold fgColor-danger">-0
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@
3434
1. **32_stock_scraper.py**: Get stock prices
3535
1. **33_country_code.py**: Convert country code to country name
3636
1. **34_git_all_repos.py**: Clone all repositories from a public user or organization on Github. Usage: `python git_all_repos.py users USER_NAME` or `python git_all_repos.py orgs ORG_NAME`
37+
1. **35_qr_code.py**: Convert user input text to qr code image
38+
1. **36_git_repo_creator.py**: Create github repo from command line.

scripts/git_repo_creator.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Script Name : git_repo_creator.py
2+
# Author : Harish Tiwari
3+
# Created : 2nd October 2020
4+
# Last Modified : -
5+
# Version : 1.0.0
6+
7+
# Modifications :
8+
9+
# Description : This python script will create a github repo from command line.
10+
11+
import requests
12+
import json
13+
14+
user_name = input("Enter your github user name: ")
15+
print(user_name)
16+
17+
github_token = input("Enter your github tokne: ")
18+
print(github_token)
19+
20+
repo_name = input("Enter your repo Name: ")
21+
print(repo_name)
22+
23+
repo_description = input("Enter your repo description: ")
24+
print(repo_description)
25+
26+
payload = {'name': repo_name, 'description': repo_description, 'auto_init': 'true'}
27+
repo_request = requests.post('https://api.github.com/' + 'user/repos', auth=(user_name,github_token), data=json.dumps(payload))
28+
if repo_request.status_code == 422:
29+
print("Github repo already exists try wih other name.")
30+
elif repo_request.status_code == 201:
31+
print("Github repo has created successfully.")

scripts/qr_code.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pyqrcode
2+
import png
3+
from pyqrcode import QRCode
4+
5+
6+
user_input = raw_input("Enter web page address or info you want to convert into qr code: ")
7+
user_input = pyqrcode.create(user_input)
8+
user_input.png('myqr.png', scale = 6)

0 commit comments

Comments
 (0)
0