← 返回首页
two python scripts updated by optimist2309 · Pull Request #21 · realpython/python-scripts · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .py  (2) All 2 file types selected Viewed files
Conversations
Failed to load comments. Retry
Loading
Jump to
Jump to file
Failed to load files. Retry
Loading
Diff view
Unified
Split
Hide whitespace
Apply and reload
Show whitespace
Diff view
Unified
Split
Hide whitespace
Apply and reload
2 changes: 2 additions & 0 deletions readme.md
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@
1. **32_stock_scraper.py**: Get stock prices
1. **33_country_code.py**: Convert country code to country name
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`
1. **35_qr_code.py**: Convert user input text to qr code image
1. **36_git_repo_creator.py**: Create github repo from command line.
31 changes: 31 additions & 0 deletions scripts/git_repo_creator.py
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Script Name : git_repo_creator.py
# Author : Harish Tiwari
# Created : 2nd October 2020
# Last Modified : -
# Version : 1.0.0

# Modifications :

# Description : This python script will create a github repo from command line.

import requests
import json

user_name = input("Enter your github user name: ")
print(user_name)

github_token = input("Enter your github tokne: ")
print(github_token)

repo_name = input("Enter your repo Name: ")
print(repo_name)

repo_description = input("Enter your repo description: ")
print(repo_description)

payload = {'name': repo_name, 'description': repo_description, 'auto_init': 'true'}
repo_request = requests.post('https://api.github.com/' + 'user/repos', auth=(user_name,github_token), data=json.dumps(payload))
if repo_request.status_code == 422:
print("Github repo already exists try wih other name.")
elif repo_request.status_code == 201:
print("Github repo has created successfully.")
8 changes: 8 additions & 0 deletions scripts/qr_code.py
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pyqrcode
import png
from pyqrcode import QRCode


user_input = raw_input("Enter web page address or info you want to convert into qr code: ")
user_input = pyqrcode.create(user_input)
user_input.png('myqr.png', scale = 6)
Toggle all file notes Toggle all file annotations

Footer

© 2026 GitHub, Inc.