├── LICENSE ├── README.md ├── Section 11 ├── Functions+For+Dictionary.png └── Functions+For+Tuples.png ├── Section 13 ├── Comparision+Operator+Overloading.png ├── OOP Theory │ ├── Classes and Objects in Python (OOP).pdf │ ├── Encapsulation in Python (OOP).pdf │ ├── Inheritance in Python (OOP).pdf │ └── What Is Object-Oriented Programming (OOP).pdf ├── Operator+Overloading.png ├── main.py ├── polygon.py ├── shape.py ├── square.py └── traingle.py ├── Section 14 ├── Common+Exceptions.PNG └── Exception+(Try,+Except,+Else,+Finally).png ├── Section 16 └── File+Modes.png ├── Section 17 └── Python Package Management System.txt ├── Section 18 ├── OpenCV Face Detection - Project Code │ └── OpenCV-Basics-master │ │ ├── elon.jpg │ │ ├── haarcascade_frontalface_default.xml │ │ ├── mark.jpg │ │ ├── mark1.jpg │ │ ├── multi-image-detector │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── face-detector.py │ │ └── haarcascade_frontalface_default.xml │ │ └── project.py └── What is OpenCV.txt ├── Section 19 └── Project 2 - Password Generator.txt ├── Section 2 ├── Linux_Mac Basic Command Difference - Installation.docx └── first.py ├── Section 20 ├── Link to Practice files for Panda.txt └── PyPandas │ ├── traffic-commas.txt │ ├── traffic-semi-colons.txt │ ├── traffic.csv │ ├── traffic.json │ └── traffic.xlsx ├── Section 21 ├── Calculating Profit and Loss.txt ├── JSON formatter.txt ├── What is API.docx └── Working with CoinMarketCap API.txt ├── Section 22 and 24 └── Python-GUI-Programming-With-Tkinter-master │ ├── coin.db │ ├── favicon.ico │ ├── main.py │ └── pycrypto.py ├── Section 23 ├── Creating Table Working with DB Browser.txt └── DB Browser for SQLite.txt ├── Section 25 ├── Creating Twitter Developer Account.txt ├── Deployment Done Along Testing.txt └── Installing Tweepy.txt ├── Section 4 └── Reserve+Words.png ├── Section 5 ├── Arithmetic+Operation.png ├── Assignment+Operators.png ├── General+Print+Commands.png ├── Logical+Operator.png └── Relational+Operator.png └── Section 7 ├── Editor 1 - Issue With Atom Terminal.docx └── How to Launch Terminal in the Current Folder Location on Mac.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Packt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Python-A-Z---Learn-Python-Programming-By-Building-5-Projects 5 | Code Repository for Python A-Z - Learn Python Programming By Building 5 Projects, Published by Packt 6 | -------------------------------------------------------------------------------- /Section 11/Functions+For+Dictionary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 11/Functions+For+Dictionary.png -------------------------------------------------------------------------------- /Section 11/Functions+For+Tuples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 11/Functions+For+Tuples.png -------------------------------------------------------------------------------- /Section 13/Comparision+Operator+Overloading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 13/Comparision+Operator+Overloading.png -------------------------------------------------------------------------------- /Section 13/OOP Theory/Classes and Objects in Python (OOP).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 13/OOP Theory/Classes and Objects in Python (OOP).pdf -------------------------------------------------------------------------------- /Section 13/OOP Theory/Encapsulation in Python (OOP).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 13/OOP Theory/Encapsulation in Python (OOP).pdf -------------------------------------------------------------------------------- /Section 13/OOP Theory/Inheritance in Python (OOP).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 13/OOP Theory/Inheritance in Python (OOP).pdf -------------------------------------------------------------------------------- /Section 13/OOP Theory/What Is Object-Oriented Programming (OOP).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 13/OOP Theory/What Is Object-Oriented Programming (OOP).pdf -------------------------------------------------------------------------------- /Section 13/Operator+Overloading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 13/Operator+Overloading.png -------------------------------------------------------------------------------- /Section 13/main.py: -------------------------------------------------------------------------------- 1 | from square import Square as sq 2 | from traingle import Triangle as tq 3 | 4 | s1 = sq() 5 | s1.set_value(8, 15) 6 | s1.set_color("Blue") 7 | print(s1.area(), s1.get_color()) 8 | 9 | t1 = tq() 10 | t1.set_value(5, 10) 11 | t1.set_color("Green") 12 | print(t1.area(), t1.get_color()) 13 | -------------------------------------------------------------------------------- /Section 13/polygon.py: -------------------------------------------------------------------------------- 1 | class Polygon: 2 | __width = None 3 | __height = None 4 | 5 | def set_value(self, width, height): 6 | self.__width = width 7 | self.__height = height 8 | 9 | def get_width(self): 10 | return self.__width 11 | 12 | def get_height(self): 13 | return self.__height 14 | -------------------------------------------------------------------------------- /Section 13/shape.py: -------------------------------------------------------------------------------- 1 | class Shape: 2 | __color = None 3 | 4 | def set_color(self, color): 5 | self.__color = color 6 | 7 | def get_color(self): 8 | return self.__color 9 | -------------------------------------------------------------------------------- /Section 13/square.py: -------------------------------------------------------------------------------- 1 | from polygon import Polygon 2 | from shape import Shape 3 | 4 | class Square(Polygon, Shape): 5 | def area(self): 6 | return self.get_width() * self.get_height() 7 | -------------------------------------------------------------------------------- /Section 13/traingle.py: -------------------------------------------------------------------------------- 1 | from polygon import Polygon 2 | from shape import Shape 3 | 4 | class Triangle(Polygon, Shape): 5 | def area(self): 6 | return self.get_width() * self.get_height() * 1/2 7 | -------------------------------------------------------------------------------- /Section 14/Common+Exceptions.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 14/Common+Exceptions.PNG -------------------------------------------------------------------------------- /Section 14/Exception+(Try,+Except,+Else,+Finally).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 14/Exception+(Try,+Except,+Else,+Finally).png -------------------------------------------------------------------------------- /Section 16/File+Modes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 16/File+Modes.png -------------------------------------------------------------------------------- /Section 17/Python Package Management System.txt: -------------------------------------------------------------------------------- 1 | https://pypi.org/ -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/elon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/elon.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/mark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/mark.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/mark1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/mark1.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/1.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/2.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/3.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/4.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/5.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/6.jpg -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/multi-image-detector/face-detector.py: -------------------------------------------------------------------------------- 1 | import cv2, glob 2 | 3 | all_images = glob.glob("*.jpg") 4 | detect = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") 5 | 6 | for image in all_images: 7 | img = cv2.imread(image) 8 | gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 9 | faces = detect.detectMultiScale(gray_img, 1.1, 5) 10 | 11 | for (x, y, w, h) in faces: 12 | final_img = cv2.rectangle(img, (x,y), (x+w,y+h), (0, 255, 0), 2) 13 | 14 | cv2.imshow("Face Detection", final_img) 15 | cv2.waitKey(2000) 16 | cv2.destroyAllWindows 17 | -------------------------------------------------------------------------------- /Section 18/OpenCV Face Detection - Project Code/OpenCV-Basics-master/project.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') 4 | cap = cv2.VideoCapture("elon.jpg") 5 | 6 | ret, img = cap.read() 7 | gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 8 | 9 | # Detects faces of different sizes in the input image 10 | faces = face_cascade.detectMultiScale(gray, 1.3, 5) 11 | 12 | for (x,y,w,h) in faces: 13 | # To draw a rectangle in a face 14 | cv2.rectangle(img,(x,y),(x+w,y+h),(255,255,0),2) 15 | 16 | cv2.imshow('img',img) 17 | k = cv2.waitKey(0) 18 | 19 | # Close the window 20 | cap.release() 21 | 22 | # De-allocate any associated memory usage 23 | cv2.destroyAllWindows() 24 | -------------------------------------------------------------------------------- /Section 18/What is OpenCV.txt: -------------------------------------------------------------------------------- 1 | https://pypi.org/project/opencv-python/ 2 | 3 | https://github.com/ShubhamSarda/OpenCV-Basics 4 | 5 | https://drive.google.com/drive/folders/1w-kORB1g08mkt0CJnIIN7ePgqGMVI7Y7 -------------------------------------------------------------------------------- /Section 19/Project 2 - Password Generator.txt: -------------------------------------------------------------------------------- 1 | https://docs.python.org/3/library/random.html -------------------------------------------------------------------------------- /Section 2/Linux_Mac Basic Command Difference - Installation.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 2/Linux_Mac Basic Command Difference - Installation.docx -------------------------------------------------------------------------------- /Section 2/first.py: -------------------------------------------------------------------------------- 1 | print("This is a .py file") 2 | -------------------------------------------------------------------------------- /Section 20/Link to Practice files for Panda.txt: -------------------------------------------------------------------------------- 1 | https://github.com/uwlearning/pandas/blob/master/README.md -------------------------------------------------------------------------------- /Section 20/PyPandas/traffic-commas.txt: -------------------------------------------------------------------------------- 1 | Date,Visitors,BR,Country,Clicks,Day 2 | 1,1500,20,USA,20,Tuesday 3 | 2,700,25,UK,35,Wednesday 4 | 3,900,15,India,37,Thursday 5 | 4,400,35,USA,12,Friday 6 | 5,500,14,Canada,35,Saturday 7 | 6,700,15,India,32,Sunday 8 | 7,600,20,India,37,Monday 9 | 8,700,16,USA,40,Tuesday 10 | 9,1200,27,USA,52,Wednesday 11 | 10,1400,32,Australia,57,Thursday 12 | -------------------------------------------------------------------------------- /Section 20/PyPandas/traffic-semi-colons.txt: -------------------------------------------------------------------------------- 1 | Date;Visitors;BR;Country;Clicks;Day 2 | 1;1500;20;USA;20;Tuesday 3 | 2;700;25;UK;35;Wednesday 4 | 3;900;15;India;37;Thursday 5 | 4;400;35;USA;12;Friday 6 | 5;500;14;Canada;35;Saturday 7 | 6;700;15;India;32;Sunday 8 | 7;600;20;India;37;Monday 9 | 8;700;16;USA;40;Tuesday 10 | 9;1200;27;USA;52;Wednesday 11 | 10;1400;32;Australia;57;Thursday 12 | -------------------------------------------------------------------------------- /Section 20/PyPandas/traffic.csv: -------------------------------------------------------------------------------- 1 | Date,Visitors,BR,Country,Clicks,Day 2 | 1,1500,20,USA,20,Tuesday 3 | 2,700,25,UK,35,Wednesday 4 | 3,900,15,India,37,Thursday 5 | 4,400,35,USA,12,Friday 6 | 5,500,14,Canada,35,Saturday 7 | 6,700,15,India,32,Sunday 8 | 7,600,20,India,37,Monday 9 | 8,700,16,USA,40,Tuesday 10 | 9,1200,27,USA,52,Wednesday 11 | 10,1400,32,Australia,57,Thursday 12 | -------------------------------------------------------------------------------- /Section 20/PyPandas/traffic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Date": 1, 4 | "Visitors": 1500, 5 | "BR": 20, 6 | "Country": "USA", 7 | "Clicks": 20, 8 | "Day": "Tuesday" 9 | }, 10 | { 11 | "Date": 2, 12 | "Visitors": 700, 13 | "BR": 25, 14 | "Country": "UK", 15 | "Clicks": 35, 16 | "Day": "Wednesday" 17 | }, 18 | { 19 | "Date": 3, 20 | "Visitors": 900, 21 | "BR": 15, 22 | "Country": "India", 23 | "Clicks": 37, 24 | "Day": "Thursday" 25 | }, 26 | { 27 | "Date": 4, 28 | "Visitors": 400, 29 | "BR": 35, 30 | "Country": "USA", 31 | "Clicks": 12, 32 | "Day": "Friday" 33 | }, 34 | { 35 | "Date": 5, 36 | "Visitors": 500, 37 | "BR": 14, 38 | "Country": "Canada", 39 | "Clicks": 35, 40 | "Day": "Saturday" 41 | }, 42 | { 43 | "Date": 6, 44 | "Visitors": 700, 45 | "BR": 15, 46 | "Country": "India", 47 | "Clicks": 32, 48 | "Day": "Sunday" 49 | }, 50 | { 51 | "Date": 7, 52 | "Visitors": 600, 53 | "BR": 20, 54 | "Country": "India", 55 | "Clicks": 37, 56 | "Day": "Monday" 57 | }, 58 | { 59 | "Date": 8, 60 | "Visitors": 700, 61 | "BR": 16, 62 | "Country": "USA", 63 | "Clicks": 40, 64 | "Day": "Tuesday" 65 | }, 66 | { 67 | "Date": 9, 68 | "Visitors": 1200, 69 | "BR": 27, 70 | "Country": "USA", 71 | "Clicks": 52, 72 | "Day": "Wednesday" 73 | }, 74 | { 75 | "Date": 10, 76 | "Visitors": 1400, 77 | "BR": 32, 78 | "Country": "Australia", 79 | "Clicks": 57, 80 | "Day": "Thursday" 81 | } 82 | ] 83 | -------------------------------------------------------------------------------- /Section 20/PyPandas/traffic.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 20/PyPandas/traffic.xlsx -------------------------------------------------------------------------------- /Section 21/Calculating Profit and Loss.txt: -------------------------------------------------------------------------------- 1 | https://repl.it/@ShubhamSarda/PyCrypto -------------------------------------------------------------------------------- /Section 21/JSON formatter.txt: -------------------------------------------------------------------------------- 1 | https://codebeautify.org/jsonviewer -------------------------------------------------------------------------------- /Section 21/What is API.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 21/What is API.docx -------------------------------------------------------------------------------- /Section 21/Working with CoinMarketCap API.txt: -------------------------------------------------------------------------------- 1 | https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=2&convert=USD&CMC_PRO_API_KEY=8decb82f-10f0-4c6c-8b0a-79d97b8cc67a -------------------------------------------------------------------------------- /Section 22 and 24/Python-GUI-Programming-With-Tkinter-master/coin.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 22 and 24/Python-GUI-Programming-With-Tkinter-master/coin.db -------------------------------------------------------------------------------- /Section 22 and 24/Python-GUI-Programming-With-Tkinter-master/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 22 and 24/Python-GUI-Programming-With-Tkinter-master/favicon.ico -------------------------------------------------------------------------------- /Section 22 and 24/Python-GUI-Programming-With-Tkinter-master/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox, Menu 3 | import requests 4 | import json 5 | import sqlite3 6 | 7 | pycrypto = Tk() 8 | pycrypto.title("My Crypto Portfolio") 9 | pycrypto.iconbitmap('favicon.ico') 10 | 11 | con = sqlite3.connect('coin.db') 12 | cursorObj = con.cursor() 13 | cursorObj.execute("CREATE TABLE IF NOT EXISTS coin(id INTEGER PRIMARY KEY, symbol TEXT, amount INTEGER, price REAL)") 14 | con.commit() 15 | 16 | def reset(): 17 | for cell in pycrypto.winfo_children(): 18 | cell.destroy() 19 | 20 | app_nav() 21 | app_header() 22 | my_portfolio() 23 | 24 | def app_nav(): 25 | def clear_all(): 26 | cursorObj.execute("DELETE FROM coin") 27 | con.commit() 28 | 29 | messagebox.showinfo("Portfolio Notification", "Portfolio Cleared - Add New Coins") 30 | reset() 31 | 32 | def close_app(): 33 | pycrypto.destroy() 34 | 35 | menu = Menu(pycrypto) 36 | file_item = Menu(menu) 37 | file_item.add_command(label='Clear Portfolio', command=clear_all) 38 | file_item.add_command(label='Close App', command=close_app) 39 | menu.add_cascade(label="File", menu=file_item) 40 | pycrypto.config(menu=menu) 41 | 42 | def my_portfolio(): 43 | api_request = requests.get("https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=300&convert=USD&CMC_PRO_API_KEY=3889ce63-c733-403d-8b7d-c41a2438b4ea") 44 | api = json.loads(api_request.content) 45 | 46 | cursorObj.execute("SELECT * FROM coin") 47 | coins = cursorObj.fetchall() 48 | 49 | def font_color(amount): 50 | if amount >= 0: 51 | return "green" 52 | else: 53 | return "red" 54 | 55 | def insert_coin(): 56 | cursorObj.execute("INSERT INTO coin(symbol, price, amount) VALUES(?, ?, ?)", (symbol_txt.get(), price_txt.get(), amount_txt.get())) 57 | con.commit() 58 | 59 | messagebox.showinfo("Portfolio Notification", "Coin Added To Portfolio Successfully!") 60 | reset() 61 | 62 | def update_coin(): 63 | cursorObj.execute("UPDATE coin SET symbol=?, price=?, amount=? WHERE id=?", (symbol_update.get(), price_update.get(), amount_update.get(), portid_update.get())) 64 | con.commit() 65 | 66 | messagebox.showinfo("Portfolio Notification", "Coin Updated Successfully!") 67 | reset() 68 | 69 | def delete_coin(): 70 | cursorObj.execute("DELETE FROM coin WHERE id=?", (portid_delete.get(),)) 71 | con.commit() 72 | 73 | messagebox.showinfo("Portfolio Notification", "Coin Deleted From Portfolio") 74 | reset() 75 | 76 | total_pl = 0 77 | coin_row = 1 78 | total_current_value = 0 79 | total_amount_paid = 0 80 | 81 | for i in range(0, 300): 82 | for coin in coins: 83 | if api["data"][i]["symbol"] == coin[1]: 84 | total_paid = coin[2] * coin[3] 85 | current_value = coin[2] * api["data"][i]["quote"]["USD"]["price"] 86 | pl_percoin = api["data"][i]["quote"]["USD"]["price"] - coin[3] 87 | total_pl_coin = pl_percoin * coin[2] 88 | 89 | total_pl += total_pl_coin 90 | total_current_value += current_value 91 | total_amount_paid += total_paid 92 | 93 | portfolio_id = Label(pycrypto, text=coin[0], bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 94 | portfolio_id.grid(row=coin_row, column=0, sticky=N+S+E+W) 95 | 96 | name = Label(pycrypto, text=api["data"][i]["symbol"], bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 97 | name.grid(row=coin_row, column=1, sticky=N+S+E+W) 98 | 99 | price = Label(pycrypto, text="${0:.2f}".format(api["data"][i]["quote"]["USD"]["price"]), bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 100 | price.grid(row=coin_row, column=2, sticky=N+S+E+W) 101 | 102 | no_coins = Label(pycrypto, text=coin[2], bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 103 | no_coins.grid(row=coin_row, column=3, sticky=N+S+E+W) 104 | 105 | amount_paid = Label(pycrypto, text="${0:.2f}".format(total_paid), bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 106 | amount_paid.grid(row=coin_row, column=4, sticky=N+S+E+W) 107 | 108 | current_val = Label(pycrypto, text="${0:.2f}".format(current_value), bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 109 | current_val.grid(row=coin_row, column=5, sticky=N+S+E+W) 110 | 111 | pl_coin = Label(pycrypto, text="${0:.2f}".format(pl_percoin), bg="#F3F4F6", fg=font_color(float("{0:.2f}".format(pl_percoin))), font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 112 | pl_coin.grid(row=coin_row, column=6, sticky=N+S+E+W) 113 | 114 | totalpl = Label(pycrypto, text="${0:.2f}".format(total_pl_coin), bg="#F3F4F6", fg=font_color(float("{0:.2f}".format(total_pl_coin))), font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 115 | totalpl.grid(row=coin_row, column=7, sticky=N+S+E+W) 116 | 117 | coin_row += 1 118 | 119 | #INSERT COIN 120 | symbol_txt = Entry(pycrypto, borderwidth=2, relief="groove") 121 | symbol_txt.grid(row=coin_row+1, column=1) 122 | 123 | price_txt = Entry(pycrypto, borderwidth=2, relief="groove") 124 | price_txt.grid(row=coin_row+1, column=2) 125 | 126 | amount_txt = Entry(pycrypto, borderwidth=2, relief="groove") 127 | amount_txt.grid(row=coin_row+1, column=3) 128 | 129 | add_coin = Button(pycrypto, text="Add Coin", bg="#142E54", fg="white", command=insert_coin ,font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 130 | add_coin.grid(row=coin_row + 1, column=4, sticky=N+S+E+W) 131 | 132 | #UPDATE COIN 133 | portid_update = Entry(pycrypto, borderwidth=2, relief="groove") 134 | portid_update.grid(row=coin_row+2, column=0) 135 | 136 | symbol_update = Entry(pycrypto, borderwidth=2, relief="groove") 137 | symbol_update.grid(row=coin_row+2, column=1) 138 | 139 | price_update = Entry(pycrypto, borderwidth=2, relief="groove") 140 | price_update.grid(row=coin_row+2, column=2) 141 | 142 | amount_update = Entry(pycrypto, borderwidth=2, relief="groove") 143 | amount_update.grid(row=coin_row+2, column=3) 144 | 145 | update_coin_txt = Button(pycrypto, text="Update Coin", bg="#142E54", fg="white", command=update_coin ,font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 146 | update_coin_txt.grid(row=coin_row + 2, column=4, sticky=N+S+E+W) 147 | 148 | #DELETE COIN 149 | portid_delete = Entry(pycrypto, borderwidth=2, relief="groove") 150 | portid_delete.grid(row=coin_row+3, column=0) 151 | 152 | delete_coin_txt = Button(pycrypto, text="Delete Coin", bg="#142E54", fg="white", command=delete_coin ,font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 153 | delete_coin_txt.grid(row=coin_row+3, column=4, sticky=N+S+E+W) 154 | 155 | totalap = Label(pycrypto, text="${0:.2f}".format(total_amount_paid), bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 156 | totalap.grid(row=coin_row, column=4, sticky=N+S+E+W) 157 | 158 | totalcv = Label(pycrypto, text="${0:.2f}".format(total_current_value), bg="#F3F4F6", fg="black", font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 159 | totalcv.grid(row=coin_row, column=5, sticky=N+S+E+W) 160 | 161 | totalpl = Label(pycrypto, text="${0:.2f}".format(total_pl), bg="#F3F4F6", fg=font_color(float("{0:.2f}".format(total_pl))), font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 162 | totalpl.grid(row=coin_row, column=7, sticky=N+S+E+W) 163 | 164 | api = "" 165 | 166 | refresh = Button(pycrypto, text="Refresh", bg="#142E54", fg="white", command=reset ,font="Lato 12", borderwidth=2, relief="groove", padx="2", pady="2") 167 | refresh.grid(row=coin_row + 1, column=7, sticky=N+S+E+W) 168 | 169 | def app_header(): 170 | portfolio_id = Label(pycrypto, text="Portfolio ID", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 171 | portfolio_id.grid(row=0, column=0, sticky=N+S+E+W) 172 | 173 | name = Label(pycrypto, text="Coin Name", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 174 | name.grid(row=0, column=1, sticky=N+S+E+W) 175 | 176 | price = Label(pycrypto, text="Price", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 177 | price.grid(row=0, column=2, sticky=N+S+E+W) 178 | 179 | no_coins = Label(pycrypto, text="Coin Owned", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 180 | no_coins.grid(row=0, column=3, sticky=N+S+E+W) 181 | 182 | amount_paid = Label(pycrypto, text="Total Amount Paid", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 183 | amount_paid.grid(row=0, column=4, sticky=N+S+E+W) 184 | 185 | current_val = Label(pycrypto, text="Current Value", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 186 | current_val.grid(row=0, column=5, sticky=N+S+E+W) 187 | 188 | pl_coin = Label(pycrypto, text="P/L Per Coin", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 189 | pl_coin.grid(row=0, column=6, sticky=N+S+E+W) 190 | 191 | totalpl = Label(pycrypto, text="Total P/L With Coin", bg="#142E54", fg="white", font="Lato 12 bold", padx="5", pady="5", borderwidth=2, relief="groove") 192 | totalpl.grid(row=0, column=7, sticky=N+S+E+W) 193 | 194 | app_nav() 195 | app_header() 196 | my_portfolio() 197 | pycrypto.mainloop() 198 | 199 | cursorObj.close() 200 | con.close() 201 | -------------------------------------------------------------------------------- /Section 22 and 24/Python-GUI-Programming-With-Tkinter-master/pycrypto.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | 4 | api_request = requests.get("https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=5&convert=USD&CMC_PRO_API_KEY=3889ce63-c733-403d-8b7d-c41a2438b4ea") 5 | api = json.loads(api_request.content) 6 | 7 | print("----------------") 8 | print("----------------") 9 | 10 | coins = [ 11 | { 12 | "symbol":"BTC", 13 | "amount_owned": 2, 14 | "price_per_coin": 3200 15 | }, 16 | { 17 | "symbol":"EOS", 18 | "amount_owned": 100, 19 | "price_per_coin": 2.05 20 | } 21 | ] 22 | 23 | total_pl = 0 24 | 25 | for i in range(0, 5): 26 | for coin in coins: 27 | if api["data"][i]["symbol"] == coin["symbol"]: 28 | total_paid = coin["amount_owned"] * coin["price_per_coin"] 29 | current_value = coin["amount_owned"] * api["data"][i]["quote"]["USD"]["price"] 30 | pl_percoin = api["data"][i]["quote"]["USD"]["price"] - coin["price_per_coin"] 31 | total_pl_coin = pl_percoin * coin["amount_owned"] 32 | 33 | total_pl = total_pl + total_pl_coin 34 | 35 | print(api["data"][i]["name"] + " - " + api["data"][i]["symbol"]) 36 | print("Price - ${0:.2f}".format(api["data"][i]["quote"]["USD"]["price"])) 37 | print("Number Of Coin:", coin["amount_owned"]) 38 | print("Total Amount Paid:", "${0:.2f}".format(total_paid)) 39 | print("Current Value:", "${0:.2f}".format(current_value)) 40 | print("P/L Per Coin:", "${0:.2f}".format(pl_percoin)) 41 | print("Total P/L With Coin:", "${0:.2f}".format(total_pl_coin)) 42 | print("----------------") 43 | 44 | print("Total P/L For Portfolio:", "${0:.2f}".format(total_pl)) 45 | -------------------------------------------------------------------------------- /Section 23/Creating Table Working with DB Browser.txt: -------------------------------------------------------------------------------- 1 | https://www.sqlite.org/datatype3.html -------------------------------------------------------------------------------- /Section 23/DB Browser for SQLite.txt: -------------------------------------------------------------------------------- 1 | https://sqlitebrowser.org/ -------------------------------------------------------------------------------- /Section 25/Creating Twitter Developer Account.txt: -------------------------------------------------------------------------------- 1 | https://developer.twitter.com/content/developer-twitter/en.html -------------------------------------------------------------------------------- /Section 25/Deployment Done Along Testing.txt: -------------------------------------------------------------------------------- 1 | https://help.pythonanywhere.com/pages/InstallingNewModules/ -------------------------------------------------------------------------------- /Section 25/Installing Tweepy.txt: -------------------------------------------------------------------------------- 1 | http://docs.tweepy.org/en/latest/auth_tutorial.html -------------------------------------------------------------------------------- /Section 4/Reserve+Words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 4/Reserve+Words.png -------------------------------------------------------------------------------- /Section 5/Arithmetic+Operation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 5/Arithmetic+Operation.png -------------------------------------------------------------------------------- /Section 5/Assignment+Operators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 5/Assignment+Operators.png -------------------------------------------------------------------------------- /Section 5/General+Print+Commands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 5/General+Print+Commands.png -------------------------------------------------------------------------------- /Section 5/Logical+Operator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 5/Logical+Operator.png -------------------------------------------------------------------------------- /Section 5/Relational+Operator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 5/Relational+Operator.png -------------------------------------------------------------------------------- /Section 7/Editor 1 - Issue With Atom Terminal.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Python-A-Z---Learn-Python-Programming-By-Building-6-Projects/666f2f873272f2e2ad30b39f5732fcf962ad3799/Section 7/Editor 1 - Issue With Atom Terminal.docx -------------------------------------------------------------------------------- /Section 7/How to Launch Terminal in the Current Folder Location on Mac.txt: -------------------------------------------------------------------------------- 1 | https://www.maketecheasier.com/launch-terminal-current-folder-mac/ --------------------------------------------------------------------------------