mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-28 06:21:09 +00:00
922ad6db8b
* add yts_torrents project (#116) * add yts_torrents project * Added Python Script HacktoberFest 2019 (#128) * Added whatsapp-message Script * Update README.md * Script: Importance Checker (Updated Project List) (#132) * Add files to fork * Update README.md * Fixed ToDoBot link (#133) To Do bot link was using "-" instead of %20 Changed path to folders Removed full repo path to folders to make project robust to cloning as discussed on issue #139 on [AzureNotebooks](https://github.com/Microsoft/AzureNotebooks/issues/193). Fixed clean up photo directory name Fixed file organizer link Script: Importance Checker (Updated Project List) (#132) * Add files to fork * Update README.md Squash Squash Fixed ToDoBot link To Do bot link was using "-" instead of %20 parent 7c58b564104cdd1990492276292f04ec19009e57 author MatTerra <mateus.b.s.terra@gmail.com> 1574710004 -0300 committer MatTerra <mateus.b.s.terra@gmail.com> 1574710650 -0300 Squash Fixed ToDoBot link To Do bot link was using "-" instead of %20 Squash Changed path to folders Removed full repo path to folders to make project robust to cloning as discussed on issue #139 on [AzureNotebooks](https://github.com/Microsoft/AzureNotebooks/issues/193). Fixed ToDoBot link To Do bot link was using "-" instead of %20 Script: Importance Checker (Updated Project List) (#132) * Add files to fork * Update README.md * All changes made : Script added (#130) * Added whatsapp-message Script * Update README.md Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Revert "All changes made : Script added (#130)" (#135) This reverts commit74de9279f7
. * Add MIT license for project (#122) Signed-off-by: Kaushlendra Pratap <kaushlendrapratap.9837@gmail.com> * Add files via upload (#120) * Bump requests from 2.18.4 to 2.20.0 in /Tweets_Tool (#137) Bumps [requests](https://github.com/psf/requests) from 2.18.4 to 2.20.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.18.4...v2.20.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump urllib3 from 1.22 to 1.24.2 in /Tweets_Tool (#136) Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.22 to 1.24.2. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/master/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.22...1.24.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Added Image Recognition Script (#109) * Added face recognition script * Updated README Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Instagram Video Downloader (#94) * Instagram Video Downloader downloads all the videos from instagram post * Update README.md Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Wikipedia-Search (#87) * Create pywikisearch.py * Create README.md * Update README.md * Update README.md * Update README.md * Update pywikisearch.py * Create requirements.txt (#1) Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Added PX to REM, REM to Px as command line tools (#82) Co-authored-by: Atthaphon Urairat <aurairat@inetasia.com> Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Added an SSH host adder script, which allows you to add hosts to your ssh config file. (#76) Co-authored-by: NinoCosmic <nikola.dokoski@cosmicdevelopment.com> Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Added RSA Algorithm used in cryptography (#61) * Added RSA Algorithm * Update README.md * Create README.md * Update README.md * Add files via upload * Update README.md * Added RSA Algorithm Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * fix table allignment * python script which creates a map in html showing realtime covid stat… (#138) * python script which creates a map in html showing realtime covid status in india * remove extra space; fix allignment Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * fix to covid visualiser, sometimes deaths are null (#139) * Update README.md * Added a Random_Email_Generator to the list of projects! (#141) * Added Random Email Generator Python Script * Create README.md * Update README.md * Update Random_email_generator.py * Update Random_email_generator.py * Update README.md * Added Random Email Generator Python Script Co-authored-by: shub-garg <shubhamsgcool@gmail.com> * Ansh's Dictionary (#142) Added a project of English Theasauras * sudoku-solver (#144) * Update file-organizer.py * Update README.md * Add greeting.yml file * Add PR template for the project * update greetings.yml * update greetings.yml * Rename pull_request_template.md to PULL_REQUEST_TEMPLATE.md * Update greetings.yml * Delete greetings.yml * Added Py_Cleaner (#162) * Update README.md * Added Py_Cleaner * Toonify Scripts (#154) * Toonify Script Added * Update README.md * Update toonify-API-2.py * Added git automation to repo (#171) Added gitAutomation to README.md refactoring * Added Fibonacci_Sequence_Generator and updated main README.md accordingly (#173) * Tambola tickets generator (#169) * Adds utility to generate Tambola tickets * Adds utility to generate Tambola tickets * Added script to send messages to sqs in parallel (#165) * Added script to send messages to sqs in parallel * Update README.md * Added Codeforces Checker Python Script (#176) * python script to create github repo (#178) * Added python script to remove duplicate files from a directory (#179) * create script * create README.md * updated README.md * updated README.md * added batch image watermarker (#184) * added batch image watermarker * Create README.md * Update README.md to include project * add script for convert pdf to text (#183) Co-authored-by: pham.huu.quang <SUN-ASTERISK\pham.huu.quang@b121686-lt.sun-asterisk.com> * Update README.md * url_shortener files were added (#191) url_shortener.py skel was created the script has completed README.md description and requirements.txt were added The project was added to README.md * Python script to view wifi password. (#163) * Added wifi.py * Delete main.py * Create wifi_password.py * Create requirements.txt * Create README.md * Rename wifi_password.py to main.py * Update README.md * Update README.md Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Added Python made News Generator HackerNews (#174) * IMDB list querier project by Burak Bekci (#187) Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Added a Folder Manger Script. (#188) * Added Folder_Manager * Added Name to README.md Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Update README.md * Simple 2048 GUI tkinter game in Python3 (#194) * Simple 2048 GUI tkinter game in Python3 * added contributor to readme file * added elastic-snapshot script (#193) * added elastic-snapshot script * added project to the projects list * updated requirements.txt * Download page as pdf (#196) * Download page as PDF. * Contributor name. * Pudim page typo. * Added spotify downloader (#195) Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Github CLI tool added. (#198) * GithubBot added * add new project * Update README.md * Update README.md * Added Independent RSA Communication Algorithm (#199) * Added an indepedent RSA library Added an indepedent RSA library with no depedences (adapted to communication) * Created README.md Created README.md * Update README.md * Added project to README.md Added project "Independent RSA Communication Algorithm" to README.md Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Bump cryptography from 2.7 to 3.2 in /file-encrypt-decrypt (#201) Bumps [cryptography](https://github.com/pyca/cryptography) from 2.7 to 3.2. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/2.7...3.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add TranslateCLI (#200) * Added automation for converting JSON to YAML format. (#197) * Added automation for converting json to yaml format * Create Readme.md * Deletd the extra files * Added requirements.txt * Added name and project in project list Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Rock-Paper-Scissor Game (#202) * Rock-Paper-Scissor-Game * updated README.md * Add instagram link * remove quora link * add portfolio * update: portfolio (#208) * fix(README): remove msg from last commit * New Project (#206) * Added folder locker and hider * Update README.md * Bump py from 1.9.0 to 1.10.0 in /file-encrypt-decrypt (#209) Bumps [py](https://github.com/pytest-dev/py) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/pytest-dev/py/releases) - [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/py/compare/1.9.0...1.10.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump cryptography from 3.2 to 3.3.2 in /file-encrypt-decrypt (#210) Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.3.2. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/3.2...3.3.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump urllib3 from 1.24.2 to 1.26.5 in /Tweets_Tool (#212) Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.24.2 to 1.26.5. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.24.2...1.26.5) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump urllib3 from 1.25.11 to 1.26.5 in /Github_Bot (#213) Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.11 to 1.26.5. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.25.11...1.26.5) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Added Image Compressor Script (#211) * Added Readme.md Gave a description of the project * Added Image_Compressor Added image compressor script and a sample image to compress the image file to a reduced size. * Updated README.md Added my name in Contributors list. * Created a Speed checking script in python 3 named TestMyInternetSpeed (#214) * speedtest using python * main python script for checking speeds * Add files via upload * Delete TestMySpeed.py * Delete requirements.txt * Delete README.md * Update README.md * Update README.md * Revert "Delete README.md" This reverts commit8d14c3b3e6
. reverted the accidentally commited readme file commit * added the readme file i deleted accidentally * Update README.md Co-authored-by: Dhruv Bansal <dhruvbansal@Dhruvs-MacBook-Air.local> * Bump requests from 2.18.4 to 2.20.0 in /Tweets_Tool (#215) Bumps [requests](https://github.com/psf/requests) from 2.18.4 to 2.20.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.18.4...v2.20.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump urllib3 from 1.24.2 to 1.26.5 in /Tweets_Tool (#216) Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.24.2 to 1.26.5. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.24.2...1.26.5) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> * Bump requests from 2.18.4 to 2.20.0 in /Tweets_Tool (#217) Bumps [requests](https://github.com/psf/requests) from 2.18.4 to 2.20.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.18.4...v2.20.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add my script PLAGIARISM_DETECTOR to the repo (#218) * AI simulation for guessing the number (#219) * Add files via upload * Create README.md * Create Requirements * Update README.md * Added CSV to Excel writer (#222) * Added Cryptocurrency prices (#223) * Added Cryptocurrency prices * Update README.md * Add the word frequency counter (#225) * Battery notification (#227) * Create Battery_notification.py * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * add Harry Potter Cloak script using Open-CV (#228) * add Harry Potter Cloak script using Open-CV * add Indian Flag using Turtle * Delete README.md * Delete main.py * Update README.md * Update README.md (#146) * Csv_to_json (#224) * Added csv_to_json script * added requirements.txt file * added images * Added README.md * Added my details * Add the website URL detector (#230) * README fix (#231) * Updated README * Images fix * Link fix * fix broken hit counter button (#232) * add awesome repo button (#233) * Added Steg_Tool Script (#234) Co-authored-by: Shankar JP <shankarjp12@outlook.com> Co-authored-by: Mayank Nader <34679965+makkoncept@users.noreply.github.com> Co-authored-by: mukeshprasad <44356982+mukeshprasad@users.noreply.github.com> Co-authored-by: natesabrown <45186473+natesabrown@users.noreply.github.com> Co-authored-by: Mateus Berardo de Souza Terra <mateus.b.s.terra@gmail.com> Co-authored-by: Kaushlendra Pratap <41343571+Kaushl2208@users.noreply.github.com> Co-authored-by: Sarah Floris <sdf94@uw.edu> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LOKESH KHURANA <35563030+theluvvkhurana@users.noreply.github.com> Co-authored-by: Shobhit Bhosure <38807205+shobhit99@users.noreply.github.com> Co-authored-by: Nissaar <34180849+Nissaar@users.noreply.github.com> Co-authored-by: Atthaphon Urairat <u.atthaphon@gmail.com> Co-authored-by: Atthaphon Urairat <aurairat@inetasia.com> Co-authored-by: Nikola Dokoski (Nino) <ninodokoskiot@hotmail.com> Co-authored-by: NinoCosmic <nikola.dokoski@cosmicdevelopment.com> Co-authored-by: Chinmay Rane <chinmayrane16@gmail.com> Co-authored-by: tushar5526 <30565750+tushar5526@users.noreply.github.com> Co-authored-by: joec237 <37048612+joec237@users.noreply.github.com> Co-authored-by: SHUBHAM GARG <52582943+shub-garg@users.noreply.github.com> Co-authored-by: shub-garg <shubhamsgcool@gmail.com> Co-authored-by: Ansh Dhingra <56676059+anshdhinhgra47@users.noreply.github.com> Co-authored-by: ayedaemon <39592651+ayedaemon@users.noreply.github.com> Co-authored-by: Abhishek <55457501+Abhishek-Dobliyal@users.noreply.github.com> Co-authored-by: Chetan Pandey <chetanpandey1266@gmail.com> Co-authored-by: loge1998 <38487437+loge1998@users.noreply.github.com> Co-authored-by: JohnWesleyK <59068112+JohnWesleyK@users.noreply.github.com> Co-authored-by: Synster <amandeepkalra.kalra@gmail.com> Co-authored-by: Jinam Shah <40169508+jinamshah@users.noreply.github.com> Co-authored-by: Jinesh Parakh <50925060+jineshparakh@users.noreply.github.com> Co-authored-by: HARISH KUMAR TIWARI <harishtiwary46@gmail.com> Co-authored-by: Aayushi Varma <59158445+aayuv17@users.noreply.github.com> Co-authored-by: Remco Halman <remco.halman@gmail.com> Co-authored-by: QuangPH <55747283+quangph-1686a@users.noreply.github.com> Co-authored-by: pham.huu.quang <SUN-ASTERISK\pham.huu.quang@b121686-lt.sun-asterisk.com> Co-authored-by: Sam Ebison <ebsa491@gmail.com> Co-authored-by: sagar627 <55939746+sagar627@users.noreply.github.com> Co-authored-by: Atharva Ashok Patil <39415890+Attupatil@users.noreply.github.com> Co-authored-by: Burak Bekci <bekciburak97@gmail.com> Co-authored-by: Harsh Raj <rafftar98@gmail.com> Co-authored-by: gitkp <47073116+gitkp11@users.noreply.github.com> Co-authored-by: Joe <joe@clanryan.us> Co-authored-by: Jeremias Moreira Gomes <j3r3miasmg@gmail.com> Co-authored-by: Abhilasha Sinha <43816262+Abhilasha06@users.noreply.github.com> Co-authored-by: dec0 <35975131+wi6n3l@users.noreply.github.com> Co-authored-by: Rodrigo Oliveira <rodrigo.redcode@gmail.com> Co-authored-by: stark117 <55136108+saksham117@users.noreply.github.com> Co-authored-by: Punit Sakre <punitsakre786@gmail.com> Co-authored-by: Rashmi Singh <72220428+rashmiprabhat567@users.noreply.github.com> Co-authored-by: Prajjwal Pathak <71623767+pyGuru123@users.noreply.github.com> Co-authored-by: Prathima Kadari <kadariprathima4@gmail.com> Co-authored-by: Dhruv Bansal <dhruvbansal237@gmail.com> Co-authored-by: Dhruv Bansal <dhruvbansal@Dhruvs-MacBook-Air.local> Co-authored-by: Akshita Singhal <56424809+akshitasinghal4444@users.noreply.github.com> Co-authored-by: ShadowHunter15 <72161983+ShadowHunter15@users.noreply.github.com> Co-authored-by: Muhammed Ali Dilek <xemeds@protonmail.com> Co-authored-by: Sonya Nikiforova <son.nik@mail.ru> Co-authored-by: Krishna Sharma <krishnasharma1386@gmail.com> Co-authored-by: TanmayNagdeve <55934827+TanmayNagdeve@users.noreply.github.com> Co-authored-by: MoiZ <techboyy6@gmail.com> Co-authored-by: shreyas-lab <68059145+shreyas-lab@users.noreply.github.com> Co-authored-by: Shankar Jayaprakash <79354504+shankarjp@users.noreply.github.com> Co-authored-by: Shankar JP <shankarjp12@outlook.com>
124 lines
4.8 KiB
Python
124 lines
4.8 KiB
Python
"""
|
|
Written By: Jinesh Parakh
|
|
|
|
This is the main script file which involves gathering data from the entered URL of codeforces website and saving the data into respective folders.
|
|
MOTIVE:
|
|
The main motive of this project is to help users save time while solving the problems and reduce the hassels of checking validity of their sample outputs with the expected sample outputs
|
|
"""
|
|
#import all the necessary libraries or modules
|
|
from selenium import webdriver
|
|
import chromedriver_binary # Adds chromedriver binary to path
|
|
import bs4
|
|
import requests
|
|
import os
|
|
import shutil
|
|
import filecmp
|
|
import sys
|
|
from termcolor import colored, cprint
|
|
from colorama import Fore, Back, Style
|
|
|
|
def getUrlforContest(): #function to get URL for contests
|
|
print('Enter the URL of the page(Example:https://codeforces.com/contest/1328): ', end='')
|
|
url=input()
|
|
if len(url)<30:
|
|
cprint('Invalid URL', 'red',attrs=['bold'])
|
|
sys.exit()
|
|
return url
|
|
|
|
def getUrlforSingleProblem(): #function to get URL for a problem from problemset
|
|
print('Enter the URL of the page(Example:https://codeforces.com/problemset/problem/1333/E): ', end='')
|
|
url=input()
|
|
if len(url)<43:
|
|
cprint('Invalid URL', 'red',attrs=['bold'])
|
|
sys.exit()
|
|
return url
|
|
|
|
|
|
|
|
def getInputFiles(input): #function to get sample inputs
|
|
j=0
|
|
for i in range(len(input)):
|
|
print("Getting sample input " +str(i))
|
|
x=input[i].text
|
|
#print(x)
|
|
x='\n'.join(x.split('\n')[1:])
|
|
fileName='input'+ str(j)+'.txt'
|
|
file=open(fileName,"w+")
|
|
file.write(x)
|
|
file.close()
|
|
j+=1
|
|
def getOutputFiles(output): #function to get sample outputs
|
|
k=0
|
|
for i in range(len(output)):
|
|
print("Getting sample output "+str(i))
|
|
x=output[i].text
|
|
#print(x)
|
|
x='\n'.join(x.split('\n')[1:])
|
|
fileName='output'+ str(k)+'.txt'
|
|
file=open(fileName,"w+")
|
|
file.write(x)
|
|
file.close()
|
|
k+=1
|
|
|
|
|
|
#The main menu for the project
|
|
print("---------MAIN MENU---------")
|
|
print("1.Enter 1 for live or virtual contests or to clone complete contest")
|
|
print("2.Enter 2 for a single problem from problemset")
|
|
print("Enter choice: ",end='')
|
|
choice=int(input())
|
|
if choice==1: #for complete contest
|
|
url=getUrlforContest()
|
|
tp="'"+url[len(url)-13:]
|
|
final='//a[contains(@href,'+tp+"/problem/'" + ')]'
|
|
browser = webdriver.Chrome()
|
|
browser.get(url)
|
|
elements = browser.find_elements_by_xpath(final) #get all required elements by xpath
|
|
#print(elements)
|
|
length=len(elements)
|
|
length=length//2
|
|
intialDirectory=os.getcwd()
|
|
contestFolder='Contest '+url[len(url)-4:]
|
|
os.makedirs(os.path.join(os.getcwd(),contestFolder)) #make directory for the contest
|
|
os.chdir(os.path.join(os.getcwd(),contestFolder))
|
|
for i in range(0,len(elements),2):
|
|
currentDirectory=os.getcwd()
|
|
toadd='Problem'+elements[i].text
|
|
print("Getting essentials for Problem"+elements[i].text)
|
|
res=requests.get(url+'/problem/'+elements[i].text)
|
|
os.makedirs(os.path.join(currentDirectory,toadd)) #make directory for individual problems
|
|
os.chdir(os.path.join(currentDirectory,toadd))
|
|
soup=bs4.BeautifulSoup(res.text,'html.parser') #using beautiful soup to parse HTML
|
|
input=soup.find_all('div',{'class':'input'})
|
|
output=soup.find_all('div',{'class':'output'})
|
|
j=0
|
|
#The next two shutil's are used to copy your template.cpp file and the checker script to all the problem folders
|
|
shutil.copy(os.path.join(intialDirectory,'template.cpp'),os.path.join(os.getcwd(),'soln.cpp'))
|
|
shutil.copy(os.path.join(intialDirectory,'checker.py'),os.path.join(os.getcwd(),'checker.py'))
|
|
getInputFiles(input)
|
|
getOutputFiles(output)
|
|
|
|
os.chdir(currentDirectory)
|
|
print()
|
|
|
|
browser.quit() #quitting the browser window
|
|
|
|
else: #for a single problem
|
|
url=getUrlforSingleProblem()
|
|
browser = webdriver.Chrome()
|
|
browser.get(url)
|
|
intialDirectory=os.getcwd()
|
|
problemFolder='Problem '+url[len(url)-6:len(url)-2]+url[len(url)-1:]
|
|
os.makedirs(os.path.join(os.getcwd(),problemFolder))
|
|
os.chdir(os.path.join(os.getcwd(),problemFolder))
|
|
res=requests.get(url)
|
|
soup=bs4.BeautifulSoup(res.text,'html.parser') #using beautiful soup to parse HTML
|
|
input=soup.find_all('div',{'class':'input'})
|
|
output=soup.find_all('div',{'class':'output'})
|
|
#The next two shutil's are used to copy your template.cpp file and the checker script to all the problem folders
|
|
shutil.copy(os.path.join(intialDirectory,'template.cpp'),os.path.join(os.getcwd(),'soln.cpp'))
|
|
shutil.copy(os.path.join(intialDirectory,'checker.py'),os.path.join(os.getcwd(),'checker.py'))
|
|
getInputFiles(input)
|
|
getOutputFiles(output)
|
|
browser.quit() #quitting the browser window
|