From c0c7b0d934d884f31f8dcfc8480607b2070ccff0 Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Thu, 21 Oct 2021 01:31:18 +0530 Subject: [PATCH 01/13] Add files via upload --- Crawler Test 2.py | 103 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Crawler Test 2.py diff --git a/Crawler Test 2.py b/Crawler Test 2.py new file mode 100644 index 00000000..a48aabab --- /dev/null +++ b/Crawler Test 2.py @@ -0,0 +1,103 @@ +from bs4 import BeautifulSoup +import requests +import pymongo +import urllib.parse +import sys + +class Crawler(): + + connection_url = "mongodb://127.0.0.1:27017/" + + client = pymongo.MongoClient(connection_url) + + db = client.info + + disallowed_links = [] + + def start_crawl(self, url, depth): + robots_url = urllib.parse.urljoin(url, '/robots.txt') + + try: + robots = requests.get(robots_url) + except: + print("No Robots found!!!") + self.crawl(url, depth) + + soup = BeautifulSoup(robots.text, 'lxml') + + content = soup.find('p').text + + for word in content: + if word[0] == '/': + self.disallowed_links.append(urllib.parse.urljoin(url, word)) + + print("robots found and appended in disallowed_links") + + self.crawl(url, depth, self.disallowed_links) + + def crawl(self, url, depth, disallowed_links): + + try: + print(f"Crawling url {url} at depth: {depth}") + response = requests.get(url) + except: + print(f"Failed to perform HTTP GET request on {url}") + return + + soup = BeautifulSoup(response.text, 'lxml') + + try: + title = soup.find('title').text + desc = '' + + for tag in soup.findAll(): + if tag.name == 'p': + desc += tag.text.strip().replace('\n', '') + + except: + print("Failed to retrieve title and description") + return + + query = { + 'url': url, + 'title': title, + 'description': desc, + } + + search_info = self.db.search_info + + search_info.insert_one(query) + + search_info.create_index( + [ + ('url', pymongo.TEXT), + ('title', pymongo.TEXT), + ('description', pymongo.TEXT) + ], + name='search_results', + default_language="english" + ) + + + links = [] + if depth==0: + return + else : + for Link in soup.find_all('a'): + links.append(Link.get('href')) + for link in links: + if link in disallowed_links: + print('Disallowed link encountered.') + else: + self.crawl(link, depth-1) + + self.client.close() + +object = Crawler() +object.start_crawl('https://www.geeksforgeeks.org/', 1) + +#Links: +#https://www.geeksforgeeks.org/ +#https://www.rottentomatoes.com/ +#https://www.stackoverflow.com/ +#https://www.wikipedia.org/ \ No newline at end of file From b3671f96e2cd0c899a5d2b2b51ab32ef9deaed87 Mon Sep 17 00:00:00 2001 From: CyberSmart02 Date: Thu, 21 Oct 2021 21:50:15 +0530 Subject: [PATCH 02/13] TASK-1 --- Crawler Test 2.py => CrawlerTest2.py | 204 +++++++++++++-------------- 1 file changed, 102 insertions(+), 102 deletions(-) rename Crawler Test 2.py => CrawlerTest2.py (89%) diff --git a/Crawler Test 2.py b/CrawlerTest2.py similarity index 89% rename from Crawler Test 2.py rename to CrawlerTest2.py index a48aabab..ce56f717 100644 --- a/Crawler Test 2.py +++ b/CrawlerTest2.py @@ -1,103 +1,103 @@ -from bs4 import BeautifulSoup -import requests -import pymongo -import urllib.parse -import sys - -class Crawler(): - - connection_url = "mongodb://127.0.0.1:27017/" - - client = pymongo.MongoClient(connection_url) - - db = client.info - - disallowed_links = [] - - def start_crawl(self, url, depth): - robots_url = urllib.parse.urljoin(url, '/robots.txt') - - try: - robots = requests.get(robots_url) - except: - print("No Robots found!!!") - self.crawl(url, depth) - - soup = BeautifulSoup(robots.text, 'lxml') - - content = soup.find('p').text - - for word in content: - if word[0] == '/': - self.disallowed_links.append(urllib.parse.urljoin(url, word)) - - print("robots found and appended in disallowed_links") - - self.crawl(url, depth, self.disallowed_links) - - def crawl(self, url, depth, disallowed_links): - - try: - print(f"Crawling url {url} at depth: {depth}") - response = requests.get(url) - except: - print(f"Failed to perform HTTP GET request on {url}") - return - - soup = BeautifulSoup(response.text, 'lxml') - - try: - title = soup.find('title').text - desc = '' - - for tag in soup.findAll(): - if tag.name == 'p': - desc += tag.text.strip().replace('\n', '') - - except: - print("Failed to retrieve title and description") - return - - query = { - 'url': url, - 'title': title, - 'description': desc, - } - - search_info = self.db.search_info - - search_info.insert_one(query) - - search_info.create_index( - [ - ('url', pymongo.TEXT), - ('title', pymongo.TEXT), - ('description', pymongo.TEXT) - ], - name='search_results', - default_language="english" - ) - - - links = [] - if depth==0: - return - else : - for Link in soup.find_all('a'): - links.append(Link.get('href')) - for link in links: - if link in disallowed_links: - print('Disallowed link encountered.') - else: - self.crawl(link, depth-1) - - self.client.close() - -object = Crawler() -object.start_crawl('https://www.geeksforgeeks.org/', 1) - -#Links: -#https://www.geeksforgeeks.org/ -#https://www.rottentomatoes.com/ -#https://www.stackoverflow.com/ +from bs4 import BeautifulSoup +import requests +import pymongo +import urllib.parse +import sys + +class Crawler(): + + connection_url = "mongodb://127.0.0.1:27017/" + + client = pymongo.MongoClient(connection_url) + + db = client.info + + disallowed_links = [] + + def start_crawl(self, url, depth): + robots_url = urllib.parse.urljoin(url, '/robots.txt') + + try: + robots = requests.get(robots_url) + except: + print("No Robots found!!!") + self.crawl(url, depth) + + soup = BeautifulSoup(robots.text, 'lxml') + + content = soup.find('p').text + + for word in content: + if word[0] == '/': + self.disallowed_links.append(urllib.parse.urljoin(url, word)) + + print("robots found and appended in disallowed_links") + + self.crawl(url, depth, self.disallowed_links) + + def crawl(self, url, depth,*disallowed_links): + + try: + print(f"Crawling url {url} at depth: {depth}") + response = requests.get(url) + except: + print(f"Failed to perform GET request on {url}") + return + + soup = BeautifulSoup(response.text, 'lxml') + + try: + title = soup.find('title').text + desc = '' + + for tag in soup.findAll(): + if tag.name == 'p': + desc += tag.text.strip().replace('\n', '') + + except: + print("Failed to fetch title and description") + return + + query = { + 'url': url, + 'title': title, + 'description': desc, + } + + search_info = self.db.search_info + + search_info.insert_one(query) + + search_info.create_index( + [ + ('url', pymongo.TEXT), + ('title', pymongo.TEXT), + ('description', pymongo.TEXT) + ], + name='search_results', + default_language="english" + ) + + + links = [] + if depth==0: + return + else : + for Link in soup.find_all('a'): + links.append(Link.get('href')) + for link in links: + if link in disallowed_links: + print('Disallowed link encountered.') + else: + self.crawl(link, depth-1) + + self.client.close() + +object = Crawler() +object.start_crawl('https://www.geeksforgeeks.org/', 1) + +#Links: +#https://www.geeksforgeeks.org/ +#https://www.rottentomatoes.com/ +#https://www.stackoverflow.com/ #https://www.wikipedia.org/ \ No newline at end of file From 87b09ea5a302a3c8385bfac25974bd4315a6cf0a Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Fri, 22 Oct 2021 23:50:23 +0530 Subject: [PATCH 03/13] Add files via upload TASK-2.1 --- FLASK/__pycache__/app.cpython-310.pyc | Bin 0 -> 926 bytes FLASK/app.py | 34 ++++++++++++++++++++++++ FLASK/templates/home.html | 36 ++++++++++++++++++++++++++ FLASK/templates/result.html | 12 +++++++++ 4 files changed, 82 insertions(+) create mode 100644 FLASK/__pycache__/app.cpython-310.pyc create mode 100644 FLASK/app.py create mode 100644 FLASK/templates/home.html create mode 100644 FLASK/templates/result.html diff --git a/FLASK/__pycache__/app.cpython-310.pyc b/FLASK/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..311ba6bb89ec9175ca268c043c8bf50f8eaa7e12 GIT binary patch literal 926 zcmZuv&1w`u5bnR3o!QMML4roS2ug4+3GpN%q6BhKSp%z=Wnt`W_5NjgX6)$^vLvVE zns?Bn@8MJQ)sy%JIjGeWmBm;?e^cG{(e-sz72R%|pl$sy@_``atKTdeo{?v`sxbl( zpc&D0Ks6gM%?F$kMU^xUiswUZPup#i`Y6{`7es^<|Yys@!d4_ElyM4$pF-0J?SN# z0p`a!G`{JLh%1dzn&wigG{u*er3*|^Th)xjl|+A~ + + + + + + Calculator + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/FLASK/templates/result.html b/FLASK/templates/result.html new file mode 100644 index 00000000..249d1466 --- /dev/null +++ b/FLASK/templates/result.html @@ -0,0 +1,12 @@ + + + + + + + Result + + +

{{sum}}

+ + \ No newline at end of file From 880163fb3da0fbdcaee86d9388346d4cd7b209d9 Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Sat, 23 Oct 2021 00:03:36 +0530 Subject: [PATCH 04/13] Delete app.py --- FLASK/app.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 FLASK/app.py diff --git a/FLASK/app.py b/FLASK/app.py deleted file mode 100644 index 1e9f52d7..00000000 --- a/FLASK/app.py +++ /dev/null @@ -1,34 +0,0 @@ -from flask import Flask, render_template, request - -app = Flask(__name__) - -@app.route('/') -def main(): - return render_template('home.html') -@app.route('/cal', methods=['POST']) -def cal(sum=sum): - if request.method == 'POST': - num1 = request.form['num1'] - num2 = request.form['num2'] - operation = request.form['operation'] - - if operation == 'add': - sum = float(num1) + float(num2) - return render_template('result.html', sum=sum) - - elif operation == 'subtract': - sum = float(num1) - float(num2) - return render_template('result.html', sum=sum) - - elif operation == 'multiply': - sum = float(num1) * float(num2) - return render_template('result.html', sum=sum) - - elif operation == 'divide': - sum = float(num1) / float(num2) - return render_template('result.html', sum=sum) - else: - return render_template('result.html') - -if __name__ == ' __main__': - app.run(debug=True) \ No newline at end of file From ba03ce9697929f091b9ddaf8f2988dbdd46e5f55 Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Sat, 23 Oct 2021 00:03:56 +0530 Subject: [PATCH 05/13] Delete app.cpython-310.pyc --- FLASK/__pycache__/app.cpython-310.pyc | Bin 926 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FLASK/__pycache__/app.cpython-310.pyc diff --git a/FLASK/__pycache__/app.cpython-310.pyc b/FLASK/__pycache__/app.cpython-310.pyc deleted file mode 100644 index 311ba6bb89ec9175ca268c043c8bf50f8eaa7e12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 926 zcmZuv&1w`u5bnR3o!QMML4roS2ug4+3GpN%q6BhKSp%z=Wnt`W_5NjgX6)$^vLvVE zns?Bn@8MJQ)sy%JIjGeWmBm;?e^cG{(e-sz72R%|pl$sy@_``atKTdeo{?v`sxbl( zpc&D0Ks6gM%?F$kMU^xUiswUZPup#i`Y6{`7es^<|Yys@!d4_ElyM4$pF-0J?SN# z0p`a!G`{JLh%1dzn&wigG{u*er3*|^Th)xjl|+A~ Date: Sat, 23 Oct 2021 00:04:09 +0530 Subject: [PATCH 06/13] Delete home.html --- FLASK/templates/home.html | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 FLASK/templates/home.html diff --git a/FLASK/templates/home.html b/FLASK/templates/home.html deleted file mode 100644 index e712e26f..00000000 --- a/FLASK/templates/home.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - Calculator - - - - - - - - - - - - - - \ No newline at end of file From fcf391dda4e70571db27ca17be225dfa4675318a Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Sat, 23 Oct 2021 00:04:19 +0530 Subject: [PATCH 07/13] Delete result.html --- FLASK/templates/result.html | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 FLASK/templates/result.html diff --git a/FLASK/templates/result.html b/FLASK/templates/result.html deleted file mode 100644 index 249d1466..00000000 --- a/FLASK/templates/result.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - Result - - -

{{sum}}

- - \ No newline at end of file From dd4465437cc4acf7a8cb8afe25d2e0a6a91d994d Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Sat, 23 Oct 2021 00:07:29 +0530 Subject: [PATCH 08/13] Delete CrawlerTest2.py --- CrawlerTest2.py | 103 ------------------------------------------------ 1 file changed, 103 deletions(-) delete mode 100644 CrawlerTest2.py diff --git a/CrawlerTest2.py b/CrawlerTest2.py deleted file mode 100644 index ce56f717..00000000 --- a/CrawlerTest2.py +++ /dev/null @@ -1,103 +0,0 @@ -from bs4 import BeautifulSoup -import requests -import pymongo -import urllib.parse -import sys - -class Crawler(): - - connection_url = "mongodb://127.0.0.1:27017/" - - client = pymongo.MongoClient(connection_url) - - db = client.info - - disallowed_links = [] - - def start_crawl(self, url, depth): - robots_url = urllib.parse.urljoin(url, '/robots.txt') - - try: - robots = requests.get(robots_url) - except: - print("No Robots found!!!") - self.crawl(url, depth) - - soup = BeautifulSoup(robots.text, 'lxml') - - content = soup.find('p').text - - for word in content: - if word[0] == '/': - self.disallowed_links.append(urllib.parse.urljoin(url, word)) - - print("robots found and appended in disallowed_links") - - self.crawl(url, depth, self.disallowed_links) - - def crawl(self, url, depth,*disallowed_links): - - try: - print(f"Crawling url {url} at depth: {depth}") - response = requests.get(url) - except: - print(f"Failed to perform GET request on {url}") - return - - soup = BeautifulSoup(response.text, 'lxml') - - try: - title = soup.find('title').text - desc = '' - - for tag in soup.findAll(): - if tag.name == 'p': - desc += tag.text.strip().replace('\n', '') - - except: - print("Failed to fetch title and description") - return - - query = { - 'url': url, - 'title': title, - 'description': desc, - } - - search_info = self.db.search_info - - search_info.insert_one(query) - - search_info.create_index( - [ - ('url', pymongo.TEXT), - ('title', pymongo.TEXT), - ('description', pymongo.TEXT) - ], - name='search_results', - default_language="english" - ) - - - links = [] - if depth==0: - return - else : - for Link in soup.find_all('a'): - links.append(Link.get('href')) - for link in links: - if link in disallowed_links: - print('Disallowed link encountered.') - else: - self.crawl(link, depth-1) - - self.client.close() - -object = Crawler() -object.start_crawl('https://www.geeksforgeeks.org/', 1) - -#Links: -#https://www.geeksforgeeks.org/ -#https://www.rottentomatoes.com/ -#https://www.stackoverflow.com/ -#https://www.wikipedia.org/ \ No newline at end of file From 2df2ceba6a669c3015bd97b72d1bd272f977146b Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Sat, 23 Oct 2021 00:08:19 +0530 Subject: [PATCH 09/13] TASK_2.1 --- FLASK/__pycache__/app.cpython-310.pyc | Bin 0 -> 926 bytes FLASK/app.py | 34 ++++++++++++++++++++++++ FLASK/templates/home.html | 36 ++++++++++++++++++++++++++ FLASK/templates/result.html | 12 +++++++++ 4 files changed, 82 insertions(+) create mode 100644 FLASK/__pycache__/app.cpython-310.pyc create mode 100644 FLASK/app.py create mode 100644 FLASK/templates/home.html create mode 100644 FLASK/templates/result.html diff --git a/FLASK/__pycache__/app.cpython-310.pyc b/FLASK/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..311ba6bb89ec9175ca268c043c8bf50f8eaa7e12 GIT binary patch literal 926 zcmZuv&1w`u5bnR3o!QMML4roS2ug4+3GpN%q6BhKSp%z=Wnt`W_5NjgX6)$^vLvVE zns?Bn@8MJQ)sy%JIjGeWmBm;?e^cG{(e-sz72R%|pl$sy@_``atKTdeo{?v`sxbl( zpc&D0Ks6gM%?F$kMU^xUiswUZPup#i`Y6{`7es^<|Yys@!d4_ElyM4$pF-0J?SN# z0p`a!G`{JLh%1dzn&wigG{u*er3*|^Th)xjl|+A~ + + + + + + Calculator + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FLASK/templates/result.html b/FLASK/templates/result.html new file mode 100644 index 00000000..249d1466 --- /dev/null +++ b/FLASK/templates/result.html @@ -0,0 +1,12 @@ + + + + + + + Result + + +

{{sum}}

+ + \ No newline at end of file From 13d1edf92db575ae778dc8844b3c972a3b403918 Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Thu, 28 Oct 2021 23:04:04 +0530 Subject: [PATCH 10/13] Add files via upload --- Task-3/app.py | 56 +++++++++++++++++++++++++++++++++ Task-3/static/images/logo.png | Bin 0 -> 12566 bytes Task-3/templates/homepage.html | 22 +++++++++++++ Task-3/templates/index.html | 37 ++++++++++++++++++++++ Task-3/templates/search.html | 40 +++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 Task-3/app.py create mode 100644 Task-3/static/images/logo.png create mode 100644 Task-3/templates/homepage.html create mode 100644 Task-3/templates/index.html create mode 100644 Task-3/templates/search.html diff --git a/Task-3/app.py b/Task-3/app.py new file mode 100644 index 00000000..be20bf72 --- /dev/null +++ b/Task-3/app.py @@ -0,0 +1,56 @@ +from flask import Flask, render_template, request +from flask_paginate import Pagination, get_page_args +import pymongo + +app = Flask(__name__) + + +@app.route('/') +def entry_point(): + return render_template('homepage.html') + + +@app.route('/search_results') +def search_results(): + connect_url = 'mongodb://127.0.0.1:27017/' + + client = pymongo.MongoClient(connect_url, connect=False) + + db = client.info + + search_string = request.args.get('search') + + query = db.search_info.find( + {'$text': {'$search': search_string, '$caseSensitive': False}}) + + search_result = [] + + for doc in query: + exist = False + for result in search_result: + if result['title'] == doc['title'] or result['url'] == doc['url']: + exist = True + break + + if exist == False: + search_result.append(doc) + + page, per_page, offset = get_page_args(page_parameter='page', + per_page_parameter='per_page') + + total = len(search_result) + + pagination = Pagination(page=page, per_page=per_page, total=total, + css_framework='bootstrap4') + + return render_template('search.html', + search_result=search_result[offset:offset+per_page], + page=page, + per_page=per_page, + pagination=pagination, + search_string=search_string + ) + + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file diff --git a/Task-3/static/images/logo.png b/Task-3/static/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..50827d895db3784f346efbdbadc14bdc9e79f710 GIT binary patch literal 12566 zcmV+xG3m~UP)9H|6E!gxRb{Q90EFS@?~j-7<` z|M{LQiowYMi<-Q?zGThNF)=XF&(7T5-__OC|M~d%T}uFzqWYKsf6&{;%FCUdoO!&& z_`@AWMn$QqsfdP!T3A+xxxx9t03V*J{NBU)!jJlMT$a_|sL$2+u50}0)Z;}lXR^Eb z!!YSOA@}Ou`_ifDLMv3HuiNbIf!^f$lK{Bd-kQbB%irQZuDR{p!LRZ5lk@w->+Rq5 z_2X4P-8&{ajFzrrUtEKW!B|nP(%1QQUeiiFz__#IUP*;?cg#~p`L7_{Iyv~NNc+yA zv-tk_u3)_I_Uhfy`Ke6S`u_R6dHSV0+l(#cw2r=lK6PedKv!mST2GE`Os#W4*N!)c zU`y}Nyk%x)pKV6O<=;k1R8dt{R7gIvnuvys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S&*LF4*Y|MJ?F^0xA1G< zUp(w-ORgBxS;q@$j>UP9$G;YE9(FSy3pfu(Is>TpBm3R`+n#gqu;Xmc17uGIGhpX; z!g=6lg^q}=>_UTOYL+p!%H4}3IS-!g96soI+jGwTZ3ljIyd&haGZL*~L#eEhoClVd z8)yA-Zu0ra*UIxb4>=?R+pQdNDb8QdIrB#xn^GKX6H{Rv&I7THo`Lhg%1Wr5hk%g% zCQ+(^&&O&$=OKrw0E2aL)}c5TJ$Ie}#5T@Z>K}viV2g6-8Xv&Q+K!#i$9&F14pRX- za(2-pIPn}Cq~7>+h60Q_=K=q1F=k6RsGJ9I-E9}9;M@XuX|`Bx$_V8YgHY%Ug7aWJ zN`r(TbbUnOJnRyqk@JwJDd5`=&bgF-L+GQ$>SR2fBT9u!ox{*$MQCy-N45gaLmm|l z%m-I9uZk}x`2gAuKzZ69d5aGo-g(RCJmga0=p=N4QGB_aE0wcC^T1ZowY52W za>J3dIV+FzkWWIe)tp%YQ(OT~nm<+EYTr&~Xif + + +
+ +

GLUGLE

+
+ + + +
+ + +
+ + +{% endblock %} \ No newline at end of file diff --git a/Task-3/templates/index.html b/Task-3/templates/index.html new file mode 100644 index 00000000..26144d8b --- /dev/null +++ b/Task-3/templates/index.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + Glugle + + + + {% block content %}{% endblock %} + + + + + + + \ No newline at end of file diff --git a/Task-3/templates/search.html b/Task-3/templates/search.html new file mode 100644 index 00000000..3dc9c182 --- /dev/null +++ b/Task-3/templates/search.html @@ -0,0 +1,40 @@ +{% extends 'index.html' %} + +{% block content %} + +
+
+
+ + +
+
+ +
+

Search result for '{{search_string}}'

+
+ + {% if search_result %} + {% for link in search_result %} +
+ + + +
+ {{ link.url }} +

{{ link.description[:300] }}...

+
+
+ {% endfor %} + {% else %} + No results found + {% endif %} + +
+ {{pagination.links}} +
+
+ +{% endblock %} \ No newline at end of file From e3b8bace8903a68741309c7c6db09ab77c331cad Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Thu, 28 Oct 2021 23:05:28 +0530 Subject: [PATCH 11/13] Delete app.py --- FLASK/app.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 FLASK/app.py diff --git a/FLASK/app.py b/FLASK/app.py deleted file mode 100644 index 1e9f52d7..00000000 --- a/FLASK/app.py +++ /dev/null @@ -1,34 +0,0 @@ -from flask import Flask, render_template, request - -app = Flask(__name__) - -@app.route('/') -def main(): - return render_template('home.html') -@app.route('/cal', methods=['POST']) -def cal(sum=sum): - if request.method == 'POST': - num1 = request.form['num1'] - num2 = request.form['num2'] - operation = request.form['operation'] - - if operation == 'add': - sum = float(num1) + float(num2) - return render_template('result.html', sum=sum) - - elif operation == 'subtract': - sum = float(num1) - float(num2) - return render_template('result.html', sum=sum) - - elif operation == 'multiply': - sum = float(num1) * float(num2) - return render_template('result.html', sum=sum) - - elif operation == 'divide': - sum = float(num1) / float(num2) - return render_template('result.html', sum=sum) - else: - return render_template('result.html') - -if __name__ == ' __main__': - app.run(debug=True) \ No newline at end of file From 44b3720204bffaae8f56a350eef6503b9b643b5e Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Thu, 28 Oct 2021 23:06:00 +0530 Subject: [PATCH 12/13] Delete home.html --- FLASK/templates/home.html | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 FLASK/templates/home.html diff --git a/FLASK/templates/home.html b/FLASK/templates/home.html deleted file mode 100644 index e712e26f..00000000 --- a/FLASK/templates/home.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - Calculator - - -
- - - - - - - - - - - \ No newline at end of file From 0018299e1c1a990a65fe42cfbaa66928589c54b4 Mon Sep 17 00:00:00 2001 From: CyberSmart02 <92020220+CyberSmart02@users.noreply.github.com> Date: Thu, 28 Oct 2021 23:06:29 +0530 Subject: [PATCH 13/13] Delete result.html --- FLASK/templates/result.html | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 FLASK/templates/result.html diff --git a/FLASK/templates/result.html b/FLASK/templates/result.html deleted file mode 100644 index 249d1466..00000000 --- a/FLASK/templates/result.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - Result - - -

{{sum}}

- - \ No newline at end of file