├── A-Path-Finding-Visualization ├── get_pip.py ├── install_requirements.py ├── path_finding.py └── requirements.txt ├── Android-Apps-Downloader ├── g_x_apps.sqlite ├── google_apps │ └── com.codebear.igame.apk ├── gplaycli.conf ├── ids_done.txt ├── scraper.py ├── tmp │ └── Note.txt ├── wget.exe └── xiomi_apps │ └── com.codebear.igame.apk ├── Car Game ├── background.jpg ├── background2.jpg ├── car.jpg ├── car1.jpg ├── car2.jpg ├── car4.jpg ├── car5.jpg ├── car6.jpg ├── car7.jpg ├── download12.jpg ├── game.py ├── strip.jpg ├── window.py └── yellow strip.jpg ├── Flappy bird game ├── Flappy_bird.py └── imgs │ ├── base.png │ ├── bg.png │ ├── bird1.png │ ├── bird2.png │ ├── bird3.png │ └── pipe.png ├── Id card generator ├── id_gen.py ├── index.py └── setup.py ├── LIBRARY MANAGEMENT SYSTEM ├── README.md ├── __pycache__ │ └── icons_rc.cpython-36.pyc ├── db.sql ├── icons.qrc ├── icons │ ├── books.png │ ├── flat.png │ ├── settings.png │ ├── themes.png │ ├── today.png │ └── users.png ├── icons_rc.py ├── index.py ├── library.ui ├── library2.ui ├── outline.txt └── themes │ ├── darkblue.css │ ├── darkgray.css │ ├── darkorange.css │ └── qdark.css ├── Msp-Certificate-Generator └── c ├── PDF Converter ├── PDF Converter.py └── setup.py ├── Password Generator ├── GUI.py └── Secure Password Generator.py ├── Qbar Attendance ├── 24-10-2019_11-10-46_AM.txt ├── Qbar Attendance Encoder.py └── Qr Generate │ ├── Generate Py3.py │ ├── a.jpg │ ├── names.txt │ ├── saad.bmp │ └── sumama.bmp ├── README.md ├── Scraping software ├── index.py ├── scrapApp.py └── scraper.ui ├── audio control └── audio_control.py ├── get project import └── get-import.py ├── image.png ├── python wifi key └── WiFi Password.py ├── speech recognition ├── audiofile recognition.py ├── info.mp3 ├── maybe-next-time-huh.wav ├── pick-up-the-phone-1.wav ├── speech recognition.py ├── temp.mp3 ├── temp.wav ├── text to speech.py └── url open.py ├── usb port disabler └── usb-port-disabler.py └── web automation ├── LinkedinBot.py ├── YoutubeBot.py ├── debug.log ├── facebookbot.py ├── geckodriver.log ├── instagrambot.py └── twitterbot.py /A-Path-Finding-Visualization/install_requirements.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | import get_pip 4 | import os 5 | import importlib 6 | import contextlib 7 | 8 | def install(package): 9 | ''' 10 | installs a package using pip 11 | 12 | :param package: string 13 | ''' 14 | subprocess.call([sys.executable, "-m", "pip", "install", package]) 15 | 16 | 17 | required = [] 18 | failed = [] 19 | 20 | # Try to open reqirements.txt file and read all required packages 21 | try: 22 | file = open("requirements.txt", "r") 23 | file_lines = file.readlines() 24 | required = [line.strip().lower() for line in file_lines] 25 | file.close() 26 | except FileNotFoundError: 27 | print("[ERROR] No requiremnts.txt file found") 28 | 29 | 30 | if len(required) > 0: 31 | print("[INPUT] You are about to install", len(required), "packages, would you like to proceed (y/n):", end=" ") 32 | ans = input() 33 | 34 | if ans.lower() == "y": 35 | for package in required: 36 | try: 37 | print("[LOG] Looking for", package) 38 | with contextlib.redirect_stdout(None): 39 | __import__(package) 40 | print("[LOG]", package, "is already installed, skipping...") 41 | except ImportError: 42 | print("[LOG]", package, "not installed") 43 | 44 | try: 45 | print("[LOG] Trying to install", package, "via pip") 46 | try: 47 | import pip 48 | except: 49 | print("[EXCEPTION] Pip is not installed") 50 | print("[LOG] Trying to install pip") 51 | get_pip.main() 52 | print("[LOG] Pip has been installed") 53 | 54 | print("[LOG] Installing", package) 55 | install(package) 56 | with contextlib.redirect_stdout(None): 57 | __import__(package) 58 | print("[LOG]", package, "has been installed") 59 | except Exception as e: 60 | print("[ERROR] Could not install", package, "-", e) 61 | failed.append(package) 62 | 63 | else: 64 | print("[STOP] Operation terminated by user") 65 | else: 66 | print("[LOG] No packages to install") 67 | 68 | if len(failed) > 0: 69 | print("[FAILED]", len(failed), "package(s) were not installed. Failed package install(s):", end=" ") 70 | for x, package in enumerate(failed): 71 | if x != len(failed) -1: 72 | print(package, end=",") 73 | else: 74 | print(package) 75 | -------------------------------------------------------------------------------- /A-Path-Finding-Visualization/path_finding.py: -------------------------------------------------------------------------------- 1 | 2 | try: 3 | import pygame 4 | import sys 5 | import math 6 | from tkinter import * 7 | from tkinter import ttk 8 | from tkinter import messagebox 9 | import os 10 | except: 11 | import install_requirements # install packages 12 | 13 | import pygame 14 | import sys 15 | import math 16 | from tkinter import * 17 | from tkinter import ttk 18 | from tkinter import messagebox 19 | import os 20 | 21 | screen = pygame.display.set_mode((800, 800)) 22 | 23 | class spot: 24 | def __init__(self, x, y): 25 | self.i = x 26 | self.j = y 27 | self.f = 0 28 | self.g = 0 29 | self.h = 0 30 | self.neighbors = [] 31 | self.previous = None 32 | self.obs = False 33 | self.closed = False 34 | self.value = 1 35 | 36 | def show(self, color, st): 37 | if self.closed == False : 38 | pygame.draw.rect(screen, color, (self.i * w, self.j * h, w, h), st) 39 | pygame.display.update() 40 | 41 | def path(self, color, st): 42 | pygame.draw.rect(screen, color, (self.i * w, self.j * h, w, h), st) 43 | pygame.display.update() 44 | 45 | def addNeighbors(self, grid): 46 | i = self.i 47 | j = self.j 48 | if i < cols-1 and grid[self.i + 1][j].obs == False: 49 | self.neighbors.append(grid[self.i + 1][j]) 50 | if i > 0 and grid[self.i - 1][j].obs == False: 51 | self.neighbors.append(grid[self.i - 1][j]) 52 | if j < row-1 and grid[self.i][j + 1].obs == False: 53 | self.neighbors.append(grid[self.i][j + 1]) 54 | if j > 0 and grid[self.i][j - 1].obs == False: 55 | self.neighbors.append(grid[self.i][j - 1]) 56 | #diagonal 57 | 58 | if j > 0 and i > 0 and grid[self.i - 1][j - 1].obs == False: 59 | self.neighbors.append(grid[self.i - 1][j - 1]) 60 | ind = self.neighbors.index(grid[self.i - 1][j - 1]) 61 | self.neighbors[ind].value = math.sqrt(2) 62 | 63 | if j - 1 > 0 and j + 1 < row and i < cols - 1 and grid[self.i - 1][j + 1].obs == False: 64 | self.neighbors.append(grid[self.i - 1][j + 1]) 65 | ind = self.neighbors.index(grid[self.i - 1][j + 1]) 66 | self.neighbors[ind].value = math.sqrt(2) 67 | 68 | if j - 1 < row and i < cols - 1 and grid[self.i + 1][j - 1].obs == False: 69 | self.neighbors.append(grid[self.i + 1][j - 1]) 70 | ind = self.neighbors.index(grid[self.i + 1][j - 1]) 71 | self.neighbors[ind].value = math.sqrt(2) 72 | 73 | if j < row - 1 and i < cols - 1 and grid[self.i + 1][j + 1].obs == False: 74 | self.neighbors.append(grid[self.i + 1][j + 1]) 75 | ind = self.neighbors.index(grid[self.i + 1][j + 1]) 76 | self.neighbors[ind].value = math.sqrt(2) 77 | 78 | 79 | cols = 50 80 | grid = [0 for i in range(cols)] 81 | row = 50 82 | openSet = [] 83 | closedSet = [] 84 | red = (255, 0, 0) 85 | green = (0, 255, 0) 86 | blue = (0, 0, 255) 87 | grey = (220, 220, 220) 88 | w = 800 / cols 89 | h = 800 / row 90 | cameFrom = [] 91 | 92 | # create 2d array 93 | for i in range(cols): 94 | grid[i] = [0 for i in range(row)] 95 | 96 | # Create Spots 97 | for i in range(cols): 98 | for j in range(row): 99 | grid[i][j] = spot(i, j) 100 | 101 | 102 | # Set start and end node 103 | start = grid[12][5] 104 | end = grid[3][6] 105 | # SHOW RECT 106 | for i in range(cols): 107 | for j in range(row): 108 | grid[i][j].show((255, 255, 255), 1) 109 | 110 | for i in range(0,row): 111 | grid[0][i].show(grey, 0) 112 | grid[0][i].obs = True 113 | grid[cols-1][i].obs = True 114 | grid[cols-1][i].show(grey, 0) 115 | grid[i][row-1].show(grey, 0) 116 | grid[i][0].show(grey, 0) 117 | grid[i][0].obs = True 118 | grid[i][row-1].obs = True 119 | 120 | def onsubmit(): 121 | global start 122 | global end 123 | st = startBox.get().split(',') 124 | ed = endBox.get().split(',') 125 | start = grid[int(st[0])][int(st[1])] 126 | end = grid[int(ed[0])][int(ed[1])] 127 | window.quit() 128 | window.destroy() 129 | 130 | window = Tk() 131 | label = Label(window, text='Start(x,y): ') 132 | startBox = Entry(window) 133 | label1 = Label(window, text='End(x,y): ') 134 | endBox = Entry(window) 135 | var = IntVar() 136 | showPath = ttk.Checkbutton(window, text='Show Steps :', onvalue=1, offvalue=0, variable=var) 137 | 138 | submit = Button(window, text='Submit', command=onsubmit) 139 | 140 | showPath.grid(columnspan=2, row=2) 141 | submit.grid(columnspan=2, row=3) 142 | label1.grid(row=1, pady=3) 143 | endBox.grid(row=1, column=1, pady=3) 144 | startBox.grid(row=0, column=1, pady=3) 145 | label.grid(row=0, pady=3) 146 | 147 | window.update() 148 | mainloop() 149 | 150 | pygame.init() 151 | openSet.append(start) 152 | 153 | def mousePress(x): 154 | t = x[0] 155 | w = x[1] 156 | g1 = t // (800 // cols) 157 | g2 = w // (800 // row) 158 | acess = grid[g1][g2] 159 | if acess != start and acess != end: 160 | if acess.obs == False: 161 | acess.obs = True 162 | acess.show((255, 255, 255), 0) 163 | 164 | end.show((255, 8, 127), 0) 165 | start.show((255, 8, 127), 0) 166 | 167 | loop = True 168 | while loop: 169 | ev = pygame.event.get() 170 | 171 | for event in ev: 172 | if event.type == pygame.QUIT: 173 | pygame.quit() 174 | if pygame.mouse.get_pressed()[0]: 175 | try: 176 | pos = pygame.mouse.get_pos() 177 | mousePress(pos) 178 | except AttributeError: 179 | pass 180 | elif event.type == pygame.KEYDOWN: 181 | if event.key == pygame.K_SPACE: 182 | loop = False 183 | break 184 | 185 | for i in range(cols): 186 | for j in range(row): 187 | grid[i][j].addNeighbors(grid) 188 | 189 | def heurisitic(n, e): 190 | d = math.sqrt((n.i - e.i)**2 + (n.j - e.j)**2) 191 | #d = abs(n.i - e.i) + abs(n.j - e.j) 192 | return d 193 | 194 | 195 | def main(): 196 | end.show((255, 8, 127), 0) 197 | start.show((255, 8, 127), 0) 198 | if len(openSet) > 0: 199 | lowestIndex = 0 200 | for i in range(len(openSet)): 201 | if openSet[i].f < openSet[lowestIndex].f: 202 | lowestIndex = i 203 | 204 | current = openSet[lowestIndex] 205 | if current == end: 206 | print('done', current.f) 207 | start.show((255,8,127),0) 208 | temp = current.f 209 | for i in range(round(current.f)): 210 | current.closed = False 211 | current.show((0,0,255), 0) 212 | current = current.previous 213 | end.show((255, 8, 127), 0) 214 | 215 | Tk().wm_withdraw() 216 | result = messagebox.askokcancel('Program Finished', ('The program finished, the shortest distance \n to the path is ' + str(temp) + ' blocks away, \n would you like to re run the program?')) 217 | if result == True: 218 | os.execl(sys.executable,sys.executable, *sys.argv) 219 | else: 220 | ag = True 221 | while ag: 222 | ev = pygame.event.get() 223 | for event in ev: 224 | if event.type == pygame.KEYDOWN: 225 | ag = False 226 | break 227 | pygame.quit() 228 | 229 | openSet.pop(lowestIndex) 230 | closedSet.append(current) 231 | 232 | neighbors = current.neighbors 233 | for i in range(len(neighbors)): 234 | neighbor = neighbors[i] 235 | if neighbor not in closedSet: 236 | tempG = current.g + current.value 237 | if neighbor in openSet: 238 | if neighbor.g > tempG: 239 | neighbor.g = tempG 240 | else: 241 | neighbor.g = tempG 242 | openSet.append(neighbor) 243 | 244 | neighbor.h = heurisitic(neighbor, end) 245 | neighbor.f = neighbor.g + neighbor.h 246 | 247 | if neighbor.previous == None: 248 | neighbor.previous = current 249 | if var.get(): 250 | for i in range(len(openSet)): 251 | openSet[i].show(green, 0) 252 | 253 | for i in range(len(closedSet)): 254 | if closedSet[i] != start: 255 | closedSet[i].show(red, 0) 256 | current.closed = True 257 | 258 | 259 | while True: 260 | ev = pygame.event.poll() 261 | if ev.type == pygame.QUIT: 262 | pygame.quit() 263 | pygame.display.update() 264 | main() 265 | 266 | -------------------------------------------------------------------------------- /A-Path-Finding-Visualization/requirements.txt: -------------------------------------------------------------------------------- 1 | pygame 2 | -------------------------------------------------------------------------------- /Android-Apps-Downloader/g_x_apps.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Android-Apps-Downloader/g_x_apps.sqlite -------------------------------------------------------------------------------- /Android-Apps-Downloader/google_apps/com.codebear.igame.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Android-Apps-Downloader/google_apps/com.codebear.igame.apk -------------------------------------------------------------------------------- /Android-Apps-Downloader/gplaycli.conf: -------------------------------------------------------------------------------- 1 | [Credentials] 2 | gmail_address= 3 | gmail_password= 4 | #keyring_service=gplaycli 5 | token=True 6 | token_url=https://matlink.fr/token/email/gsfid 7 | 8 | [Cache] 9 | token=~/.cache/gplaycli/token 10 | 11 | [Locale] 12 | locale=en_GB 13 | timezone=CEST -------------------------------------------------------------------------------- /Android-Apps-Downloader/ids_done.txt: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /Android-Apps-Downloader/scraper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import sqlite3 4 | import ssl 5 | import time 6 | import platform 7 | from urllib.request import urlopen 8 | 9 | try: 10 | import httplib 11 | except: 12 | import http.client as httplib 13 | 14 | 15 | # check whether the internet is working or not 16 | def have_internet(): 17 | conn = httplib.HTTPConnection("www.google.com", timeout=5) 18 | try: 19 | conn.request("HEAD", "/") 20 | conn.close() 21 | return True 22 | except: 23 | conn.close() 24 | return False 25 | 26 | 27 | # -------------------------------------------------------------------- 28 | 29 | def exit_gracefully(): 30 | f.close() 31 | conn.commit() 32 | print("Exiting....") 33 | 34 | exit() 35 | 36 | 37 | # -------------------------------------------------------------------- 38 | 39 | 40 | # Ignore SSL certificate errors 41 | ctx = ssl.create_default_context() 42 | ctx.check_hostname = False 43 | ctx.verify_mode = ssl.CERT_NONE 44 | 45 | if __name__ == '__main__': 46 | 47 | target = 1000000 48 | 49 | if platform.system()=="Linux": 50 | download_dir = os.getcwd() + "/tmp/" 51 | else: 52 | download_dir = os.getcwd() + "\\tmp\\" 53 | 54 | database = "g_x_apps.sqlite" 55 | 56 | conn = sqlite3.connect(database) 57 | cur = conn.cursor() 58 | 59 | base_site = "http://app.mi.com/download/" 60 | 61 | # load the last id number from which to continue downloading 62 | f = open("ids_done.txt", "r") 63 | numbers = f.readlines() 64 | numbers = [a.rstrip() for a in numbers] 65 | curr_num = int(numbers[-1]) 66 | f.close() 67 | 68 | f = open("ids_done.txt", "a") 69 | c = 1 70 | 71 | while curr_num != target: 72 | try: 73 | curr_num += 1 74 | 75 | c += 1 76 | # commit after every 500 iterations 77 | if c == 500: 78 | conn.commit() 79 | c = 0 80 | 81 | # check net connectivity 82 | if not have_internet(): 83 | 84 | # save progress 85 | conn.commit() 86 | f.close() 87 | 88 | print("Internet disconnected.. waiting") 89 | while not have_internet(): 90 | time.sleep(5) 91 | 92 | f = open("ids_done.txt", "a") 93 | print("Connected!") 94 | 95 | print("------------------------------------------") 96 | print("Processing:", curr_num) 97 | 98 | # empty left over downloads 99 | if platform.system() == 'Linux': 100 | os.system("rm -f '" + download_dir + "{*,.*}'") 101 | else: 102 | os.system('del "' + download_dir + '*" /Q') 103 | 104 | # ------------------------------------------------------------------ 105 | # check whether app on xiomi exists or not 106 | try: 107 | url = base_site + str(curr_num) 108 | html = urlopen(url, context=ctx) 109 | 110 | # check apk exists or not 111 | if html.url[-4:] != ".apk": 112 | f.write(str(curr_num) + "\n") 113 | print("No app against this ID on Xiaomi Store") 114 | continue 115 | 116 | # if it exists 117 | package = html.url.split('/')[-1] 118 | package = package.split(".apk")[0] 119 | 120 | print("Found on Xiaomi:", package) 121 | except: 122 | f.write(str(curr_num) + "\n") 123 | print("No app against this ID on Xiaomi Store") 124 | continue 125 | # ------------------------------------------------------------------ 126 | 127 | # ------------------------------------------------------------------ 128 | # check if the same app exists on google 129 | try: 130 | url = "https://play.google.com/store/apps/details?id=" + package 131 | html = urlopen(url, context=ctx) 132 | 133 | if str(html.getcode()) != '200': 134 | f.write(str(curr_num) + "\n") 135 | print(package, " doesn't exist on Play Store") 136 | continue 137 | 138 | # if it exists 139 | print("Found on PlayStore:", package) 140 | except: 141 | f.write(str(curr_num) + "\n") 142 | print(package, " doesn't exist on Play Store") 143 | continue 144 | # ------------------------------------------------------------------ 145 | 146 | # ------------------------------------------------------------------ 147 | # download google 148 | print("Downloading from Playstore") 149 | os.system('gplaycli -d ' + package + ' -f "' + 'google_apps"' + ' -p') 150 | 151 | # check if a file of that apk is created 152 | if platform.system() == "Linux": 153 | dir = os.getcwd() + "/google_apps/" + package + ".apk" 154 | else: 155 | dir = os.getcwd() + "\\google_apps\\" + package + ".apk" 156 | 157 | time.sleep(1) 158 | save = False 159 | 160 | # check if that directory exists 161 | if os.path.exists(dir): 162 | save = True 163 | 164 | if not save: 165 | f.write(str(curr_num) + "\n") 166 | print("App from playstore not downloaded (might be paid app or not available in your country).") 167 | continue 168 | 169 | print(package, ": Google Download Successful") 170 | # ------------------------------------------------------------------ 171 | 172 | # ------------------------------------------------------------------ 173 | # download xiomi 174 | print("Downloading from Xiaomi") 175 | os.system("wget -P tmp/ --content-disposition -q " + base_site + str(curr_num)) 176 | 177 | # rename the file and move it to its folder 178 | for file in os.listdir(download_dir): 179 | if file.endswith(".apk"): 180 | print('Moving Xiomi File...') 181 | shutil.move(download_dir + file, "xiomi_apps/" + package + ".apk") 182 | 183 | cur.execute("INSERT OR IGNORE INTO APPS VALUES (?,1,1,0)", 184 | (package,)) 185 | 186 | print(package, ": Xiomi Download Successful") 187 | 188 | else: 189 | error = 'Error in downloading' 190 | print(error, package) 191 | # ------------------------------------------------------------------ 192 | 193 | f.write(str(curr_num) + "\n") 194 | 195 | except KeyboardInterrupt: 196 | exit_gracefully() 197 | 198 | except: 199 | pass 200 | 201 | print("-----------------------------") 202 | print("Downloads Complete!!!") 203 | print("-----------------------------") 204 | 205 | print('\n\nProcess Successfully finished!!!!!\n\n') 206 | 207 | f.close() 208 | conn.commit() 209 | -------------------------------------------------------------------------------- /Android-Apps-Downloader/tmp/Note.txt: -------------------------------------------------------------------------------- 1 | This folder is the temporary download directory for an app. After the app is downloaded, it is moved 2 | to the relavant download folder. -------------------------------------------------------------------------------- /Android-Apps-Downloader/wget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Android-Apps-Downloader/wget.exe -------------------------------------------------------------------------------- /Android-Apps-Downloader/xiomi_apps/com.codebear.igame.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Android-Apps-Downloader/xiomi_apps/com.codebear.igame.apk -------------------------------------------------------------------------------- /Car Game/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/background.jpg -------------------------------------------------------------------------------- /Car Game/background2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/background2.jpg -------------------------------------------------------------------------------- /Car Game/car.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car.jpg -------------------------------------------------------------------------------- /Car Game/car1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car1.jpg -------------------------------------------------------------------------------- /Car Game/car2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car2.jpg -------------------------------------------------------------------------------- /Car Game/car4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car4.jpg -------------------------------------------------------------------------------- /Car Game/car5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car5.jpg -------------------------------------------------------------------------------- /Car Game/car6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car6.jpg -------------------------------------------------------------------------------- /Car Game/car7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/car7.jpg -------------------------------------------------------------------------------- /Car Game/download12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/download12.jpg -------------------------------------------------------------------------------- /Car Game/game.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | pygame.init() 3 | gray=(119,118,110) 4 | black=(0,0,0) 5 | red=(255,0,0) 6 | green=(0,200,0) 7 | blue=(0,0,200) 8 | bright_red=(255,0,0) 9 | bright_green=(0,255,0) 10 | bright_blue=(0,0,255) 11 | display_width=800 12 | display_height=600 13 | import time 14 | import random 15 | 16 | 17 | gamedisplays=pygame.display.set_mode((display_width,display_height)) 18 | pygame.display.set_caption("car game") 19 | clock=pygame.time.Clock() 20 | carimg=pygame.image.load('car1.jpg') 21 | backgroundpic=pygame.image.load("download12.jpg") 22 | yellow_strip=pygame.image.load("yellow strip.jpg") 23 | strip=pygame.image.load("strip.jpg") 24 | intro_background=pygame.image.load("background.jpg") 25 | instruction_background=pygame.image.load("background2.jpg") 26 | car_width=56 27 | pause=False 28 | 29 | def intro_loop(): 30 | intro=True 31 | while intro: 32 | for event in pygame.event.get(): 33 | if event.type==pygame.QUIT: 34 | pygame.quit() 35 | quit() 36 | sys.exit() 37 | gamedisplays.blit(intro_background,(0,0)) 38 | largetext=pygame.font.Font('freesansbold.ttf',115) 39 | TextSurf,TextRect=text_objects("CAR GAME",largetext) 40 | TextRect.center=(400,100) 41 | gamedisplays.blit(TextSurf,TextRect) 42 | button("START",150,520,100,50,green,bright_green,"play") 43 | button("QUIT",550,520,100,50,red,bright_red,"quit") 44 | button("INSTRUCTION",300,520,200,50,blue,bright_blue,"intro") 45 | pygame.display.update() 46 | clock.tick(50) 47 | 48 | 49 | def button(msg,x,y,w,h,ic,ac,action=None): 50 | mouse=pygame.mouse.get_pos() 51 | click=pygame.mouse.get_pressed() 52 | if x+w>mouse[0]>x and y+h>mouse[1]>y: 53 | pygame.draw.rect(gamedisplays,ac,(x,y,w,h)) 54 | if click[0]==1 and action!=None: 55 | if action=="play": 56 | countdown() 57 | elif action=="quit": 58 | pygame.quit() 59 | quit() 60 | sys.exit() 61 | elif action=="intro": 62 | introduction() 63 | elif action=="menu": 64 | intro_loop() 65 | elif action=="pause": 66 | paused() 67 | elif action=="unpause": 68 | unpaused() 69 | 70 | 71 | else: 72 | pygame.draw.rect(gamedisplays,ic,(x,y,w,h)) 73 | smalltext=pygame.font.Font("freesansbold.ttf",20) 74 | textsurf,textrect=text_objects(msg,smalltext) 75 | textrect.center=((x+(w/2)),(y+(h/2))) 76 | gamedisplays.blit(textsurf,textrect) 77 | 78 | 79 | def introduction(): 80 | introduction=True 81 | while introduction: 82 | for event in pygame.event.get(): 83 | if event.type==pygame.QUIT: 84 | pygame.quit() 85 | quit() 86 | sys.exit() 87 | gamedisplays.blit(instruction_background,(0,0)) 88 | largetext=pygame.font.Font('freesansbold.ttf',80) 89 | smalltext=pygame.font.Font('freesansbold.ttf',20) 90 | mediumtext=pygame.font.Font('freesansbold.ttf',40) 91 | textSurf,textRect=text_objects("This is an car game in which you need dodge the coming cars",smalltext) 92 | textRect.center=((350),(200)) 93 | TextSurf,TextRect=text_objects("INSTRUCTION",largetext) 94 | TextRect.center=((400),(100)) 95 | gamedisplays.blit(TextSurf,TextRect) 96 | gamedisplays.blit(textSurf,textRect) 97 | stextSurf,stextRect=text_objects("ARROW LEFT : LEFT TURN",smalltext) 98 | stextRect.center=((150),(400)) 99 | hTextSurf,hTextRect=text_objects("ARROW RIGHT : RIGHT TURN" ,smalltext) 100 | hTextRect.center=((150),(450)) 101 | atextSurf,atextRect=text_objects("A : ACCELERATOR",smalltext) 102 | atextRect.center=((150),(500)) 103 | rtextSurf,rtextRect=text_objects("B : BRAKE ",smalltext) 104 | rtextRect.center=((150),(550)) 105 | ptextSurf,ptextRect=text_objects("P : PAUSE ",smalltext) 106 | ptextRect.center=((150),(350)) 107 | sTextSurf,sTextRect=text_objects("CONTROLS",mediumtext) 108 | sTextRect.center=((350),(300)) 109 | gamedisplays.blit(sTextSurf,sTextRect) 110 | gamedisplays.blit(stextSurf,stextRect) 111 | gamedisplays.blit(hTextSurf,hTextRect) 112 | gamedisplays.blit(atextSurf,atextRect) 113 | gamedisplays.blit(rtextSurf,rtextRect) 114 | gamedisplays.blit(ptextSurf,ptextRect) 115 | button("BACK",600,450,100,50,blue,bright_blue,"menu") 116 | pygame.display.update() 117 | clock.tick(30) 118 | 119 | def paused(): 120 | global pause 121 | 122 | while pause: 123 | for event in pygame.event.get(): 124 | if event.type==pygame.QUIT: 125 | pygame.quit() 126 | quit() 127 | sys.exit() 128 | gamedisplays.blit(instruction_background,(0,0)) 129 | largetext=pygame.font.Font('freesansbold.ttf',115) 130 | TextSurf,TextRect=text_objects("PAUSED",largetext) 131 | TextRect.center=((display_width/2),(display_height/2)) 132 | gamedisplays.blit(TextSurf,TextRect) 133 | button("CONTINUE",150,450,150,50,green,bright_green,"unpause") 134 | button("RESTART",350,450,150,50,blue,bright_blue,"play") 135 | button("MAIN MENU",550,450,200,50,red,bright_red,"menu") 136 | pygame.display.update() 137 | clock.tick(30) 138 | 139 | def unpaused(): 140 | global pause 141 | pause=False 142 | 143 | 144 | def countdown_background(): 145 | font=pygame.font.SysFont(None,25) 146 | x=(display_width*0.45) 147 | y=(display_height*0.8) 148 | gamedisplays.blit(backgroundpic,(0,0)) 149 | gamedisplays.blit(backgroundpic,(0,200)) 150 | gamedisplays.blit(backgroundpic,(0,400)) 151 | gamedisplays.blit(backgroundpic,(700,0)) 152 | gamedisplays.blit(backgroundpic,(700,200)) 153 | gamedisplays.blit(backgroundpic,(700,400)) 154 | gamedisplays.blit(yellow_strip,(400,100)) 155 | gamedisplays.blit(yellow_strip,(400,200)) 156 | gamedisplays.blit(yellow_strip,(400,300)) 157 | gamedisplays.blit(yellow_strip,(400,400)) 158 | gamedisplays.blit(yellow_strip,(400,100)) 159 | gamedisplays.blit(yellow_strip,(400,500)) 160 | gamedisplays.blit(yellow_strip,(400,0)) 161 | gamedisplays.blit(yellow_strip,(400,600)) 162 | gamedisplays.blit(strip,(120,200)) 163 | gamedisplays.blit(strip,(120,0)) 164 | gamedisplays.blit(strip,(120,100)) 165 | gamedisplays.blit(strip,(680,100)) 166 | gamedisplays.blit(strip,(680,0)) 167 | gamedisplays.blit(strip,(680,200)) 168 | gamedisplays.blit(carimg,(x,y)) 169 | text=font.render("DODGED: 0",True, black) 170 | score=font.render("SCORE: 0",True,red) 171 | gamedisplays.blit(text,(0,50)) 172 | gamedisplays.blit(score,(0,30)) 173 | button("PAUSE",650,0,150,50,blue,bright_blue,"pause") 174 | 175 | def countdown(): 176 | countdown=True 177 | 178 | while countdown: 179 | for event in pygame.event.get(): 180 | if event.type==pygame.QUIT: 181 | pygame.quit() 182 | quit() 183 | sys.exit() 184 | gamedisplays.fill(gray) 185 | countdown_background() 186 | largetext=pygame.font.Font('freesansbold.ttf',115) 187 | TextSurf,TextRect=text_objects("3",largetext) 188 | TextRect.center=((display_width/2),(display_height/2)) 189 | gamedisplays.blit(TextSurf,TextRect) 190 | pygame.display.update() 191 | clock.tick(1) 192 | gamedisplays.fill(gray) 193 | countdown_background() 194 | largetext=pygame.font.Font('freesansbold.ttf',115) 195 | TextSurf,TextRect=text_objects("2",largetext) 196 | TextRect.center=((display_width/2),(display_height/2)) 197 | gamedisplays.blit(TextSurf,TextRect) 198 | pygame.display.update() 199 | clock.tick(1) 200 | gamedisplays.fill(gray) 201 | countdown_background() 202 | largetext=pygame.font.Font('freesansbold.ttf',115) 203 | TextSurf,TextRect=text_objects("1",largetext) 204 | TextRect.center=((display_width/2),(display_height/2)) 205 | gamedisplays.blit(TextSurf,TextRect) 206 | pygame.display.update() 207 | clock.tick(1) 208 | gamedisplays.fill(gray) 209 | countdown_background() 210 | largetext=pygame.font.Font('freesansbold.ttf',115) 211 | TextSurf,TextRect=text_objects("GO!!!",largetext) 212 | TextRect.center=((display_width/2),(display_height/2)) 213 | gamedisplays.blit(TextSurf,TextRect) 214 | pygame.display.update() 215 | clock.tick(1) 216 | game_loop() 217 | 218 | def obstacle(obs_startx,obs_starty,obs): 219 | if obs==0: 220 | obs_pic=pygame.image.load("car.jpg") 221 | elif obs==1: 222 | obs_pic=pygame.image.load("car1.jpg") 223 | elif obs==2: 224 | obs_pic=pygame.image.load("car2.jpg") 225 | elif obs==3: 226 | obs_pic=pygame.image.load("car4.jpg") 227 | elif obs==4: 228 | obs_pic=pygame.image.load("car5.jpg") 229 | elif obs==5: 230 | obs_pic=pygame.image.load("car6.jpg") 231 | elif obs==6: 232 | obs_pic=pygame.image.load("car7.jpg") 233 | gamedisplays.blit(obs_pic,(obs_startx,obs_starty)) 234 | 235 | def score_system(passed,score): 236 | font=pygame.font.SysFont(None,25) 237 | text=font.render("Passed"+str(passed),True,black) 238 | score=font.render("Score"+str(score),True,red) 239 | gamedisplays.blit(text,(0,50)) 240 | gamedisplays.blit(score,(0,30)) 241 | 242 | 243 | def text_objects(text,font): 244 | textsurface=font.render(text,True,black) 245 | return textsurface,textsurface.get_rect() 246 | 247 | def message_display(text): 248 | largetext=pygame.font.Font("freesansbold.ttf",80) 249 | textsurf,textrect=text_objects(text,largetext) 250 | textrect.center=((display_width/2),(display_height/2)) 251 | gamedisplays.blit(textsurf,textrect) 252 | pygame.display.update() 253 | time.sleep(3) 254 | game_loop() 255 | 256 | 257 | def crash(): 258 | message_display("YOU CRASHED") 259 | 260 | 261 | def background(): 262 | gamedisplays.blit(backgroundpic,(0,0)) 263 | gamedisplays.blit(backgroundpic,(0,200)) 264 | gamedisplays.blit(backgroundpic,(0,400)) 265 | gamedisplays.blit(backgroundpic,(700,0)) 266 | gamedisplays.blit(backgroundpic,(700,200)) 267 | gamedisplays.blit(backgroundpic,(700,400)) 268 | gamedisplays.blit(yellow_strip,(400,0)) 269 | gamedisplays.blit(yellow_strip,(400,100)) 270 | gamedisplays.blit(yellow_strip,(400,200)) 271 | gamedisplays.blit(yellow_strip,(400,300)) 272 | gamedisplays.blit(yellow_strip,(400,400)) 273 | gamedisplays.blit(yellow_strip,(400,500)) 274 | gamedisplays.blit(strip,(120,0)) 275 | gamedisplays.blit(strip,(120,100)) 276 | gamedisplays.blit(strip,(120,200)) 277 | gamedisplays.blit(strip,(680,0)) 278 | gamedisplays.blit(strip,(680,100)) 279 | gamedisplays.blit(strip,(680,200)) 280 | 281 | def car(x,y): 282 | gamedisplays.blit(carimg,(x,y)) 283 | 284 | def game_loop(): 285 | global pause 286 | x=(display_width*0.45) 287 | y=(display_height*0.8) 288 | x_change=0 289 | obstacle_speed=9 290 | obs=0 291 | y_change=0 292 | obs_startx=random.randrange(200,(display_width-200)) 293 | obs_starty=-750 294 | obs_width=56 295 | obs_height=125 296 | passed=0 297 | level=0 298 | score=0 299 | y2=7 300 | fps=120 301 | 302 | bumped=False 303 | while not bumped: 304 | for event in pygame.event.get(): 305 | if event.type==pygame.QUIT: 306 | pygame.quit() 307 | quit() 308 | 309 | if event.type==pygame.KEYDOWN: 310 | if event.key==pygame.K_LEFT: 311 | x_change=-5 312 | if event.key==pygame.K_RIGHT: 313 | x_change=5 314 | if event.key==pygame.K_a: 315 | obstacle_speed+=2 316 | if event.key==pygame.K_b: 317 | obstacle_speed-=2 318 | if event.type==pygame.KEYUP: 319 | if event.key==pygame.K_LEFT or event.key==pygame.K_RIGHT: 320 | x_change=0 321 | 322 | x+=x_change 323 | pause=True 324 | gamedisplays.fill(gray) 325 | 326 | rel_y=y2%backgroundpic.get_rect().width 327 | gamedisplays.blit(backgroundpic,(0,rel_y-backgroundpic.get_rect().width)) 328 | gamedisplays.blit(backgroundpic,(700,rel_y-backgroundpic.get_rect().width)) 329 | if rel_y<800: 330 | gamedisplays.blit(backgroundpic,(0,rel_y)) 331 | gamedisplays.blit(backgroundpic,(700,rel_y)) 332 | gamedisplays.blit(yellow_strip,(400,rel_y)) 333 | gamedisplays.blit(yellow_strip,(400,rel_y+100)) 334 | gamedisplays.blit(yellow_strip,(400,rel_y+200)) 335 | gamedisplays.blit(yellow_strip,(400,rel_y+300)) 336 | gamedisplays.blit(yellow_strip,(400,rel_y+400)) 337 | gamedisplays.blit(yellow_strip,(400,rel_y+500)) 338 | gamedisplays.blit(yellow_strip,(400,rel_y-100)) 339 | gamedisplays.blit(strip,(120,rel_y-200)) 340 | gamedisplays.blit(strip,(120,rel_y+20)) 341 | gamedisplays.blit(strip,(120,rel_y+30)) 342 | gamedisplays.blit(strip,(680,rel_y-100)) 343 | gamedisplays.blit(strip,(680,rel_y+20)) 344 | gamedisplays.blit(strip,(680,rel_y+30)) 345 | 346 | y2+=obstacle_speed 347 | 348 | 349 | 350 | 351 | obs_starty-=(obstacle_speed/4) 352 | obstacle(obs_startx,obs_starty,obs) 353 | obs_starty+=obstacle_speed 354 | car(x,y) 355 | score_system(passed,score) 356 | if x>690-car_width or x<110: 357 | crash() 358 | if x>display_width-(car_width+110) or x<110: 359 | crash() 360 | if obs_starty>display_height: 361 | obs_starty=0-obs_height 362 | obs_startx=random.randrange(170,(display_width-170)) 363 | obs=random.randrange(0,7) 364 | passed=passed+1 365 | score=passed*10 366 | if int(passed)%10==0: 367 | level=level+1 368 | obstacle_speed+2 369 | largetext=pygame.font.Font("freesansbold.ttf",80) 370 | textsurf,textrect=text_objects("LEVEL"+str(level),largetext) 371 | textrect.center=((display_width/2),(display_height/2)) 372 | gamedisplays.blit(textsurf,textrect) 373 | pygame.display.update() 374 | time.sleep(3) 375 | 376 | 377 | if y obs_startx and x < obs_startx + obs_width or x+car_width > obs_startx and x+car_width < obs_startx+obs_width: 379 | crash() 380 | button("Pause",650,0,150,50,blue,bright_blue,"pause") 381 | pygame.display.update() 382 | clock.tick(60) 383 | intro_loop() 384 | game_loop() 385 | pygame.quit() 386 | quit() 387 | -------------------------------------------------------------------------------- /Car Game/strip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/strip.jpg -------------------------------------------------------------------------------- /Car Game/window.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import time 3 | pygame.init() 4 | display_width = 800 5 | display_height = 600 6 | 7 | display = pygame.display.set_mode((display_width,display_height)) 8 | pygame.display.update() 9 | 10 | pygame.display.set_caption("Car Game") 11 | 12 | clock = pygame.time.Clock() 13 | 14 | def gameloop(): 15 | bumped = False 16 | while not bumped: 17 | for event in pygame.event.get(): 18 | if event.type == pygame.QUIT: 19 | bumped = True 20 | quit() 21 | 22 | -------------------------------------------------------------------------------- /Car Game/yellow strip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Car Game/yellow strip.jpg -------------------------------------------------------------------------------- /Flappy bird game/Flappy_bird.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import neat 3 | import time 4 | import os 5 | import random 6 | 7 | WIDTH = 500 8 | HEIGHT = 800 9 | 10 | 11 | BIRD_IMG = [pygame.transform.scale2x(pygame.image.load(os.path.join("imgs","bird1.png"))),pygame.transform.scale2x(pygame.image.load(os.path.join("imgs","bird2.png"))),pygame.transform.scale2x(pygame.image.load(os.path.join("imgs","bird3.png")))] 12 | PIPE_IMG = pygame.transform.scale2x(pygame.image.load(os.path.join("imgs","pipe.png"))) 13 | BASE_IMG = pygame.transform.scale2x(pygame.image.load(os.path.join("imgs","base.png"))) 14 | BG_IMG = pygame.transform.scale2x(pygame.image.load(os.path.join("imgs","bg.png"))) 15 | 16 | class Bird: 17 | IMGS= BIRD_IMG 18 | MAX_ROTATION = 25 19 | ROT_VOL = 20 20 | ANIMATION_TIME = 5 21 | 22 | def __init__(self,x,y): 23 | self.x = x 24 | self.y = y 25 | self.tilt = 0 26 | self.tick_count = 0 27 | self.height = self.y 28 | self.img_count = 0 29 | self.img = self.IMGS[0] 30 | 31 | def jump(self): 32 | self.vel = -10.5 33 | self.tick_count = 0 34 | self.height = self.y 35 | 36 | def move(self): 37 | self.tick_count +=1 38 | d= self.vel + self.tick_count + 1.5 * self.tick_count **2 39 | if d >= 16: 40 | d = 16 41 | if d < 0: 42 | d -=2 43 | 44 | self.y = self.y + d 45 | if d < 0 or self.y < self.height + 50: 46 | if self.tilt < self.MAX_ROTATION: 47 | self.tilt = self.MAX_ROTATION 48 | else: 49 | if self.tilt > -90: 50 | self.tilt -= self.ROT_VOL 51 | 52 | 53 | def draw(self,win): 54 | self.img_count +=1 55 | 56 | if self.img_count < self.ANIMATION_TIME: 57 | self.img = self.IMGS[0] 58 | elif self.img_count < self.ANIMATION_TIME*2: 59 | self.img = self.IMGS[1] 60 | elif self.img_count < self.ANIMATION_TIME*3: 61 | self.img = self.IMGS[2] 62 | elif self.img_count < self.ANIMATION_TIME*4: 63 | self.img = self.IMGS[1] 64 | elif self.img_count < self.ANIMATION_TIME*4 + 1: 65 | self.img = self.IMGS[0] 66 | self.img_count = 0 67 | 68 | if self.tilt <= -80: 69 | self.img = self.IMGS[1] 70 | self.img_count = self.ANIMATION_TIME*2 71 | 72 | 73 | rotated_img = pygame.transform.rotate(self.img,self.tilt) 74 | new_rect = rotated_img.get_rect(center=self.img.get_rect(topleft= (self.x,self.y)).center) 75 | win.blit(rotated_img,new_rect.topleft) 76 | 77 | def get_mask(self): 78 | return pygame.mask.from_surface(self.img) 79 | 80 | def draw_window(win, bird): 81 | win.blit(BG_IMG,(0,0)) 82 | bird.draw(win) 83 | pygame.display.update() 84 | 85 | def main(): 86 | bird = Bird(200,200) 87 | win = pygame.display.set_mode((WIDTH,HEIGHT)) 88 | run = True 89 | while run: 90 | for event in pygame.event.get(): 91 | if event.type == pygame.QUIT: 92 | run = False 93 | draw_window(win,bird) 94 | 95 | pygame.quit() 96 | quit() 97 | 98 | main() -------------------------------------------------------------------------------- /Flappy bird game/imgs/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Flappy bird game/imgs/base.png -------------------------------------------------------------------------------- /Flappy bird game/imgs/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Flappy bird game/imgs/bg.png -------------------------------------------------------------------------------- /Flappy bird game/imgs/bird1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Flappy bird game/imgs/bird1.png -------------------------------------------------------------------------------- /Flappy bird game/imgs/bird2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Flappy bird game/imgs/bird2.png -------------------------------------------------------------------------------- /Flappy bird game/imgs/bird3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Flappy bird game/imgs/bird3.png -------------------------------------------------------------------------------- /Flappy bird game/imgs/pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Flappy bird game/imgs/pipe.png -------------------------------------------------------------------------------- /Id card generator/id_gen.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import QtCore, QtGui, QtWidgets 2 | from PIL import Image, ImageDraw, ImageFont 3 | import random 4 | import os 5 | import datetime 6 | import qrcode 7 | import cv2 8 | import sys 9 | class Ui_Form(object): 10 | def setupUi(self, Form): 11 | Form.setObjectName("Form") 12 | Form.resize(799, 594) 13 | font = QtGui.QFont() 14 | font.setPointSize(12) 15 | font.setBold(True) 16 | font.setWeight(75) 17 | Form.setFont(font) 18 | Form.setStyleSheet("QWidget{\n" 19 | "background:rgb(85, 170, 255);\n" 20 | "\n" 21 | "}") 22 | self.pushButton = QtWidgets.QPushButton(Form) 23 | self.pushButton.setGeometry(QtCore.QRect(460, 30, 151, 41)) 24 | font = QtGui.QFont() 25 | font.setPointSize(12) 26 | font.setBold(True) 27 | font.setWeight(75) 28 | self.pushButton.setFont(font) 29 | self.pushButton.clicked.connect(self.capture) 30 | self.pushButton.setStyleSheet("QPushButton{\n" 31 | "border:3px solid black;\n" 32 | "border-radius:15px;\n" 33 | "background:blue;\n" 34 | "color:white;\n" 35 | "}\n" 36 | "\n" 37 | "QPushButton:hover{\n" 38 | "border:1px solid gray;\n" 39 | "border-radius:15px;\n" 40 | "background:black;\n" 41 | "color:white;\n" 42 | "}") 43 | self.pushButton.setObjectName("pushButton") 44 | 45 | self.pushButton.setObjectName("pushButton_2") 46 | self.label = QtWidgets.QLabel(Form) 47 | self.label.setGeometry(QtCore.QRect(190, 30, 251, 41)) 48 | font = QtGui.QFont() 49 | font.setPointSize(12) 50 | font.setBold(True) 51 | font.setWeight(75) 52 | self.label.setFont(font) 53 | self.label.setObjectName("label") 54 | self.label_2 = QtWidgets.QLabel(Form) 55 | self.label_2.setGeometry(QtCore.QRect(70, 150, 201, 21)) 56 | font = QtGui.QFont() 57 | font.setPointSize(12) 58 | font.setBold(True) 59 | font.setWeight(75) 60 | self.label_2.setFont(font) 61 | self.label_2.setObjectName("label_2") 62 | self.label_3 = QtWidgets.QLabel(Form) 63 | self.label_3.setGeometry(QtCore.QRect(70, 230, 181, 21)) 64 | font = QtGui.QFont() 65 | font.setPointSize(12) 66 | font.setBold(True) 67 | font.setWeight(75) 68 | self.label_3.setFont(font) 69 | self.label_3.setObjectName("label_3") 70 | self.label_4 = QtWidgets.QLabel(Form) 71 | self.label_4.setGeometry(QtCore.QRect(70, 310, 161, 21)) 72 | font = QtGui.QFont() 73 | font.setPointSize(12) 74 | font.setBold(True) 75 | font.setWeight(75) 76 | self.label_4.setFont(font) 77 | self.label_4.setObjectName("label_4") 78 | self.label_5 = QtWidgets.QLabel(Form) 79 | self.label_5.setGeometry(QtCore.QRect(70, 390, 171, 21)) 80 | font = QtGui.QFont() 81 | font.setPointSize(12) 82 | font.setBold(True) 83 | font.setWeight(75) 84 | self.label_5.setFont(font) 85 | self.label_5.setObjectName("label_5") 86 | self.label_6 = QtWidgets.QLabel(Form) 87 | self.label_6.setGeometry(QtCore.QRect(70, 490, 231, 21)) 88 | font = QtGui.QFont() 89 | font.setPointSize(12) 90 | font.setBold(True) 91 | font.setWeight(75) 92 | self.label_6.setFont(font) 93 | self.label_6.setObjectName("label_6") 94 | self.lineEdit = QtWidgets.QLineEdit(Form) 95 | self.lineEdit.setGeometry(QtCore.QRect(360, 140, 381, 31)) 96 | self.lineEdit.setStyleSheet("QLineEdit{\n" 97 | "\n" 98 | "background:white;\n" 99 | "}") 100 | self.lineEdit.setObjectName("lineEdit") 101 | self.lineEdit_2 = QtWidgets.QLineEdit(Form) 102 | self.lineEdit_2.setGeometry(QtCore.QRect(360, 220, 381, 31)) 103 | self.lineEdit_2.setStyleSheet("QLineEdit{\n" 104 | "\n" 105 | "background:white;\n" 106 | "}") 107 | self.lineEdit_2.setObjectName("lineEdit_2") 108 | self.lineEdit_3 = QtWidgets.QLineEdit(Form) 109 | self.lineEdit_3.setGeometry(QtCore.QRect(360, 300, 381, 31)) 110 | self.lineEdit_3.setStyleSheet("QLineEdit{\n" 111 | "\n" 112 | "background:white;\n" 113 | "}") 114 | self.lineEdit_3.setObjectName("lineEdit_3") 115 | self.lineEdit_4 = QtWidgets.QLineEdit(Form) 116 | self.lineEdit_4.setGeometry(QtCore.QRect(360, 390, 381, 31)) 117 | self.lineEdit_4.setStyleSheet("QLineEdit{\n" 118 | "\n" 119 | "background:white;\n" 120 | "}") 121 | self.lineEdit_4.setObjectName("lineEdit_4") 122 | self.lineEdit_5 = QtWidgets.QLineEdit(Form) 123 | self.lineEdit_5.setGeometry(QtCore.QRect(360, 480, 381, 31)) 124 | self.lineEdit_5.setStyleSheet("QLineEdit{\n" 125 | "\n" 126 | "background:white;\n" 127 | "}") 128 | self.lineEdit_5.setObjectName("lineEdit_5") 129 | self.pushButton_2 = QtWidgets.QPushButton(Form) 130 | self.pushButton_2.setGeometry(QtCore.QRect(260, 540, 271, 41)) 131 | font = QtGui.QFont() 132 | font.setPointSize(12) 133 | font.setBold(True) 134 | font.setWeight(75) 135 | self.pushButton_2.setFont(font) 136 | self.pushButton_2.clicked.connect(self.generate_idcard) 137 | self.pushButton_2.setStyleSheet("QPushButton{\n" 138 | "border:3px solid black;\n" 139 | "border-radius:15px;\n" 140 | "background:blue;\n" 141 | "color:white;\n" 142 | "}\n" 143 | "\n" 144 | "QPushButton:hover{\n" 145 | "border:1px solid gray;\n" 146 | "border-radius:15px;\n" 147 | "background:black;\n" 148 | "color:white;\n" 149 | "}") 150 | self.pushButton_2.setObjectName("pushButton_2") 151 | 152 | self.retranslateUi(Form) 153 | QtCore.QMetaObject.connectSlotsByName(Form) 154 | 155 | def capture(self): 156 | 157 | camera = cv2.VideoCapture(0) 158 | while True: 159 | return_value,image = camera.read() 160 | image= cv2.flip(image,1) 161 | #gray = cv2.cvtColor(image,cv2.COLOR_BGR2RGB) 162 | cv2.imshow('image',image) 163 | if cv2.waitKey(1)==13: 164 | height , width = image.shape[:2] 165 | start_row,start_col = int(height*.25), int(width*.25) 166 | end_row,end_col = int(height*.80), int(width*.80) 167 | cropped_img = image[start_row:end_row,start_col:end_col] 168 | cv2.imwrite('person.jpg',cropped_img) 169 | break 170 | camera.release() 171 | cv2.destroyAllWindows() 172 | 173 | 174 | def generate_idcard(self): 175 | # Generating Blank White Image 176 | image = Image.new('RGB', (1000,900), (255, 255, 255)) 177 | draw = ImageDraw.Draw(image) 178 | font = ImageFont.truetype('arial.ttf', size=45) 179 | 180 | 181 | date = datetime.datetime.now() #getting time and date at the runtime 182 | 183 | (x, y) = (50, 50) 184 | message = self.lineEdit.text() 185 | company=message 186 | color = 'rgb(0, 0, 0)' 187 | font = ImageFont.truetype('arial.ttf', size=80) 188 | draw.text((x, y), message, fill=color, font=font) 189 | 190 | 191 | 192 | #generating ID NO randomly You can also ask user to enter 193 | (x, y) = (50, 350) 194 | id_no = random.randint(1000000,9000000) 195 | message = str('ID '+str(id_no)) 196 | font = ImageFont.truetype('arial.ttf', size=60) 197 | color = 'rgb(255, 0, 0)' # color 198 | draw.text((x,y),message ,fill=color,font=font) 199 | 200 | 201 | # Asking user Full name 202 | (x, y) = (50, 250) 203 | message = self.lineEdit_2.text() 204 | name=message 205 | color = 'rgb(0, 0, 0)' # black color 206 | font = ImageFont.truetype('arial.ttf', size=45) 207 | draw.text((x, y), message, fill=color, font=font) 208 | 209 | 210 | 211 | 212 | 213 | 214 | # Asking about user gender 215 | (x, y) = (50, 550) 216 | message = self.lineEdit_3.text() 217 | color = 'rgb(0, 0, 0)' # black color 218 | draw.text((x, y), message, fill=color, font=font) 219 | 220 | 221 | # Asking User about his phone number 222 | (x, y) = (50, 650) 223 | message = self.lineEdit_5.text() 224 | temp=message 225 | color = 'rgb(0, 0, 0)' # black color 226 | draw.text((x, y), message, fill=color, font=font) 227 | 228 | 229 | 230 | # Asking user about his Adress 231 | (x, y) = (50, 750) 232 | message = self.lineEdit_4.text() 233 | color = 'rgb(0, 0, 0)' # black color 234 | draw.text((x, y), message, fill=color, font=font) 235 | 236 | 237 | 238 | 239 | # save the edited image 240 | 241 | image.save(str(name)+'.png') 242 | 243 | 244 | # pasting person image taken by camera on card image 245 | card_image=Image.open(name+'.png') 246 | person_image= Image.open('person.jpg','r') 247 | card_image.paste(person_image,(600,75)) 248 | card_image.save("card.jpg") 249 | img = qrcode.make(str(company)+str(id_no)) # this info. is added in QR code, also add other things 250 | img.save(str(id_no)+'.bmp') 251 | 252 | til = Image.open('card.jpg') 253 | im = Image.open(str(id_no)+'.bmp') #25x25 254 | til.paste(im,(600,400)) 255 | til.save(name+'.png') 256 | self.hide() 257 | 258 | 259 | 260 | def retranslateUi(self, Form): 261 | _translate = QtCore.QCoreApplication.translate 262 | Form.setWindowTitle(_translate("Form", "Form")) 263 | self.pushButton.setText(_translate("Form", "Capture Image")) 264 | self.label.setText(_translate("Form", "Capture Your Image ")) 265 | self.label_2.setText(_translate("Form", "Your Company Name")) 266 | self.label_3.setText(_translate("Form", "Your Full Name")) 267 | self.label_4.setText(_translate("Form", "Your Gender")) 268 | self.label_5.setText(_translate("Form", "Your Current Adress")) 269 | self.label_6.setText(_translate("Form", "Your Active Phone Number")) 270 | self.pushButton_2.setText(_translate("Form", "Generate Id Card")) 271 | 272 | if __name__ == "__main__": 273 | import sys 274 | app = QtWidgets.QApplication(sys.argv) 275 | Form = QtWidgets.QWidget() 276 | ui = Ui_Form() 277 | ui.setupUi(Form) 278 | Form.show() 279 | sys.exit(app.exec_()) 280 | -------------------------------------------------------------------------------- /Id card generator/index.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtCore import * 2 | from PyQt5.QtGui import * 3 | from PyQt5.QtWidgets import * 4 | import sys 5 | import MySQLdb 6 | from PyQt5.uic import loadUiType 7 | 8 | 9 | ui,_ = loadUiType('id_gen.ui') 10 | 11 | class MainApp(QMainWindow , ui): 12 | def __init__(self): 13 | QMainWindow.__init__(self) 14 | self.setupUi(self) 15 | 16 | 17 | 18 | def main(): 19 | app = QApplication(sys.argv) 20 | window = MainApp() 21 | window.show() 22 | app.exec_() 23 | 24 | 25 | if __name__ == '__main__': 26 | main() 27 | -------------------------------------------------------------------------------- /Id card generator/setup.py: -------------------------------------------------------------------------------- 1 | 2 | from cx_Freeze import setup, Executable 3 | import sys 4 | 5 | base = None 6 | 7 | if sys.platform == 'win32': 8 | base = None 9 | 10 | 11 | executables = [Executable("id_gen.py", base=base)] 12 | 13 | packages = ["idna"] 14 | options = { 15 | 'build_exe': { 16 | 17 | 'packages':packages, 18 | }, 19 | 20 | } 21 | 22 | setup( 23 | name = "id generator", 24 | options = options, 25 | version = "1.0", 26 | description = 'any description', 27 | executables = executables 28 | ) 29 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/README.md: -------------------------------------------------------------------------------- 1 | # Library Management System | Python & PyQt5 2 | 3 | - adding new books 4 | - adding books categories 5 | - adding books Author 6 | - adding books Publisher 7 | - adding day to day operations for rent or retrieving books 8 | - Generate Excel reports from our data 9 | - Adding new users with user login and editing user data 10 | 11 | 12 | -What you’ll learn 13 | - Installing Python 14 | - Installing PyQt5 15 | - Installing MySQL Server 16 | - Design nice desktop applications with QtDesigner 17 | - Styling desktop applications with CSS 18 | - Design a database using mysql workbench 19 | - Connecting to mysql database with python 20 | - inserting , selecting , updating , deleting database data from our app 21 | - Adding project themes and change between them easly 22 | - Adding new users 23 | - Updating user data 24 | - Login at startup 25 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/__pycache__/icons_rc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/__pycache__/icons_rc.cpython-36.pyc -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/db.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64) 2 | -- 3 | -- Host: localhost Database: library 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.20 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `authors` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `authors`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `authors` ( 26 | `idauthor` int(11) NOT NULL AUTO_INCREMENT, 27 | `author_name` varchar(45) DEFAULT NULL, 28 | PRIMARY KEY (`idauthor`) 29 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 30 | /*!40101 SET character_set_client = @saved_cs_client */; 31 | 32 | -- 33 | -- Dumping data for table `authors` 34 | -- 35 | 36 | LOCK TABLES `authors` WRITE; 37 | /*!40000 ALTER TABLE `authors` DISABLE KEYS */; 38 | INSERT INTO `authors` VALUES (1,'Mahmoud Ahmed'),(2,'sayed'),(3,'ali'); 39 | /*!40000 ALTER TABLE `authors` ENABLE KEYS */; 40 | UNLOCK TABLES; 41 | 42 | -- 43 | -- Table structure for table `book` 44 | -- 45 | 46 | DROP TABLE IF EXISTS `book`; 47 | /*!40101 SET @saved_cs_client = @@character_set_client */; 48 | /*!40101 SET character_set_client = utf8 */; 49 | CREATE TABLE `book` ( 50 | `id` int(11) NOT NULL AUTO_INCREMENT, 51 | `book_name` varchar(45) DEFAULT NULL, 52 | `book_description` varchar(100) DEFAULT NULL, 53 | `book_code` varchar(45) DEFAULT NULL, 54 | `book_category` varchar(30) DEFAULT NULL, 55 | `book_author` varchar(30) DEFAULT NULL, 56 | `book_publisher` varchar(30) DEFAULT NULL, 57 | `book_price` int(11) DEFAULT NULL, 58 | PRIMARY KEY (`id`) 59 | ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; 60 | /*!40101 SET character_set_client = @saved_cs_client */; 61 | 62 | -- 63 | -- Dumping data for table `book` 64 | -- 65 | 66 | LOCK TABLES `book` WRITE; 67 | /*!40000 ALTER TABLE `book` DISABLE KEYS */; 68 | INSERT INTO `book` VALUES (2,'space travel','space travel 3','002','Sport','Mahmoud Ahmed','Ahmed Ali',120),(3,'python coding','python tutorials','003','Gaming','sayed','maati',50),(4,'python programming','this is a book for python','004','Drama','Mahmoud Ahmed','Ahmed Ali',50),(5,'pyqt library system','a real project with pyqt5','005','Drama','sayed','ahmed',200),(6,'pyqt5 project','build a library system','006','Gaming','Mahmoud Ahmed','Ahmed Ali',40); 69 | /*!40000 ALTER TABLE `book` ENABLE KEYS */; 70 | UNLOCK TABLES; 71 | 72 | -- 73 | -- Table structure for table `category` 74 | -- 75 | 76 | DROP TABLE IF EXISTS `category`; 77 | /*!40101 SET @saved_cs_client = @@character_set_client */; 78 | /*!40101 SET character_set_client = utf8 */; 79 | CREATE TABLE `category` ( 80 | `idcategory` int(11) NOT NULL AUTO_INCREMENT, 81 | `category_name` varchar(45) DEFAULT NULL, 82 | PRIMARY KEY (`idcategory`) 83 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 84 | /*!40101 SET character_set_client = @saved_cs_client */; 85 | 86 | -- 87 | -- Dumping data for table `category` 88 | -- 89 | 90 | LOCK TABLES `category` WRITE; 91 | /*!40000 ALTER TABLE `category` DISABLE KEYS */; 92 | INSERT INTO `category` VALUES (1,'Gaming'),(2,'Drama'),(3,'Sport'),(4,'Cooking'); 93 | /*!40000 ALTER TABLE `category` ENABLE KEYS */; 94 | UNLOCK TABLES; 95 | 96 | -- 97 | -- Table structure for table `clients` 98 | -- 99 | 100 | DROP TABLE IF EXISTS `clients`; 101 | /*!40101 SET @saved_cs_client = @@character_set_client */; 102 | /*!40101 SET character_set_client = utf8 */; 103 | CREATE TABLE `clients` ( 104 | `idclients` int(11) NOT NULL AUTO_INCREMENT, 105 | `client_name` varchar(45) DEFAULT NULL, 106 | `client_email` varchar(45) DEFAULT NULL, 107 | `client_nationalid` varchar(45) DEFAULT NULL, 108 | PRIMARY KEY (`idclients`) 109 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; 110 | /*!40101 SET character_set_client = @saved_cs_client */; 111 | 112 | -- 113 | -- Dumping data for table `clients` 114 | -- 115 | 116 | LOCK TABLES `clients` WRITE; 117 | /*!40000 ALTER TABLE `clients` DISABLE KEYS */; 118 | INSERT INTO `clients` VALUES (2,'mahmoud','mahmoud@gmail.com','2123213124'),(3,'ahmed','ahmed@gmail.com','21232674676'),(4,'jack','jack22@gmail.com','123142423'),(5,'john33','john33@gmail.com','4534636346'); 119 | /*!40000 ALTER TABLE `clients` ENABLE KEYS */; 120 | UNLOCK TABLES; 121 | 122 | -- 123 | -- Table structure for table `dayoperations` 124 | -- 125 | 126 | DROP TABLE IF EXISTS `dayoperations`; 127 | /*!40101 SET @saved_cs_client = @@character_set_client */; 128 | /*!40101 SET character_set_client = utf8 */; 129 | CREATE TABLE `dayoperations` ( 130 | `id` int(11) NOT NULL AUTO_INCREMENT, 131 | `book_name` varchar(45) DEFAULT NULL, 132 | `type` varchar(30) DEFAULT NULL, 133 | `days` int(11) DEFAULT NULL, 134 | `date` date DEFAULT NULL, 135 | `client` varchar(45) DEFAULT NULL, 136 | `to` date DEFAULT NULL, 137 | PRIMARY KEY (`id`) 138 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; 139 | /*!40101 SET character_set_client = @saved_cs_client */; 140 | 141 | -- 142 | -- Dumping data for table `dayoperations` 143 | -- 144 | 145 | LOCK TABLES `dayoperations` WRITE; 146 | /*!40000 ALTER TABLE `dayoperations` DISABLE KEYS */; 147 | INSERT INTO `dayoperations` VALUES (1,'space','Retrieve',4,'2019-01-08',NULL,NULL),(2,'python','Retrieve',4,'2019-01-09','mahmoud',NULL); 148 | /*!40000 ALTER TABLE `dayoperations` ENABLE KEYS */; 149 | UNLOCK TABLES; 150 | 151 | -- 152 | -- Table structure for table `publisher` 153 | -- 154 | 155 | DROP TABLE IF EXISTS `publisher`; 156 | /*!40101 SET @saved_cs_client = @@character_set_client */; 157 | /*!40101 SET character_set_client = utf8 */; 158 | CREATE TABLE `publisher` ( 159 | `idpublisher` int(11) NOT NULL AUTO_INCREMENT, 160 | `publisher_name` varchar(45) DEFAULT NULL, 161 | PRIMARY KEY (`idpublisher`) 162 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; 163 | /*!40101 SET character_set_client = @saved_cs_client */; 164 | 165 | -- 166 | -- Dumping data for table `publisher` 167 | -- 168 | 169 | LOCK TABLES `publisher` WRITE; 170 | /*!40000 ALTER TABLE `publisher` DISABLE KEYS */; 171 | INSERT INTO `publisher` VALUES (1,'Ahmed Ali'),(2,'amal'),(3,'maati'),(4,'ahmed'),(5,'sayed'); 172 | /*!40000 ALTER TABLE `publisher` ENABLE KEYS */; 173 | UNLOCK TABLES; 174 | 175 | -- 176 | -- Table structure for table `users` 177 | -- 178 | 179 | DROP TABLE IF EXISTS `users`; 180 | /*!40101 SET @saved_cs_client = @@character_set_client */; 181 | /*!40101 SET character_set_client = utf8 */; 182 | CREATE TABLE `users` ( 183 | `idusers` int(11) NOT NULL AUTO_INCREMENT, 184 | `user_name` varchar(45) DEFAULT NULL, 185 | `user_email` varchar(45) DEFAULT NULL, 186 | `user_password` varchar(45) DEFAULT NULL, 187 | PRIMARY KEY (`idusers`) 188 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; 189 | /*!40101 SET character_set_client = @saved_cs_client */; 190 | 191 | -- 192 | -- Dumping data for table `users` 193 | -- 194 | 195 | LOCK TABLES `users` WRITE; 196 | /*!40000 ALTER TABLE `users` DISABLE KEYS */; 197 | INSERT INTO `users` VALUES (1,'mahmoud ahmed','pythondeveloper6@gmail.com','12345'),(2,'ahmed2','ahmed10@gmail.com','1234'); 198 | /*!40000 ALTER TABLE `users` ENABLE KEYS */; 199 | UNLOCK TABLES; 200 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 201 | 202 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 203 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 204 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 205 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 206 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 207 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 208 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 209 | 210 | -- Dump completed on 2019-01-09 1:00:55 211 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | icons/today.png 5 | icons/books.png 6 | icons/settings.png 7 | icons/themes.png 8 | icons/users.png 9 | icons/flat.png 10 | 11 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons/books.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/icons/books.png -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons/flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/icons/flat.png -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/icons/settings.png -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons/themes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/icons/themes.png -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons/today.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/icons/today.png -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/icons/users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/LIBRARY MANAGEMENT SYSTEM/icons/users.png -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/index.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtCore import * 2 | from PyQt5.QtGui import * 3 | from PyQt5.QtWidgets import * 4 | import sys 5 | import MySQLdb 6 | from PyQt5.uic import loadUiType 7 | import datetime 8 | from xlrd import * 9 | from xlsxwriter import * 10 | 11 | ui,_ = loadUiType('library.ui') 12 | 13 | class MainApp(QMainWindow , ui): 14 | def __init__(self): 15 | QMainWindow.__init__(self) 16 | self.setupUi(self) 17 | self.Handel_UI_Changes() 18 | self.Handel_Buttons() 19 | self.Dark_Orange_Theme() 20 | 21 | self.Show_Author() 22 | self.Show_Category() 23 | self.Show_Publisher() 24 | 25 | 26 | self.Show_Category_Combobox() 27 | self.Show_Author_Combobox() 28 | self.Show_Publisher_Combobox() 29 | 30 | self.Show_All_Clients() 31 | self.Show_All_Books() 32 | 33 | self.Show_All_Operations() 34 | 35 | 36 | def Handel_UI_Changes(self): 37 | self.Hiding_Themes() 38 | self.tabWidget.tabBar().setVisible(False) 39 | 40 | 41 | def Handel_Buttons(self): 42 | self.pushButton_5.clicked.connect(self.Show_Themes) 43 | self.pushButton_17.clicked.connect(self.Hiding_Themes) 44 | 45 | self.pushButton.clicked.connect(self.Open_Day_To_Day_Tab) 46 | self.pushButton_2.clicked.connect(self.Open_Books_Tab) 47 | self.pushButton_26.clicked.connect(self.Open_CLients_Tab) 48 | self.pushButton_3.clicked.connect(self.Open_Users_Tab) 49 | self.pushButton_4.clicked.connect(self.Open_Settings_Tab) 50 | 51 | self.pushButton_7.clicked.connect(self.Add_New_Book) 52 | self.pushButton_9.clicked.connect(self.Search_Books) 53 | self.pushButton_8.clicked.connect(self.Edit_Books) 54 | self.pushButton_10.clicked.connect(self.Delete_Books) 55 | 56 | self.pushButton_14.clicked.connect(self.Add_Category) 57 | self.pushButton_15.clicked.connect(self.Add_Author) 58 | self.pushButton_16.clicked.connect(self.Add_Publisher) 59 | 60 | self.pushButton_11.clicked.connect(self.Add_New_User) 61 | self.pushButton_13.clicked.connect(self.Edit_User) 62 | 63 | self.pushButton_19.clicked.connect(self.Dark_Orange_Theme) 64 | self.pushButton_18.clicked.connect(self.Dark_Blue_Theme) 65 | self.pushButton_21.clicked.connect(self.Dark_Gray_Theme) 66 | self.pushButton_20.clicked.connect(self.QDark_Theme) 67 | 68 | self.pushButton_22.clicked.connect(self.Add_New_Client) 69 | self.pushButton_24.clicked.connect(self.Search_Client) 70 | self.pushButton_23.clicked.connect(self.Edit_Client) 71 | self.pushButton_25.clicked.connect(self.Delete_Client) 72 | 73 | self.pushButton_6.clicked.connect(self.Handel_Day_Operations) 74 | 75 | self.pushButton_29.clicked.connect(self.Export_Day_Operations) 76 | self.pushButton_27.clicked.connect(self.Export_Books) 77 | self.pushButton_28.clicked.connect(self.Export_Clients) 78 | 79 | 80 | 81 | def Show_Themes(self): 82 | self.groupBox_3.show() 83 | 84 | 85 | def Hiding_Themes(self): 86 | self.groupBox_3.hide() 87 | 88 | ######################################## 89 | ######### opening tabs ################# 90 | def Open_Day_To_Day_Tab(self): 91 | self.tabWidget.setCurrentIndex(0) 92 | 93 | def Open_Books_Tab(self): 94 | self.tabWidget.setCurrentIndex(1) 95 | 96 | def Open_CLients_Tab(self): 97 | self.tabWidget.setCurrentIndex(2) 98 | 99 | def Open_Users_Tab(self): 100 | self.tabWidget.setCurrentIndex(3) 101 | 102 | def Open_Settings_Tab(self): 103 | self.tabWidget.setCurrentIndex(4) 104 | 105 | 106 | ######################################## 107 | ######### Day Operations ################# 108 | def Handel_Day_Operations(self): 109 | book_title = self.lineEdit.text() 110 | client_name = self.lineEdit_29.text() 111 | type = self.comboBox.currentText() 112 | days_number = self.comboBox_2.currentIndex() + 1 113 | today_date = datetime.date.today() 114 | to_date = today_date + datetime.timedelta(days=days_number) 115 | 116 | print(today_date) 117 | print(to_date) 118 | 119 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 120 | 121 | self.cur = self.db.cursor() 122 | 123 | self.cur.execute(''' 124 | INSERT INTO dayoperations(book_name, client, type , days , date ) 125 | VALUES (%s , %s , %s, %s , %s , %s) 126 | ''' , (book_title ,client_name, type , days_number , today_date )) 127 | 128 | self.db.commit() 129 | self.statusBar().showMessage('New Operation Added') 130 | 131 | self.Show_All_Operations() 132 | 133 | 134 | 135 | def Show_All_Operations(self): 136 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 137 | self.cur = self.db.cursor() 138 | 139 | self.cur.execute(''' SELECT book_name , client , type , date FROM dayoperations''') 140 | 141 | data = self.cur.fetchall() 142 | 143 | print(data) 144 | 145 | self.tableWidget.setRowCount(0) 146 | self.tableWidget.insertRow(0) 147 | for row , form in enumerate(data): 148 | for column , item in enumerate(form): 149 | self.tableWidget.setItem(row , column , QTableWidgetItem(str(item))) 150 | column += 1 151 | 152 | row_position = self.tableWidget.rowCount() 153 | self.tableWidget.insertRow(row_position) 154 | 155 | 156 | 157 | ######################################## 158 | ######### Books ################# 159 | 160 | def Show_All_Books(self): 161 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 162 | self.cur = self.db.cursor() 163 | 164 | self.cur.execute(''' SELECT book_code,book_name,book_description,book_category,book_author,book_publisher,book_price FROM book''') 165 | data = self.cur.fetchall() 166 | 167 | self.tableWidget_5.setRowCount(0) 168 | self.tableWidget_5.insertRow(0) 169 | 170 | for row, form in enumerate(data): 171 | for column, item in enumerate(form): 172 | self.tableWidget_5.setItem(row, column, QTableWidgetItem(str(item))) 173 | column += 1 174 | 175 | row_position = self.tableWidget_5.rowCount() 176 | self.tableWidget_5.insertRow(row_position) 177 | 178 | self.db.close() 179 | 180 | 181 | def Add_New_Book(self): 182 | 183 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 184 | self.cur = self.db.cursor() 185 | 186 | book_title = self.lineEdit_2.text() 187 | book_description = self.textEdit.toPlainText() 188 | book_code = self.lineEdit_3.text() 189 | book_category = self.comboBox_3.currentText() 190 | book_author = self.comboBox_4.currentText() 191 | book_publisher = self.comboBox_5.currentText() 192 | book_price = self.lineEdit_4.text() 193 | 194 | self.cur.execute(''' 195 | INSERT INTO book(book_name,book_description,book_code,book_category,book_author,book_publisher,book_price) 196 | VALUES (%s , %s , %s , %s , %s , %s , %s) 197 | ''' ,(book_title , book_description , book_code , book_category , book_author , book_publisher , book_price)) 198 | 199 | self.db.commit() 200 | self.statusBar().showMessage('New Book Added') 201 | 202 | self.lineEdit_2.setText('') 203 | self.textEdit.setPlainText('') 204 | self.lineEdit_3.setText('') 205 | self.comboBox_3.setCurrentIndex(0) 206 | self.comboBox_4.setCurrentIndex(0) 207 | self.comboBox_5.setCurrentIndex(0) 208 | self.lineEdit_4.setText('') 209 | self.Show_All_Books() 210 | 211 | 212 | 213 | 214 | def Search_Books(self): 215 | 216 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 217 | self.cur = self.db.cursor() 218 | 219 | book_title = self.lineEdit_5.text() 220 | 221 | sql = ''' SELECT * FROM book WHERE book_name = %s''' 222 | self.cur.execute(sql , [(book_title)]) 223 | 224 | data = self.cur.fetchone() 225 | 226 | print(data) 227 | self.lineEdit_8.setText(data[1]) 228 | self.textEdit_2.setPlainText(data[2]) 229 | self.lineEdit_7.setText(data[3]) 230 | self.comboBox_7.setCurrentText(data[4]) 231 | self.comboBox_8.setCurrentText(data[5]) 232 | self.comboBox_6.setCurrentText(data[6]) 233 | self.lineEdit_6.setText(str(data[7])) 234 | 235 | 236 | 237 | 238 | 239 | def Edit_Books(self): 240 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 241 | self.cur = self.db.cursor() 242 | 243 | book_title = self.lineEdit_8.text() 244 | book_description = self.textEdit_2.toPlainText() 245 | book_code = self.lineEdit_7.text() 246 | book_category = self.comboBox_7.currentText() 247 | book_author = self.comboBox_8.currentText() 248 | book_publisher = self.comboBox_6.currentText() 249 | book_price = self.lineEdit_6.text() 250 | 251 | 252 | search_book_title = self.lineEdit_5.text() 253 | 254 | self.cur.execute(''' 255 | UPDATE book SET book_name=%s ,book_description=%s ,book_code=%s ,book_category=%s ,book_author=%s ,book_publisher=%s ,book_price=%s WHERE book_name = %s 256 | ''', (book_title,book_description,book_code,book_category,book_author,book_publisher , book_price , search_book_title)) 257 | 258 | self.db.commit() 259 | self.statusBar().showMessage('book updated') 260 | self.Show_All_Books() 261 | 262 | 263 | def Delete_Books(self): 264 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 265 | self.cur = self.db.cursor() 266 | 267 | book_title = self.lineEdit_5.text() 268 | 269 | warning = QMessageBox.warning(self , 'Delete Book' , "are you sure you want to delete this book" , QMessageBox.Yes | QMessageBox.No) 270 | if warning == QMessageBox.Yes : 271 | sql = ''' DELETE FROM book WHERE book_name = %s ''' 272 | self.cur.execute(sql , [(book_title)]) 273 | self.db.commit() 274 | self.statusBar().showMessage('Book Deleted') 275 | 276 | self.Show_All_Books 277 | 278 | ######################################## 279 | ######### Clients ################# 280 | def Show_All_Clients(self): 281 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 282 | self.cur = self.db.cursor() 283 | 284 | self.cur.execute(''' SELECT client_name , client_email ,client_nationalid FROM clients ''') 285 | data = self.cur.fetchall() 286 | 287 | print(data) 288 | self.tableWidget_6.setRowCount(0) 289 | self.tableWidget_6.insertRow(0) 290 | 291 | for row, form in enumerate(data): 292 | for column, item in enumerate(form): 293 | self.tableWidget_6.setItem(row, column, QTableWidgetItem(str(item))) 294 | column += 1 295 | 296 | row_position = self.tableWidget_6.rowCount() 297 | self.tableWidget_6.insertRow(row_position) 298 | 299 | self.db.close() 300 | 301 | 302 | def Add_New_Client(self): 303 | client_name = self.lineEdit_22.text() 304 | client_email = self.lineEdit_23.text() 305 | client_nationalid = self.lineEdit_24.text() 306 | 307 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 308 | self.cur = self.db.cursor() 309 | 310 | self.cur.execute(''' 311 | INSERT INTO clients(client_name , client_email , client_nationalid) 312 | VALUES (%s , %s , %s) 313 | ''' , (client_name , client_email , client_nationalid)) 314 | self.db.commit() 315 | self.db.close() 316 | self.statusBar().showMessage('New CLient Added') 317 | self.Show_All_Clients() 318 | 319 | 320 | def Search_Client(self): 321 | client_national_id = self.lineEdit_25.text() 322 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 323 | self.cur = self.db.cursor() 324 | 325 | sql = ''' SELECT * FROM clients WHERE client_nationalid = %s ''' 326 | self.cur.execute(sql , [(client_national_id)]) 327 | data = self.cur.fetchone() 328 | print(data) 329 | 330 | self.lineEdit_28.setText(data[1]) 331 | self.lineEdit_27.setText(data[2]) 332 | self.lineEdit_26.setText(data[3]) 333 | 334 | 335 | def Edit_Client(self): 336 | client_original_national_id = self.lineEdit_25.text() 337 | client_name = self.lineEdit_28.text() 338 | client_email = self.lineEdit_27.text() 339 | client_national_id = self.lineEdit_26.text() 340 | 341 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 342 | self.cur = self.db.cursor() 343 | 344 | self.cur.execute(''' 345 | UPDATE clients SET client_name = %s , client_email = %s , client_nationalid = %s WHERE client_nationalid = %s 346 | ''' , (client_name , client_email , client_national_id , client_original_national_id)) 347 | self.db.commit() 348 | self.db.close() 349 | self.statusBar().showMessage('CLient Data Updated ') 350 | self.Show_All_Clients() 351 | 352 | 353 | def Delete_Client(self): 354 | client_original_national_id = self.lineEdit_25.text() 355 | 356 | 357 | warning_message = QMessageBox.warning(self , "Delete CLient" , "are you sure you want to delete this client" , QMessageBox.Yes | QMessageBox.No) 358 | 359 | if warning_message == QMessageBox.Yes : 360 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 361 | self.cur = self.db.cursor() 362 | 363 | sql = ''' DELETE FROM clients WHERE client_nationalid = %s ''' 364 | self.cur.execute(sql , [(client_original_national_id)]) 365 | 366 | self.db.commit() 367 | self.db.close() 368 | self.statusBar().showMessage('CLient Deleted ') 369 | self.Show_All_Clients() 370 | 371 | 372 | ######################################## 373 | ######### users ################# 374 | 375 | def Add_New_User(self): 376 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 377 | 378 | self.cur = self.db.cursor() 379 | 380 | username = self.lineEdit_9.text() 381 | email = self.lineEdit_10.text() 382 | password = self.lineEdit_11.text() 383 | password2 = self.lineEdit_12.text() 384 | 385 | if password == password2 : 386 | self.cur.execute(''' 387 | INSERT INTO users(user_name , user_email , user_password) 388 | VALUES (%s , %s , %s) 389 | ''' , (username , email , password)) 390 | 391 | self.db.commit() 392 | self.statusBar().showMessage('New User Added') 393 | 394 | else: 395 | self.label_30.setText('please add a valid password twice') 396 | 397 | 398 | 399 | def Edit_User(self): 400 | 401 | username = self.lineEdit_17.text() 402 | email = self.lineEdit_15.text() 403 | password = self.lineEdit_16.text() 404 | password2 = self.lineEdit_18.text() 405 | 406 | original_name = self.lineEdit_14.text() 407 | 408 | if password == password2 : 409 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 410 | 411 | self.cur = self.db.cursor() 412 | 413 | print(username) 414 | print(email) 415 | print(password) 416 | 417 | self.cur.execute(''' 418 | UPDATE users SET user_name=%s , user_email=%s , user_password=%s WHERE user_name=%s 419 | ''', (username , email , password , original_name)) 420 | 421 | self.db.commit() 422 | self.statusBar().showMessage('User Data Updated Successfully') 423 | 424 | else: 425 | print('make sure you entered you password correctly') 426 | 427 | 428 | ######################################## 429 | ######### settings ################# 430 | def Add_Category(self): 431 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 432 | 433 | self.cur = self.db.cursor() 434 | 435 | category_name = self.lineEdit_19.text() 436 | 437 | self.cur.execute(''' 438 | INSERT INTO category (category_name) VALUES (%s) 439 | ''' , (category_name,)) 440 | self.db.commit() 441 | self.statusBar().showMessage('New Category Addedd ') 442 | self.lineEdit_19.setText('') 443 | self.Show_Category() 444 | self.Show_Category_Combobox() 445 | 446 | 447 | 448 | def Show_Category(self): 449 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 450 | 451 | self.cur = self.db.cursor() 452 | 453 | self.cur.execute(''' SELECT category_name FROM category''') 454 | data = self.cur.fetchall() 455 | 456 | if data : 457 | self.tableWidget_2.setRowCount(0) 458 | self.tableWidget_2.insertRow(0) 459 | for row , form in enumerate(data): 460 | for column , item in enumerate(form) : 461 | self.tableWidget_2.setItem(row , column , QTableWidgetItem(str(item))) 462 | column += 1 463 | 464 | row_position = self.tableWidget_2.rowCount() 465 | self.tableWidget_2.insertRow(row_position) 466 | 467 | 468 | 469 | def Add_Author(self): 470 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 471 | 472 | self.cur = self.db.cursor() 473 | 474 | author_name = self.lineEdit_20.text() 475 | self.cur.execute(''' 476 | INSERT INTO authors (author_name) VALUES (%s) 477 | ''' , (author_name,)) 478 | self.db.commit() 479 | self.lineEdit_20.setText('') 480 | self.statusBar().showMessage('New Author Addedd ') 481 | self.Show_Author() 482 | self.Show_Author_Combobox() 483 | 484 | 485 | def Show_Author(self): 486 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 487 | 488 | self.cur = self.db.cursor() 489 | 490 | self.cur.execute(''' SELECT author_name FROM authors''') 491 | data = self.cur.fetchall() 492 | 493 | 494 | if data: 495 | self.tableWidget_3.setRowCount(0) 496 | self.tableWidget_3.insertRow(0) 497 | for row, form in enumerate(data): 498 | for column, item in enumerate(form): 499 | self.tableWidget_3.setItem(row, column, QTableWidgetItem(str(item))) 500 | column += 1 501 | 502 | row_position = self.tableWidget_3.rowCount() 503 | self.tableWidget_3.insertRow(row_position) 504 | 505 | 506 | def Add_Publisher(self): 507 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 508 | 509 | self.cur = self.db.cursor() 510 | 511 | publisher_name = self.lineEdit_21.text() 512 | self.cur.execute(''' 513 | INSERT INTO publisher (publisher_name) VALUES (%s) 514 | ''' , (publisher_name,)) 515 | 516 | self.db.commit() 517 | self.lineEdit_21.setText('') 518 | self.statusBar().showMessage('New Publisher Addedd ') 519 | self.Show_Publisher() 520 | self.Show_Publisher_Combobox() 521 | 522 | 523 | def Show_Publisher(self): 524 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 525 | 526 | self.cur = self.db.cursor() 527 | 528 | self.cur.execute(''' SELECT publisher_name FROM publisher''') 529 | data = self.cur.fetchall() 530 | 531 | 532 | if data: 533 | self.tableWidget_4.setRowCount(0) 534 | self.tableWidget_4.insertRow(0) 535 | for row, form in enumerate(data): 536 | for column, item in enumerate(form): 537 | self.tableWidget_4.setItem(row, column, QTableWidgetItem(str(item))) 538 | column += 1 539 | 540 | row_position = self.tableWidget_4.rowCount() 541 | self.tableWidget_4.insertRow(row_position) 542 | 543 | 544 | ######################################## 545 | ######### show settings data in UI ################# 546 | def Show_Category_Combobox(self): 547 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 548 | 549 | self.cur = self.db.cursor() 550 | 551 | self.cur.execute(''' SELECT category_name FROM category ''') 552 | data = self.cur.fetchall() 553 | 554 | self.comboBox_3.clear() 555 | for category in data : 556 | self.comboBox_3.addItem(category[0]) 557 | self.comboBox_7.addItem(category[0]) 558 | 559 | 560 | 561 | def Show_Author_Combobox(self): 562 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 563 | 564 | self.cur = self.db.cursor() 565 | 566 | self.cur.execute(''' SELECT author_name FROM authors''') 567 | data = self.cur.fetchall() 568 | 569 | self.comboBox_4.clear() 570 | for author in data : 571 | self.comboBox_4.addItem(author[0]) 572 | self.comboBox_8.addItem(author[0]) 573 | 574 | 575 | def Show_Publisher_Combobox(self): 576 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 577 | 578 | self.cur = self.db.cursor() 579 | 580 | self.cur.execute(''' SELECT publisher_name FROM publisher''') 581 | data = self.cur.fetchall() 582 | 583 | self.comboBox_5.clear() 584 | for publisher in data : 585 | self.comboBox_5.addItem(publisher[0]) 586 | self.comboBox_6.addItem(publisher[0]) 587 | 588 | ######################################## 589 | ######### Export Data ################# 590 | def Export_Day_Operations(self): 591 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 592 | 593 | self.cur = self.db.cursor() 594 | 595 | self.cur.execute(''' 596 | SELECT book_name , client , type , date , to_date FROM dayoperations 597 | ''') 598 | 599 | data = self.cur.fetchall() 600 | wb = Workbook('day_operations.xlsx') 601 | sheet1 = wb.add_worksheet() 602 | 603 | sheet1.write(0,0,'book title') 604 | sheet1.write(0,1,'cliant name') 605 | sheet1.write(0,2,'type') 606 | sheet1.write(0,3,'from - date') 607 | sheet1.write(0,4,'to - date') 608 | 609 | 610 | row_number = 1 611 | for row in data : 612 | column_number = 0 613 | for item in row : 614 | sheet1.write(row_number , column_number , str(item)) 615 | column_number += 1 616 | row_number += 1 617 | 618 | wb.close() 619 | self.statusBar().showMessage('Report Created Successfully') 620 | 621 | 622 | 623 | def Export_Books(self): 624 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 625 | 626 | self.cur = self.db.cursor() 627 | 628 | self.cur.execute(''' SELECT book_code,book_name,book_description,book_category,book_author,book_publisher,book_price FROM book''') 629 | data = self.cur.fetchall() 630 | 631 | wb = Workbook('all_books.xlsx') 632 | sheet1 = wb.add_worksheet() 633 | 634 | sheet1.write(0,0 , 'Book Code') 635 | sheet1.write(0,1 , 'Book Name') 636 | sheet1.write(0,2 , 'Book Description') 637 | sheet1.write(0,3 , 'Book Category') 638 | sheet1.write(0,4 , 'Book Author') 639 | sheet1.write(0,5 , 'Book publisher') 640 | sheet1.write(0,6 , 'Book Price') 641 | 642 | 643 | row_number = 1 644 | for row in data : 645 | column_number = 0 646 | for item in row : 647 | sheet1.write(row_number , column_number , str(item)) 648 | column_number += 1 649 | row_number += 1 650 | 651 | wb.close() 652 | self.statusBar().showMessage('Book Report Created Successfully') 653 | 654 | 655 | 656 | def Export_Clients(self): 657 | self.db = MySQLdb.connect(host='localhost',port=8080,user='root',password='saadhaxxan',db='library') 658 | 659 | self.cur = self.db.cursor() 660 | 661 | self.cur.execute(''' SELECT client_name , client_email ,client_nationalid FROM clients ''') 662 | data = self.cur.fetchall() 663 | 664 | wb = Workbook('all_CLients.xlsx') 665 | sheet1 = wb.add_worksheet() 666 | 667 | sheet1.write(0,0 , 'Client Name') 668 | sheet1.write(0,1 , 'CLient Email') 669 | sheet1.write(0,2 , 'CLient NationalID') 670 | 671 | 672 | row_number = 1 673 | for row in data : 674 | column_number = 0 675 | for item in row : 676 | sheet1.write(row_number , column_number , str(item)) 677 | column_number += 1 678 | row_number += 1 679 | 680 | wb.close() 681 | self.statusBar().showMessage('CLients Report Created Successfully') 682 | 683 | 684 | 685 | 686 | ######################################## 687 | ######### UI Themes ################# 688 | 689 | def Dark_Blue_Theme(self): 690 | style = open('themes/darkblue.css' , 'r') 691 | style = style.read() 692 | self.setStyleSheet(style) 693 | 694 | def Dark_Gray_Theme(self): 695 | style = open('themes/darkgray.css' , 'r') 696 | style = style.read() 697 | self.setStyleSheet(style) 698 | 699 | def Dark_Orange_Theme(self): 700 | style = open('themes/darkorange.css' , 'r') 701 | style = style.read() 702 | self.setStyleSheet(style) 703 | 704 | def QDark_Theme(self): 705 | style = open('themes/qdark.css' , 'r') 706 | style = style.read() 707 | self.setStyleSheet(style) 708 | 709 | 710 | 711 | def main(): 712 | app = QApplication(sys.argv) 713 | window = MainApp() 714 | window.show() 715 | app.exec_() 716 | 717 | 718 | if __name__ == '__main__': 719 | main() 720 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/outline.txt: -------------------------------------------------------------------------------- 1 | library system : 2 | - add new book 3 | - editing book 4 | - deleting book 5 | - categories 6 | - search 7 | - users , login , signup 8 | - settings [categories , author , publisher ] 9 | - day to day operations 10 | - reports [excel files] 11 | 12 | 13 | book : 14 | - title 15 | - code 16 | - desc 17 | - category 18 | - price 19 | - author 20 | - publisher 21 | 22 | 23 | users : 24 | - username 25 | - password 26 | - email address 27 | 28 | 29 | day_to_day : 30 | - book name 31 | - retrieve / rent 32 | - days 33 | 34 | 35 | category : 36 | - name 37 | 38 | publisher : 39 | - name 40 | 41 | author : 42 | - name 43 | 44 | 45 | 46 | 47 | 48 | 49 | - 50 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/themes/darkblue.css: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) <2013-2014> 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | QProgressBar:horizontal { 26 | border: 1px solid #3A3939; 27 | text-align: center; 28 | padding: 1px; 29 | background: #201F1F; 30 | } 31 | QProgressBar::chunk:horizontal { 32 | background-color: qlineargradient(spread:reflect, x1:1, y1:0.545, x2:1, y2:0, stop:0 rgba(28, 66, 111, 255), stop:1 rgba(37, 87, 146, 255)); 33 | } 34 | 35 | QToolTip 36 | { 37 | border: 1px solid #3A3939; 38 | background-color: rgb(90, 102, 117);; 39 | color: white; 40 | padding: 1px; 41 | opacity: 200; 42 | } 43 | 44 | QWidget 45 | { 46 | color: silver; 47 | background-color: #302F2F; 48 | selection-background-color:#3d8ec9; 49 | selection-color: black; 50 | background-clip: border; 51 | border-image: none; 52 | outline: 0; 53 | } 54 | 55 | QWidget:item:hover 56 | { 57 | background-color: #78879b; 58 | color: black; 59 | } 60 | 61 | QWidget:item:selected 62 | { 63 | background-color: #3d8ec9; 64 | } 65 | 66 | QCheckBox 67 | { 68 | spacing: 5px; 69 | outline: none; 70 | color: #bbb; 71 | margin-bottom: 2px; 72 | } 73 | 74 | QCheckBox:disabled 75 | { 76 | color: #777777; 77 | } 78 | QCheckBox::indicator, 79 | QGroupBox::indicator 80 | { 81 | width: 18px; 82 | height: 18px; 83 | } 84 | QGroupBox::indicator 85 | { 86 | margin-left: 2px; 87 | } 88 | 89 | QCheckBox::indicator:unchecked, 90 | QCheckBox::indicator:unchecked:hover, 91 | QGroupBox::indicator:unchecked, 92 | QGroupBox::indicator:unchecked:hover 93 | { 94 | image: url(:/dark_blue/img/checkbox_unchecked.png); 95 | } 96 | 97 | QCheckBox::indicator:unchecked:focus, 98 | QCheckBox::indicator:unchecked:pressed, 99 | QGroupBox::indicator:unchecked:focus, 100 | QGroupBox::indicator:unchecked:pressed 101 | { 102 | border: none; 103 | image: url(:/dark_blue/img/checkbox_unchecked_focus.png); 104 | } 105 | 106 | QCheckBox::indicator:checked, 107 | QCheckBox::indicator:checked:hover, 108 | QGroupBox::indicator:checked, 109 | QGroupBox::indicator:checked:hover 110 | { 111 | image: url(:/dark_blue/img/checkbox_checked.png); 112 | } 113 | 114 | QCheckBox::indicator:checked:focus, 115 | QCheckBox::indicator:checked:pressed, 116 | QGroupBox::indicator:checked:focus, 117 | QGroupBox::indicator:checked:pressed 118 | { 119 | border: none; 120 | image: url(:/dark_blue/img/checkbox_checked_focus.png); 121 | } 122 | 123 | QCheckBox::indicator:indeterminate, 124 | QCheckBox::indicator:indeterminate:hover, 125 | QCheckBox::indicator:indeterminate:pressed 126 | QGroupBox::indicator:indeterminate, 127 | QGroupBox::indicator:indeterminate:hover, 128 | QGroupBox::indicator:indeterminate:pressed 129 | { 130 | image: url(:/dark_blue/img/checkbox_indeterminate.png); 131 | } 132 | 133 | QCheckBox::indicator:indeterminate:focus, 134 | QGroupBox::indicator:indeterminate:focus 135 | { 136 | image: url(:/dark_blue/img/checkbox_indeterminate_focus.png); 137 | } 138 | 139 | QCheckBox::indicator:checked:disabled, 140 | QGroupBox::indicator:checked:disabled 141 | { 142 | image: url(:/dark_blue/img/checkbox_checked_disabled.png); 143 | } 144 | 145 | QCheckBox::indicator:unchecked:disabled, 146 | QGroupBox::indicator:unchecked:disabled 147 | { 148 | image: url(:/dark_blue/img/checkbox_unchecked_disabled.png); 149 | } 150 | 151 | QRadioButton 152 | { 153 | spacing: 5px; 154 | outline: none; 155 | color: #bbb; 156 | margin-bottom: 2px; 157 | } 158 | 159 | QRadioButton:disabled 160 | { 161 | color: #777777; 162 | } 163 | QRadioButton::indicator 164 | { 165 | width: 21px; 166 | height: 21px; 167 | } 168 | 169 | QRadioButton::indicator:unchecked, 170 | QRadioButton::indicator:unchecked:hover 171 | { 172 | image: url(:/dark_blue/img/radio_unchecked.png); 173 | } 174 | 175 | QRadioButton::indicator:unchecked:focus, 176 | QRadioButton::indicator:unchecked:pressed 177 | { 178 | border: none; 179 | outline: none; 180 | image: url(:/dark_blue/img/radio_unchecked_focus.png); 181 | } 182 | 183 | QRadioButton::indicator:checked, 184 | QRadioButton::indicator:checked:hover 185 | { 186 | border: none; 187 | outline: none; 188 | image: url(:/dark_blue/img/radio_checked.png); 189 | } 190 | 191 | QRadioButton::indicator:checked:focus, 192 | QRadioButton::indicato::menu-arrowr:checked:pressed 193 | { 194 | border: none; 195 | outline: none; 196 | image: url(:/dark_blue/img/radio_checked_focus.png); 197 | } 198 | 199 | QRadioButton::indicator:indeterminate, 200 | QRadioButton::indicator:indeterminate:hover, 201 | QRadioButton::indicator:indeterminate:pressed 202 | { 203 | image: url(:/dark_blue/img/radio_indeterminate.png); 204 | } 205 | 206 | QRadioButton::indicator:checked:disabled 207 | { 208 | outline: none; 209 | image: url(:/dark_blue/img/radio_checked_disabled.png); 210 | } 211 | 212 | QRadioButton::indicator:unchecked:disabled 213 | { 214 | image: url(:/dark_blue/img/radio_unchecked_disabled.png); 215 | } 216 | 217 | 218 | QMenuBar 219 | { 220 | background-color: #302F2F; 221 | color: silver; 222 | } 223 | 224 | QMenuBar::item 225 | { 226 | background: transparent; 227 | } 228 | 229 | QMenuBar::item:selected 230 | { 231 | background: transparent; 232 | border: 1px solid #3A3939; 233 | } 234 | 235 | QMenuBar::item:pressed 236 | { 237 | border: 1px solid #3A3939; 238 | background-color: #3d8ec9; 239 | color: black; 240 | margin-bottom:-1px; 241 | padding-bottom:1px; 242 | } 243 | 244 | QMenu 245 | { 246 | border: 1px solid #3A3939; 247 | color: silver; 248 | margin: 1px; 249 | } 250 | 251 | QMenu::icon 252 | { 253 | margin: 1px; 254 | } 255 | 256 | QMenu::item 257 | { 258 | padding: 2px 2px 2px 25px; 259 | margin-left: 5px; 260 | border: 1px solid transparent; /* reserve space for selection border */ 261 | } 262 | 263 | QMenu::item:selected 264 | { 265 | color: black; 266 | } 267 | 268 | QMenu::separator { 269 | height: 2px; 270 | background: lightblue; 271 | margin-left: 10px; 272 | margin-right: 5px; 273 | } 274 | 275 | QMenu::indicator { 276 | width: 16px; 277 | height: 16px; 278 | } 279 | 280 | /* non-exclusive indicator = check box style indicator 281 | (see QActionGroup::setExclusive) */ 282 | QMenu::indicator:non-exclusive:unchecked { 283 | image: url(:/dark_blue/img/checkbox_unchecked.png); 284 | } 285 | 286 | QMenu::indicator:non-exclusive:unchecked:selected { 287 | image: url(:/dark_blue/img/checkbox_unchecked_disabled.png); 288 | } 289 | 290 | QMenu::indicator:non-exclusive:checked { 291 | image: url(:/dark_blue/img/checkbox_checked.png); 292 | } 293 | 294 | QMenu::indicator:non-exclusive:checked:selected { 295 | image: url(:/dark_blue/img/checkbox_checked_disabled.png); 296 | } 297 | 298 | /* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */ 299 | QMenu::indicator:exclusive:unchecked { 300 | image: url(:/dark_blue/img/radio_unchecked.png); 301 | } 302 | 303 | QMenu::indicator:exclusive:unchecked:selected { 304 | image: url(:/dark_blue/img/radio_unchecked_disabled.png); 305 | } 306 | 307 | QMenu::indicator:exclusive:checked { 308 | image: url(:/dark_blue/img/radio_checked.png); 309 | } 310 | 311 | QMenu::indicator:exclusive:checked:selected { 312 | image: url(:/dark_blue/img/radio_checked_disabled.png); 313 | } 314 | 315 | QMenu::right-arrow { 316 | margin: 5px; 317 | image: url(:/dark_blue/img/right_arrow.png) 318 | } 319 | 320 | 321 | QWidget:disabled 322 | { 323 | color: #808080; 324 | background-color: #302F2F; 325 | } 326 | 327 | QAbstractItemView 328 | { 329 | alternate-background-color: #3A3939; 330 | color: silver; 331 | border: 1px solid 3A3939; 332 | border-radius: 2px; 333 | padding: 1px; 334 | } 335 | 336 | QWidget:focus, QMenuBar:focus 337 | { 338 | border: 1px solid #78879b; 339 | } 340 | 341 | QTabWidget:focus, QCheckBox:focus, QRadioButton:focus, QSlider:focus 342 | { 343 | border: none; 344 | } 345 | 346 | QLineEdit 347 | { 348 | background-color: #201F1F; 349 | padding: 2px; 350 | border-style: solid; 351 | border: 1px solid #3A3939; 352 | border-radius: 2px; 353 | color: silver; 354 | } 355 | 356 | QGroupBox { 357 | border:1px solid #3A3939; 358 | border-radius: 2px; 359 | margin-top: 20px; 360 | background-color: #302F2F; 361 | color: silver; 362 | } 363 | 364 | QGroupBox::title { 365 | subcontrol-origin: margin; 366 | subcontrol-position: top center; 367 | padding-left: 10px; 368 | padding-right: 10px; 369 | padding-top: 10px; 370 | } 371 | 372 | QAbstractScrollArea 373 | { 374 | border-radius: 2px; 375 | border: 1px solid #3A3939; 376 | background-color: transparent; 377 | } 378 | 379 | QScrollBar:horizontal 380 | { 381 | height: 15px; 382 | margin: 3px 15px 3px 15px; 383 | border: 1px transparent #2A2929; 384 | border-radius: 4px; 385 | background-color: #2A2929; 386 | } 387 | 388 | QScrollBar::handle:horizontal 389 | { 390 | background-color: #605F5F; 391 | min-width: 5px; 392 | border-radius: 4px; 393 | } 394 | 395 | QScrollBar::add-line:horizontal 396 | { 397 | margin: 0px 3px 0px 3px; 398 | border-image: url(:/dark_blue/img/right_arrow_disabled.png); 399 | width: 10px; 400 | height: 10px; 401 | subcontrol-position: right; 402 | subcontrol-origin: margin; 403 | } 404 | 405 | QScrollBar::sub-line:horizontal 406 | { 407 | margin: 0px 3px 0px 3px; 408 | border-image: url(:/dark_blue/img/left_arrow_disabled.png); 409 | height: 10px; 410 | width: 10px; 411 | subcontrol-position: left; 412 | subcontrol-origin: margin; 413 | } 414 | 415 | QScrollBar::add-line:horizontal:hover,QScrollBar::add-line:horizontal:on 416 | { 417 | border-image: url(:/dark_blue/img/right_arrow.png); 418 | height: 10px; 419 | width: 10px; 420 | subcontrol-position: right; 421 | subcontrol-origin: margin; 422 | } 423 | 424 | 425 | QScrollBar::sub-line:horizontal:hover, QScrollBar::sub-line:horizontal:on 426 | { 427 | border-image: url(:/dark_blue/img/left_arrow.png); 428 | height: 10px; 429 | width: 10px; 430 | subcontrol-position: left; 431 | subcontrol-origin: margin; 432 | } 433 | 434 | QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal 435 | { 436 | background: none; 437 | } 438 | 439 | 440 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 441 | { 442 | background: none; 443 | } 444 | 445 | QScrollBar:vertical 446 | { 447 | background-color: #2A2929; 448 | width: 15px; 449 | margin: 15px 3px 15px 3px; 450 | border: 1px transparent #2A2929; 451 | border-radius: 4px; 452 | } 453 | 454 | QScrollBar::handle:vertical 455 | { 456 | background-color: #605F5F; 457 | min-height: 5px; 458 | border-radius: 4px; 459 | } 460 | 461 | QScrollBar::sub-line:vertical 462 | { 463 | margin: 3px 0px 3px 0px; 464 | border-image: url(:/dark_blue/img/up_arrow_disabled.png); 465 | height: 10px; 466 | width: 10px; 467 | subcontrol-position: top; 468 | subcontrol-origin: margin; 469 | } 470 | 471 | QScrollBar::add-line:vertical 472 | { 473 | margin: 3px 0px 3px 0px; 474 | border-image: url(:/dark_blue/img/down_arrow_disabled.png); 475 | height: 10px; 476 | width: 10px; 477 | subcontrol-position: bottom; 478 | subcontrol-origin: margin; 479 | } 480 | 481 | QScrollBar::sub-line:vertical:hover,QScrollBar::sub-line:vertical:on 482 | { 483 | 484 | border-image: url(:/dark_blue/img/up_arrow.png); 485 | height: 10px; 486 | width: 10px; 487 | subcontrol-position: top; 488 | subcontrol-origin: margin; 489 | } 490 | 491 | 492 | QScrollBar::add-line:vertical:hover, QScrollBar::add-line:vertical:on 493 | { 494 | border-image: url(:/dark_blue/img/down_arrow.png); 495 | height: 10px; 496 | width: 10px; 497 | subcontrol-position: bottom; 498 | subcontrol-origin: margin; 499 | } 500 | 501 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 502 | { 503 | background: none; 504 | } 505 | 506 | 507 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 508 | { 509 | background: none; 510 | } 511 | 512 | QTextEdit 513 | { 514 | background-color: #201F1F; 515 | color: silver; 516 | border: 1px solid #3A3939; 517 | } 518 | 519 | QPlainTextEdit 520 | { 521 | background-color: #201F1F;; 522 | color: silver; 523 | border-radius: 2px; 524 | border: 1px solid #3A3939; 525 | } 526 | 527 | QHeaderView::section 528 | { 529 | background-color: #3A3939; 530 | color: silver; 531 | padding-left: 4px; 532 | border: 1px solid #6c6c6c; 533 | } 534 | 535 | QSizeGrip { 536 | image: url(:/dark_blue/img/sizegrip.png); 537 | width: 12px; 538 | height: 12px; 539 | } 540 | 541 | QMainWindow 542 | { 543 | background-color: #302F2F; 544 | 545 | } 546 | 547 | QMainWindow::separator 548 | { 549 | background-color: #302F2F; 550 | color: white; 551 | padding-left: 4px; 552 | spacing: 2px; 553 | border: 1px dashed #3A3939; 554 | } 555 | 556 | QMainWindow::separator:hover 557 | { 558 | 559 | background-color: #787876; 560 | color: white; 561 | padding-left: 4px; 562 | border: 1px solid #3A3939; 563 | spacing: 2px; 564 | } 565 | 566 | 567 | QMenu::separator 568 | { 569 | height: 1px; 570 | background-color: #3A3939; 571 | color: white; 572 | padding-left: 4px; 573 | margin-left: 10px; 574 | margin-right: 5px; 575 | } 576 | 577 | 578 | QFrame 579 | { 580 | border-radius: 2px; 581 | border: 1px solid #444; 582 | } 583 | 584 | QFrame[frameShape="0"] 585 | { 586 | border-radius: 2px; 587 | border: 1px transparent #444; 588 | } 589 | 590 | QStackedWidget 591 | { 592 | background-color: #302F2F; 593 | border: 1px transparent black; 594 | } 595 | 596 | QToolBar { 597 | border: 1px transparent #393838; 598 | background: 1px solid #302F2F; 599 | font-weight: bold; 600 | } 601 | 602 | QToolBar::handle:horizontal { 603 | image: url(:/dark_blue/img/Hmovetoolbar.png); 604 | } 605 | QToolBar::handle:vertical { 606 | image: url(:/dark_blue/img/Vmovetoolbar.png); 607 | } 608 | QToolBar::separator:horizontal { 609 | image: url(:/dark_blue/img/Hsepartoolbar.png); 610 | } 611 | QToolBar::separator:vertical { 612 | image: url(:/dark_blue/img/Vsepartoolbars.png); 613 | } 614 | 615 | QPushButton 616 | { 617 | color: silver; 618 | background-color: #302F2F; 619 | border-width: 2px; 620 | border-color: #4A4949; 621 | border-style: solid; 622 | padding-top: 2px; 623 | padding-bottom: 2px; 624 | padding-left: 10px; 625 | padding-right: 10px; 626 | border-radius: 4px; 627 | /* outline: none; */ 628 | /* min-width: 40px; */ 629 | } 630 | 631 | QPushButton:disabled 632 | { 633 | background-color: #302F2F; 634 | border-width: 2px; 635 | border-color: #3A3939; 636 | border-style: solid; 637 | padding-top: 2px; 638 | padding-bottom: 2px; 639 | padding-left: 10px; 640 | padding-right: 10px; 641 | /*border-radius: 2px;*/ 642 | color: #808080; 643 | } 644 | 645 | QPushButton:focus { 646 | background-color: #3d8ec9; 647 | color: white; 648 | } 649 | 650 | QComboBox 651 | { 652 | selection-background-color: #3d8ec9; 653 | background-color: #201F1F; 654 | border-style: solid; 655 | border: 1px solid #3A3939; 656 | border-radius: 2px; 657 | padding: 2px; 658 | min-width: 75px; 659 | } 660 | 661 | QPushButton:checked{ 662 | background-color: #4A4949; 663 | border-color: #6A6969; 664 | } 665 | 666 | QPushButton:hover { 667 | border: 2px solid #78879b; 668 | color: silver; 669 | } 670 | 671 | QComboBox:hover, QAbstractSpinBox:hover,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QAbstractView:hover,QTreeView:hover 672 | { 673 | border: 1px solid #78879b; 674 | color: silver; 675 | } 676 | 677 | QComboBox:on 678 | { 679 | background-color: #626873; 680 | padding-top: 3px; 681 | padding-left: 4px; 682 | selection-background-color: #4a4a4a; 683 | } 684 | 685 | QComboBox QAbstractItemView 686 | { 687 | background-color: #201F1F; 688 | border-radius: 2px; 689 | border: 1px solid #444; 690 | selection-background-color: #3d8ec9; 691 | color: silver; 692 | } 693 | 694 | QComboBox::drop-down 695 | { 696 | subcontrol-origin: padding; 697 | subcontrol-position: top right; 698 | width: 15px; 699 | 700 | border-left-width: 0px; 701 | border-left-color: darkgray; 702 | border-left-style: solid; 703 | border-top-right-radius: 3px; 704 | border-bottom-right-radius: 3px; 705 | } 706 | 707 | QComboBox::down-arrow 708 | { 709 | image: url(:/dark_blue/img/down_arrow_disabled.png); 710 | } 711 | 712 | QComboBox::down-arrow:on, QComboBox::down-arrow:hover, 713 | QComboBox::down-arrow:focus 714 | { 715 | image: url(:/dark_blue/img/down_arrow.png); 716 | } 717 | 718 | QPushButton:pressed 719 | { 720 | background-color: #484846; 721 | } 722 | 723 | QAbstractSpinBox { 724 | padding-top: 2px; 725 | padding-bottom: 2px; 726 | border: 1px solid #3A3939; 727 | background-color: #201F1F; 728 | color: silver; 729 | border-radius: 2px; 730 | min-width: 75px; 731 | } 732 | 733 | QAbstractSpinBox:up-button 734 | { 735 | background-color: transparent; 736 | subcontrol-origin: border; 737 | subcontrol-position: top right; 738 | } 739 | 740 | QAbstractSpinBox:down-button 741 | { 742 | background-color: transparent; 743 | subcontrol-origin: border; 744 | subcontrol-position: bottom right; 745 | } 746 | 747 | QAbstractSpinBox::up-arrow,QAbstractSpinBox::up-arrow:disabled,QAbstractSpinBox::up-arrow:off { 748 | image: url(:/dark_blue/img/up_arrow_disabled.png); 749 | width: 10px; 750 | height: 10px; 751 | } 752 | QAbstractSpinBox::up-arrow:hover 753 | { 754 | image: url(:/dark_blue/img/up_arrow.png); 755 | } 756 | 757 | 758 | QAbstractSpinBox::down-arrow,QAbstractSpinBox::down-arrow:disabled,QAbstractSpinBox::down-arrow:off 759 | { 760 | image: url(:/dark_blue/img/down_arrow_disabled.png); 761 | width: 10px; 762 | height: 10px; 763 | } 764 | QAbstractSpinBox::down-arrow:hover 765 | { 766 | image: url(:/dark_blue/img/down_arrow.png); 767 | } 768 | 769 | 770 | QLabel 771 | { 772 | border: 0px solid black; 773 | } 774 | 775 | QTabWidget{ 776 | border: 1px transparent black; 777 | } 778 | 779 | QTabWidget::pane { 780 | border: 1px solid #444; 781 | border-radius: 3px; 782 | padding: 3px; 783 | } 784 | 785 | QTabBar 786 | { 787 | qproperty-drawBase: 0; 788 | left: 5px; /* move to the right by 5px */ 789 | } 790 | 791 | QTabBar:focus 792 | { 793 | border: 0px transparent black; 794 | } 795 | 796 | QTabBar::close-button { 797 | image: url(:/dark_blue/img/close.png); 798 | background: transparent; 799 | } 800 | 801 | QTabBar::close-button:hover 802 | { 803 | image: url(:/dark_blue/img/close-hover.png); 804 | background: transparent; 805 | } 806 | 807 | QTabBar::close-button:pressed { 808 | image: url(:/dark_blue/img/close-pressed.png); 809 | background: transparent; 810 | } 811 | 812 | /* TOP TABS */ 813 | QTabBar::tab:top { 814 | color: #b1b1b1; 815 | border: 1px solid #4A4949; 816 | border-bottom: 1px transparent black; 817 | background-color: #302F2F; 818 | padding: 5px; 819 | border-top-left-radius: 2px; 820 | border-top-right-radius: 2px; 821 | } 822 | 823 | QTabBar::tab:top:!selected 824 | { 825 | color: #b1b1b1; 826 | background-color: #201F1F; 827 | border: 1px transparent #4A4949; 828 | border-bottom: 1px transparent #4A4949; 829 | border-top-left-radius: 0px; 830 | border-top-right-radius: 0px; 831 | } 832 | 833 | QTabBar::tab:top:!selected:hover { 834 | background-color: #48576b; 835 | } 836 | 837 | /* BOTTOM TABS */ 838 | QTabBar::tab:bottom { 839 | color: #b1b1b1; 840 | border: 1px solid #4A4949; 841 | border-top: 1px transparent black; 842 | background-color: #302F2F; 843 | padding: 5px; 844 | border-bottom-left-radius: 2px; 845 | border-bottom-right-radius: 2px; 846 | } 847 | 848 | QTabBar::tab:bottom:!selected 849 | { 850 | color: #b1b1b1; 851 | background-color: #201F1F; 852 | border: 1px transparent #4A4949; 853 | border-top: 1px transparent #4A4949; 854 | border-bottom-left-radius: 0px; 855 | border-bottom-right-radius: 0px; 856 | } 857 | 858 | QTabBar::tab:bottom:!selected:hover { 859 | background-color: #78879b; 860 | } 861 | 862 | /* LEFT TABS */ 863 | QTabBar::tab:left { 864 | color: #b1b1b1; 865 | border: 1px solid #4A4949; 866 | border-left: 1px transparent black; 867 | background-color: #302F2F; 868 | padding: 5px; 869 | border-top-right-radius: 2px; 870 | border-bottom-right-radius: 2px; 871 | } 872 | 873 | QTabBar::tab:left:!selected 874 | { 875 | color: #b1b1b1; 876 | background-color: #201F1F; 877 | border: 1px transparent #4A4949; 878 | border-right: 1px transparent #4A4949; 879 | border-top-right-radius: 0px; 880 | border-bottom-right-radius: 0px; 881 | } 882 | 883 | QTabBar::tab:left:!selected:hover { 884 | background-color: #48576b; 885 | } 886 | 887 | 888 | /* RIGHT TABS */ 889 | QTabBar::tab:right { 890 | color: #b1b1b1; 891 | border: 1px solid #4A4949; 892 | border-right: 1px transparent black; 893 | background-color: #302F2F; 894 | padding: 5px; 895 | border-top-left-radius: 2px; 896 | border-bottom-left-radius: 2px; 897 | } 898 | 899 | QTabBar::tab:right:!selected 900 | { 901 | color: #b1b1b1; 902 | background-color: #201F1F; 903 | border: 1px transparent #4A4949; 904 | border-right: 1px transparent #4A4949; 905 | border-top-left-radius: 0px; 906 | border-bottom-left-radius: 0px; 907 | } 908 | 909 | QTabBar::tab:right:!selected:hover { 910 | background-color: #48576b; 911 | } 912 | 913 | QTabBar QToolButton::right-arrow:enabled { 914 | image: url(:/dark_blue/img/right_arrow.png); 915 | } 916 | 917 | QTabBar QToolButton::left-arrow:enabled { 918 | image: url(:/dark_blue/img/left_arrow.png); 919 | } 920 | 921 | QTabBar QToolButton::right-arrow:disabled { 922 | image: url(:/dark_blue/img/right_arrow_disabled.png); 923 | } 924 | 925 | QTabBar QToolButton::left-arrow:disabled { 926 | image: url(:/dark_blue/img/left_arrow_disabled.png); 927 | } 928 | 929 | 930 | QDockWidget { 931 | border: 1px solid #403F3F; 932 | titlebar-close-icon: url(:/dark_blue/img/close.png); 933 | titlebar-normal-icon: url(:/dark_blue/img/undock.png); 934 | } 935 | 936 | QDockWidget::close-button, QDockWidget::float-button { 937 | border: 1px solid transparent; 938 | border-radius: 2px; 939 | background: transparent; 940 | } 941 | 942 | QDockWidget::close-button:hover, QDockWidget::float-button:hover { 943 | background: rgba(255, 255, 255, 10); 944 | } 945 | 946 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed { 947 | padding: 1px -1px -1px 1px; 948 | background: rgba(255, 255, 255, 10); 949 | } 950 | 951 | QTreeView, QListView, QTextBrowser, AtLineEdit, AtLineEdit::hover { 952 | border: 1px solid #444; 953 | background-color: silver; 954 | border-radius: 3px; 955 | margin-left: 3px; 956 | color: black; 957 | } 958 | 959 | QTreeView:branch:selected, QTreeView:branch:hover { 960 | background: url(:/dark_blue/img/transparent.png); 961 | } 962 | 963 | QTreeView::branch:has-siblings:!adjoins-item { 964 | border-image: url(:/dark_blue/img/transparent.png); 965 | } 966 | 967 | QTreeView::branch:has-siblings:adjoins-item { 968 | border-image: url(:/dark_blue/img/transparent.png); 969 | } 970 | 971 | QTreeView::branch:!has-children:!has-siblings:adjoins-item { 972 | border-image: url(:/dark_blue/img/transparent.png); 973 | } 974 | 975 | QTreeView::branch:has-children:!has-siblings:closed, 976 | QTreeView::branch:closed:has-children:has-siblings { 977 | image: url(:/dark_blue/img/branch_closed.png); 978 | } 979 | 980 | QTreeView::branch:open:has-children:!has-siblings, 981 | QTreeView::branch:open:has-children:has-siblings { 982 | image: url(:/dark_blue/img/branch_open.png); 983 | } 984 | 985 | QTreeView::branch:has-children:!has-siblings:closed:hover, 986 | QTreeView::branch:closed:has-children:has-siblings:hover { 987 | image: url(:/dark_blue/img/branch_closed-on.png); 988 | } 989 | 990 | QTreeView::branch:open:has-children:!has-siblings:hover, 991 | QTreeView::branch:open:has-children:has-siblings:hover { 992 | image: url(:/dark_blue/img/branch_open-on.png); 993 | } 994 | 995 | QListView::item:!selected:hover, QListView::item:!selected:hover, QTreeView::item:!selected:hover { 996 | background: rgba(0, 0, 0, 0); 997 | outline: 0; 998 | color: #FFFFFF 999 | } 1000 | 1001 | QListView::item:selected:hover, QListView::item:selected:hover, QTreeView::item:selected:hover { 1002 | background: #3d8ec9; 1003 | color: #FFFFFF; 1004 | } 1005 | 1006 | QSlider::groove:horizontal { 1007 | border: 1px solid #3A3939; 1008 | height: 8px; 1009 | background: #201F1F; 1010 | margin: 2px 0; 1011 | border-radius: 2px; 1012 | } 1013 | 1014 | QSlider::handle:horizontal { 1015 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, 1016 | stop: 0.0 silver, stop: 0.2 #a8a8a8, stop: 1 #727272); 1017 | border: 1px solid #3A3939; 1018 | width: 14px; 1019 | height: 14px; 1020 | margin: -4px 0; 1021 | border-radius: 2px; 1022 | } 1023 | 1024 | QSlider::groove:vertical { 1025 | border: 1px solid #3A3939; 1026 | width: 8px; 1027 | background: #201F1F; 1028 | margin: 0 0px; 1029 | border-radius: 2px; 1030 | } 1031 | 1032 | QSlider::handle:vertical { 1033 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 silver, 1034 | stop: 0.2 #a8a8a8, stop: 1 #727272); 1035 | border: 1px solid #3A3939; 1036 | width: 14px; 1037 | height: 14px; 1038 | margin: 0 -4px; 1039 | border-radius: 2px; 1040 | } 1041 | 1042 | QToolButton { 1043 | /* background-color: transparent; */ 1044 | border: 2px transparent #4A4949; 1045 | border-radius: 4px; 1046 | background-color: dimgray; 1047 | margin: 2px; 1048 | padding: 2px; 1049 | } 1050 | 1051 | QToolButton[popupMode="1"] { /* only for MenuButtonPopup */ 1052 | padding-right: 20px; /* make way for the popup button */ 1053 | border: 2px transparent #4A4949; 1054 | border-radius: 4px; 1055 | } 1056 | 1057 | QToolButton[popupMode="2"] { /* only for InstantPopup */ 1058 | padding-right: 10px; /* make way for the popup button */ 1059 | border: 2px transparent #4A4949; 1060 | } 1061 | 1062 | 1063 | QToolButton:hover, QToolButton::menu-button:hover { 1064 | border: 2px solid #78879b; 1065 | } 1066 | 1067 | QToolButton:checked, QToolButton:pressed, 1068 | QToolButton::menu-button:pressed { 1069 | background-color: #4A4949; 1070 | border: 2px solid #78879b; 1071 | } 1072 | 1073 | /* the subcontrol below is used only in the InstantPopup or DelayedPopup mode */ 1074 | QToolButton::menu-indicator { 1075 | image: url(:/dark_blue/img/down_arrow.png); 1076 | top: -7px; left: -2px; /* shift it a bit */ 1077 | } 1078 | 1079 | /* the subcontrols below are used only in the MenuButtonPopup mode */ 1080 | QToolButton::menu-button { 1081 | border: 1px transparent #4A4949; 1082 | border-top-right-radius: 6px; 1083 | border-bottom-right-radius: 6px; 1084 | /* 16px width + 4px for border = 20px allocated above */ 1085 | width: 16px; 1086 | outline: none; 1087 | } 1088 | 1089 | QToolButton::menu-arrow { 1090 | image: url(:/dark_blue/img/down_arrow.png); 1091 | } 1092 | 1093 | QToolButton::menu-arrow:open { 1094 | top: 1px; left: 1px; /* shift it a bit */ 1095 | border: 1px solid #3A3939; 1096 | } 1097 | 1098 | QPushButton::menu-indicator { 1099 | subcontrol-origin: padding; 1100 | subcontrol-position: bottom right; 1101 | left: 4px; 1102 | } 1103 | 1104 | QTableView 1105 | { 1106 | border: 1px solid #444; 1107 | gridline-color: #6c6c6c; 1108 | background-color: #201F1F; 1109 | } 1110 | 1111 | 1112 | QTableView, QHeaderView 1113 | { 1114 | border-radius: 0px; 1115 | } 1116 | 1117 | QTableView::item:pressed, QListView::item:pressed, QTreeView::item:pressed { 1118 | background: #78879b; 1119 | color: #FFFFFF; 1120 | } 1121 | 1122 | QTableView::item:selected:active, QTreeView::item:selected:active, QListView::item:selected:active { 1123 | background: #3d8ec9; 1124 | color: #FFFFFF; 1125 | } 1126 | 1127 | 1128 | QHeaderView 1129 | { 1130 | border: 1px transparent; 1131 | border-radius: 2px; 1132 | margin: 0px; 1133 | padding: 0px; 1134 | } 1135 | 1136 | QHeaderView::section { 1137 | background-color: #3A3939; 1138 | color: silver; 1139 | padding: 4px; 1140 | border: 1px solid #6c6c6c; 1141 | border-radius: 0px; 1142 | text-align: center; 1143 | } 1144 | 1145 | QHeaderView::section::vertical::first, QHeaderView::section::vertical::only-one 1146 | { 1147 | border-top: 1px solid #6c6c6c; 1148 | } 1149 | 1150 | QHeaderView::section::vertical 1151 | { 1152 | border-top: transparent; 1153 | } 1154 | 1155 | QHeaderView::section::horizontal::first, QHeaderView::section::horizontal::only-one 1156 | { 1157 | border-left: 1px solid #6c6c6c; 1158 | } 1159 | 1160 | QHeaderView::section::horizontal 1161 | { 1162 | border-left: transparent; 1163 | } 1164 | 1165 | 1166 | QHeaderView::section:checked 1167 | { 1168 | color: white; 1169 | background-color: #5A5959; 1170 | } 1171 | 1172 | /* style the sort indicator */ 1173 | QHeaderView::down-arrow { 1174 | image: url(:/dark_blue/img/down_arrow.png); 1175 | } 1176 | 1177 | QHeaderView::up-arrow { 1178 | image: url(:/dark_blue/img/up_arrow.png); 1179 | } 1180 | 1181 | 1182 | QTableCornerButton::section { 1183 | background-color: #3A3939; 1184 | border: 1px solid #3A3939; 1185 | border-radius: 2px; 1186 | } 1187 | 1188 | QToolBox { 1189 | padding: 3px; 1190 | border: 1px transparent black; 1191 | } 1192 | 1193 | QToolBox::tab { 1194 | color: #b1b1b1; 1195 | background-color: #302F2F; 1196 | border: 1px solid #4A4949; 1197 | border-bottom: 1px transparent #302F2F; 1198 | border-top-left-radius: 5px; 1199 | border-top-right-radius: 5px; 1200 | } 1201 | 1202 | QToolBox::tab:selected { /* italicize selected tabs */ 1203 | font: italic; 1204 | background-color: #302F2F; 1205 | border-color: #3d8ec9; 1206 | } 1207 | 1208 | QStatusBar::item { 1209 | border: 1px solid #3A3939; 1210 | border-radius: 2px; 1211 | } 1212 | 1213 | 1214 | QFrame[height="3"], QFrame[width="3"] { 1215 | background-color: #AAA; 1216 | } 1217 | 1218 | 1219 | QSplitter::handle { 1220 | border: 1px dashed #3A3939; 1221 | } 1222 | 1223 | QSplitter::handle:hover { 1224 | background-color: #787876; 1225 | border: 1px solid #3A3939; 1226 | } 1227 | 1228 | QSplitter::handle:horizontal { 1229 | width: 1px; 1230 | } 1231 | 1232 | QSplitter::handle:vertical { 1233 | height: 1px; 1234 | } 1235 | 1236 | QListWidget { 1237 | background-color: silver; 1238 | border-radius: 5px; 1239 | margin-left: 5px; 1240 | } 1241 | 1242 | QListWidget::item { 1243 | color: black; 1244 | } 1245 | 1246 | QMessageBox { 1247 | messagebox-critical-icon : url(:/dark_blue/img/critical.png); 1248 | messagebox-information-icon : url(:/dark_blue/img/information.png); 1249 | messagebox-question-icon : url(:/dark_blue/img/question.png); 1250 | messagebox-warning-icon: : url(:/dark_blue/img/warning.png); 1251 | } 1252 | 1253 | ColorButton::enabled { 1254 | border-radius: 0px; 1255 | border: 1px solid #444444; 1256 | } 1257 | 1258 | ColorButton::disabled { 1259 | border-radius: 0px; 1260 | border: 1px solid #AAAAAA; 1261 | } 1262 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/themes/darkgray.css: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) <2013-2014> 5 | * Copyright (c) <2017> 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | QToolTip 26 | { 27 | border: 1px solid black; 28 | background-color: #D1DBCB; 29 | padding: 1px; 30 | border-radius: 3px; 31 | opacity: 100; 32 | } 33 | 34 | QWidget 35 | { 36 | color: #b1b1b1; 37 | background-color: #323232; 38 | selection-background-color:#323232; 39 | selection-color: black; 40 | background-clip: border; 41 | border-image: none; 42 | border: 0px transparent black; 43 | outline: 0; 44 | } 45 | 46 | QWidget:item:hover 47 | { 48 | background-color: #D1DBCB; 49 | color: black; 50 | } 51 | 52 | QWidget:item:selected 53 | { 54 | background-color: #D1DBCB; 55 | border: 0px 56 | } 57 | 58 | QCheckBox 59 | { 60 | spacing: 5px; 61 | outline: none; 62 | color: #eff0f1; 63 | margin-bottom: 2px; 64 | } 65 | 66 | QCheckBox:disabled 67 | { 68 | color: #76797C; 69 | } 70 | 71 | QCheckBox::indicator,QGroupBox::indicator 72 | { 73 | width: 18px; 74 | height: 18px; 75 | } 76 | 77 | QGroupBox::indicator 78 | { 79 | margin-left: 2px; 80 | } 81 | 82 | QCheckBox::indicator:unchecked 83 | { 84 | image: url(:/qss_icons/rc/checkbox_unchecked.png); 85 | } 86 | 87 | QCheckBox::indicator:unchecked:hover, 88 | QCheckBox::indicator:unchecked:focus, 89 | QCheckBox::indicator:unchecked:pressed, 90 | QGroupBox::indicator:unchecked:hover, 91 | QGroupBox::indicator:unchecked:focus, 92 | QGroupBox::indicator:unchecked:pressed 93 | { 94 | border: none; 95 | image: url(:/qss_icons/rc/checkbox_unchecked_focus.png); 96 | } 97 | 98 | QCheckBox::indicator:checked 99 | { 100 | image: url(:/qss_icons/rc/checkbox_checked.png); 101 | } 102 | 103 | QCheckBox::indicator:checked:hover, 104 | QCheckBox::indicator:checked:focus, 105 | QCheckBox::indicator:checked:pressed, 106 | QGroupBox::indicator:checked:hover, 107 | QGroupBox::indicator:checked:focus, 108 | QGroupBox::indicator:checked:pressed 109 | { 110 | border: none; 111 | image: url(:/qss_icons/rc/checkbox_checked_focus.png); 112 | } 113 | 114 | 115 | QCheckBox::indicator:indeterminate 116 | { 117 | image: url(:/qss_icons/rc/checkbox_indeterminate.png); 118 | } 119 | 120 | QCheckBox::indicator:indeterminate:focus, 121 | QCheckBox::indicator:indeterminate:hover, 122 | QCheckBox::indicator:indeterminate:pressed 123 | { 124 | image: url(:/qss_icons/rc/checkbox_indeterminate_focus.png); 125 | } 126 | 127 | QCheckBox::indicator:checked:disabled, 128 | QGroupBox::indicator:checked:disabled 129 | { 130 | image: url(:/qss_icons/rc/checkbox_checked_disabled.png); 131 | } 132 | 133 | QCheckBox::indicator:unchecked:disabled, 134 | QGroupBox::indicator:unchecked:disabled 135 | { 136 | image: url(:/qss_icons/rc/checkbox_unchecked_disabled.png); 137 | } 138 | 139 | QRadioButton 140 | { 141 | spacing: 5px; 142 | outline: none; 143 | color: #eff0f1; 144 | margin-bottom: 2px; 145 | } 146 | 147 | QRadioButton:disabled 148 | { 149 | color: #76797C; 150 | } 151 | QRadioButton::indicator 152 | { 153 | width: 21px; 154 | height: 21px; 155 | } 156 | 157 | QRadioButton::indicator:unchecked 158 | { 159 | image: url(:/qss_icons/rc/radio_unchecked.png); 160 | } 161 | 162 | 163 | QRadioButton::indicator:unchecked:hover, 164 | QRadioButton::indicator:unchecked:focus, 165 | QRadioButton::indicator:unchecked:pressed 166 | { 167 | border: none; 168 | outline: none; 169 | image: url(:/qss_icons/rc/radio_unchecked_focus.png); 170 | } 171 | 172 | QRadioButton::indicator:checked 173 | { 174 | border: none; 175 | outline: none; 176 | image: url(:/qss_icons/rc/radio_checked.png); 177 | } 178 | 179 | QRadioButton::indicator:checked:hover, 180 | QRadioButton::indicator:checked:focus, 181 | QRadioButton::indicator:checked:pressed 182 | { 183 | border: none; 184 | outline: none; 185 | image: url(:/qss_icons/rc/radio_checked_focus.png); 186 | } 187 | 188 | QRadioButton::indicator:checked:disabled 189 | { 190 | outline: none; 191 | image: url(:/qss_icons/rc/radio_checked_disabled.png); 192 | } 193 | 194 | QRadioButton::indicator:unchecked:disabled 195 | { 196 | image: url(:/qss_icons/rc/radio_unchecked_disabled.png); 197 | } 198 | 199 | 200 | QMenuBar 201 | { 202 | background-color: #323232; 203 | color: #D1DBCB; 204 | } 205 | 206 | QMenuBar::item 207 | { 208 | background-color: #323232; 209 | background: transparent; 210 | /* padding: 2px 20px 2px 20px; */ 211 | } 212 | 213 | QMenuBar::item:selected 214 | { 215 | background: transparent; 216 | /* border: 1px solid #76797C; */ 217 | } 218 | 219 | QMenuBar::item:pressed 220 | { 221 | border: 0px solid #76797C; 222 | background-color: #D1DBCB; 223 | color: #000; 224 | margin-bottom:-1px; 225 | padding-bottom:1px; 226 | } 227 | 228 | QMenu 229 | { 230 | background-color: #323232; 231 | /* border: 1px solid #76797C; */ 232 | color: #eff0f1; 233 | /*margin: 2px; */ 234 | } 235 | 236 | QMenu::icon 237 | { 238 | /*margin: 5px;*/ 239 | } 240 | 241 | QMenu::item 242 | { 243 | padding: 2px 30px 2px 30px; 244 | /*margin-left: 5px;*/ 245 | border: 1px solid transparent; /* reserve space for selection border */ 246 | } 247 | 248 | QMenu::item:selected 249 | { 250 | color: #000000; 251 | } 252 | 253 | QMenu::separator { 254 | height: 2px; 255 | background: #D1DBCB; 256 | margin-left: 10px; 257 | margin-right: 5px; 258 | } 259 | 260 | QMenu::indicator { 261 | width: 18px; 262 | height: 18px; 263 | } 264 | 265 | /* non-exclusive indicator = check box style indicator 266 | (see QActionGroup::setExclusive) */ 267 | QMenu::indicator:non-exclusive:unchecked { 268 | image: url(:/qss_icons/rc/checkbox_unchecked.png); 269 | } 270 | 271 | QMenu::indicator:non-exclusive:unchecked:selected { 272 | image: url(:/qss_icons/rc/checkbox_unchecked_disabled.png); 273 | } 274 | 275 | QMenu::indicator:non-exclusive:checked { 276 | image: url(:/qss_icons/rc/checkbox_checked.png); 277 | } 278 | 279 | QMenu::indicator:non-exclusive:checked:selected { 280 | image: url(:/qss_icons/rc/checkbox_checked_disabled.png); 281 | } 282 | 283 | /* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */ 284 | QMenu::indicator:exclusive:unchecked { 285 | image: url(:/qss_icons/rc/radio_unchecked.png); 286 | } 287 | 288 | QMenu::indicator:exclusive:unchecked:selected { 289 | image: url(:/qss_icons/rc/radio_unchecked_disabled.png); 290 | } 291 | 292 | QMenu::indicator:exclusive:checked { 293 | image: url(:/qss_icons/rc/radio_checked.png); 294 | } 295 | 296 | QMenu::indicator:exclusive:checked:selected { 297 | image: url(:/qss_icons/rc/radio_checked_disabled.png); 298 | } 299 | 300 | QMenu::right-arrow { 301 | margin: 5px; 302 | image: url(:/qss_icons/rc/right_arrow.png) 303 | } 304 | 305 | 306 | QWidget:disabled 307 | { 308 | color: #454545; 309 | background-color: #323232; 310 | } 311 | 312 | QAbstractItemView 313 | { 314 | alternate-background-color: #323232; 315 | color: #eff0f1; 316 | border: 1px solid 3A3939; 317 | border-radius: 2px; 318 | } 319 | 320 | QWidget:focus, QMenuBar:focus,QToolBar:focus,QScrollAreaViewer:focus 321 | { 322 | /* border: 2px solid #D1DBCB; */ 323 | } 324 | 325 | QTabWidget:focus, QCheckBox:focus, QRadioButton:focus, QSlider:focus 326 | { 327 | border: none; 328 | } 329 | 330 | QLineEdit 331 | { 332 | background-color: #1e1e1e; 333 | selection-background-color: #D1DBCB; 334 | selection-color: black; 335 | padding: 5px; 336 | border-style: solid; 337 | border: 1px solid #76797C; 338 | border-radius: 2px; 339 | color: #eff0f1; 340 | } 341 | 342 | QGroupBox { 343 | border:1px solid #76797C; 344 | border-radius: 2px; 345 | margin-top: 20px; 346 | } 347 | 348 | QGroupBox::title { 349 | subcontrol-origin: margin; 350 | subcontrol-position: top center; 351 | padding-left: 10px; 352 | padding-right: 10px; 353 | padding-top: 10px; 354 | } 355 | 356 | QAbstractScrollArea 357 | { 358 | border-radius: 0px; 359 | border: 0px solid #76797C; 360 | background-color: transparent; 361 | } 362 | 363 | QScrollBar:horizontal 364 | { 365 | height: 15px; 366 | margin: 3px 15px 3px 15px; 367 | border: 1px transparent #2A2929; 368 | border-radius: 4px; 369 | background-color: #2A2929; 370 | } 371 | 372 | QScrollBar::handle:horizontal 373 | { 374 | background-color: #605F5F; 375 | min-width: 5px; 376 | border-radius: 4px; 377 | } 378 | 379 | QScrollBar::add-line:horizontal 380 | { 381 | margin: 0px 3px 0px 3px; 382 | border-image: url(:/qss_icons/rc/right_arrow_disabled.png); 383 | width: 10px; 384 | height: 10px; 385 | subcontrol-position: right; 386 | subcontrol-origin: margin; 387 | } 388 | 389 | QScrollBar::sub-line:horizontal 390 | { 391 | margin: 0px 3px 0px 3px; 392 | border-image: url(:/qss_icons/rc/left_arrow_disabled.png); 393 | height: 10px; 394 | width: 10px; 395 | subcontrol-position: left; 396 | subcontrol-origin: margin; 397 | } 398 | 399 | QScrollBar::add-line:horizontal:hover,QScrollBar::add-line:horizontal:on 400 | { 401 | border-image: url(:/qss_icons/rc/right_arrow.png); 402 | height: 10px; 403 | width: 10px; 404 | subcontrol-position: right; 405 | subcontrol-origin: margin; 406 | } 407 | 408 | 409 | QScrollBar::sub-line:horizontal:hover, QScrollBar::sub-line:horizontal:on 410 | { 411 | border-image: url(:/qss_icons/rc/left_arrow.png); 412 | height: 10px; 413 | width: 10px; 414 | subcontrol-position: left; 415 | subcontrol-origin: margin; 416 | } 417 | 418 | QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal 419 | { 420 | background: none; 421 | } 422 | 423 | 424 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 425 | { 426 | background: none; 427 | } 428 | 429 | QScrollBar:vertical 430 | { 431 | background-color: #2A2929; 432 | width: 15px; 433 | margin: 15px 3px 15px 3px; 434 | border: 1px transparent #2A2929; 435 | border-radius: 4px; 436 | } 437 | 438 | QScrollBar::handle:vertical 439 | { 440 | background-color: #605F5F; 441 | min-height: 5px; 442 | border-radius: 4px; 443 | } 444 | 445 | QScrollBar::sub-line:vertical 446 | { 447 | margin: 3px 0px 3px 0px; 448 | border-image: url(:/qss_icons/rc/up_arrow_disabled.png); 449 | height: 10px; 450 | width: 10px; 451 | subcontrol-position: top; 452 | subcontrol-origin: margin; 453 | } 454 | 455 | QScrollBar::add-line:vertical 456 | { 457 | margin: 3px 0px 3px 0px; 458 | border-image: url(:/qss_icons/rc/down_arrow_disabled.png); 459 | height: 10px; 460 | width: 10px; 461 | subcontrol-position: bottom; 462 | subcontrol-origin: margin; 463 | } 464 | 465 | QScrollBar::sub-line:vertical:hover,QScrollBar::sub-line:vertical:on 466 | { 467 | 468 | border-image: url(:/qss_icons/rc/up_arrow.png); 469 | height: 10px; 470 | width: 10px; 471 | subcontrol-position: top; 472 | subcontrol-origin: margin; 473 | } 474 | 475 | 476 | QScrollBar::add-line:vertical:hover, QScrollBar::add-line:vertical:on 477 | { 478 | border-image: url(:/qss_icons/rc/down_arrow.png); 479 | height: 10px; 480 | width: 10px; 481 | subcontrol-position: bottom; 482 | subcontrol-origin: margin; 483 | } 484 | 485 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 486 | { 487 | background: none; 488 | } 489 | 490 | 491 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 492 | { 493 | background: none; 494 | } 495 | 496 | QTextEdit 497 | { 498 | background-color: #1e1e1e; 499 | color: #eff0f1; 500 | border: 1px solid #76797C; 501 | } 502 | 503 | QPlainTextEdit 504 | { 505 | background-color: #1e1e1e;; 506 | color: #eff0f1; 507 | border-radius: 2px; 508 | border: 1px solid #76797C; 509 | } 510 | 511 | QHeaderView::section 512 | { 513 | background-color: #76797C; 514 | color: #eff0f1; 515 | padding: 5px; 516 | border: 1px solid #76797C; 517 | } 518 | 519 | QSizeGrip { 520 | image: url(:/qss_icons/rc/sizegrip.png); 521 | width: 12px; 522 | height: 12px; 523 | } 524 | 525 | 526 | QMainWindow::separator 527 | { 528 | background-color: #323232; 529 | color: white; 530 | padding-left: 4px; 531 | spacing: 2px; 532 | border: 1px dashed #76797C; 533 | } 534 | 535 | QMainWindow::separator:hover 536 | { 537 | 538 | background-color: #787876; 539 | color: white; 540 | padding-left: 4px; 541 | border: 1px solid #76797C; 542 | spacing: 2px; 543 | } 544 | 545 | 546 | QMenu::separator 547 | { 548 | height: 1px; 549 | background-color: #76797C; 550 | color: white; 551 | padding-left: 4px; 552 | margin-left: 10px; 553 | margin-right: 5px; 554 | } 555 | 556 | QFrame 557 | { 558 | border-radius: 0px; 559 | /*border: 1px solid #76797C;*/ 560 | } 561 | 562 | 563 | QFrame[frameShape="0"] 564 | { 565 | border-radius: 0px; 566 | border: 0px transparent #76797C; 567 | } 568 | 569 | QStackedWidget 570 | { 571 | border: 1px transparent black; 572 | } 573 | 574 | QToolBar { 575 | border: 0px transparent #393838; 576 | background: 0px solid #323232; 577 | font-weight: bold; 578 | } 579 | 580 | QToolBar::handle:horizontal { 581 | image: url(:/qss_icons/rc/Hmovetoolbar.png); 582 | } 583 | QToolBar::handle:vertical { 584 | image: url(:/qss_icons/rc/Vmovetoolbar.png); 585 | } 586 | QToolBar::separator:horizontal { 587 | image: url(:/qss_icons/rc/Hsepartoolbar.png); 588 | } 589 | QToolBar::separator:vertical { 590 | image: url(:/qss_icons/rc/Vsepartoolbar.png); 591 | } 592 | QToolButton#qt_toolbar_ext_button { 593 | background: #58595a 594 | } 595 | 596 | QPushButton 597 | { 598 | color: #eff0f1; 599 | background-color: #323232; 600 | border-width: 1px; 601 | border-color: #76797C; 602 | border-style: solid; 603 | padding: 5px; 604 | border-radius: 0px; 605 | outline: none; 606 | } 607 | 608 | QPushButton:disabled 609 | { 610 | background-color: #323232; 611 | border-width: 1px; 612 | border-color: #454545; 613 | border-style: solid; 614 | padding-top: 5px; 615 | padding-bottom: 5px; 616 | padding-left: 10px; 617 | padding-right: 10px; 618 | border-radius: 2px; 619 | color: #454545; 620 | } 621 | 622 | QPushButton:focus { 623 | background-color: #D1DBCB; 624 | color: black; 625 | } 626 | 627 | QPushButton:pressed 628 | { 629 | color: black; 630 | background-color: #D1DBCB; 631 | padding-top: -15px; 632 | padding-bottom: -17px; 633 | } 634 | 635 | QComboBox 636 | { 637 | selection-background-color: #D1DBCB; 638 | background-color: #31363B; 639 | border-style: solid; 640 | border: 1px solid #76797C; 641 | border-radius: 2px; 642 | padding: 5px; 643 | min-width: 75px; 644 | } 645 | 646 | QPushButton:checked{ 647 | background-color: #76797C; 648 | border-color: #6A6969; 649 | } 650 | 651 | QComboBox:hover,QPushButton:hover,QAbstractSpinBox:hover,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QAbstractView:hover,QTreeView:hover 652 | { 653 | border: 1px solid #D1DBCB; 654 | } 655 | 656 | QComboBox:on 657 | { 658 | padding-top: 0px; 659 | padding-left: 4px; 660 | selection-background-color: #4a4a4a; 661 | } 662 | 663 | QComboBox QAbstractItemView 664 | { 665 | background-color: #1e1e1e; 666 | border-radius: 2px; 667 | border: 1px solid #76797C; 668 | selection-background-color: #D1DBCB; 669 | } 670 | 671 | QComboBox::drop-down 672 | { 673 | subcontrol-origin: padding; 674 | subcontrol-position: top right; 675 | width: 15px; 676 | 677 | border-left-width: 0px; 678 | border-left-color: darkgray; 679 | border-left-style: solid; 680 | border-top-right-radius: 3px; 681 | border-bottom-right-radius: 3px; 682 | } 683 | 684 | QComboBox::down-arrow 685 | { 686 | image: url(:/qss_icons/rc/down_arrow_disabled.png); 687 | } 688 | 689 | QComboBox::down-arrow:on, QComboBox::down-arrow:hover, 690 | QComboBox::down-arrow:focus 691 | { 692 | image: url(:/qss_icons/rc/down_arrow.png); 693 | } 694 | 695 | QAbstractSpinBox { 696 | padding: 2px; 697 | margin: 2px; 698 | background-color: #1e1e1e; 699 | color: #eff0f1; 700 | border-radius: 0px; 701 | min-width: 75px; 702 | selection-background-color: #D1DBCB; 703 | selection-color: black; 704 | } 705 | 706 | QAbstractSpinBox:up-button 707 | { 708 | background-color: transparent; 709 | subcontrol-origin: border; 710 | subcontrol-position: center right; 711 | } 712 | 713 | QAbstractSpinBox:down-button 714 | { 715 | background-color: transparent; 716 | subcontrol-origin: border; 717 | subcontrol-position: center left; 718 | } 719 | 720 | QAbstractSpinBox::up-arrow,QAbstractSpinBox::up-arrow:disabled,QAbstractSpinBox::up-arrow:off { 721 | image: url(:/qss_icons/rc/up_arrow_disabled.png); 722 | width: 10px; 723 | height: 10px; 724 | } 725 | QAbstractSpinBox::up-arrow:hover 726 | { 727 | image: url(:/qss_icons/rc/up_arrow.png); 728 | } 729 | 730 | 731 | QAbstractSpinBox::down-arrow,QAbstractSpinBox::down-arrow:disabled,QAbstractSpinBox::down-arrow:off 732 | { 733 | image: url(:/qss_icons/rc/down_arrow_disabled.png); 734 | width: 10px; 735 | height: 10px; 736 | } 737 | QAbstractSpinBox::down-arrow:hover 738 | { 739 | image: url(:/qss_icons/rc/down_arrow.png); 740 | } 741 | 742 | 743 | QLabel 744 | { 745 | border: 0px solid black; 746 | margin-left: 2px; 747 | margin-right: 2px; 748 | color: #D1DBCB; 749 | } 750 | 751 | QTabWidget{ 752 | border: 0px transparent black; 753 | } 754 | 755 | QTabWidget::pane { 756 | border: 1px solid #76797C; 757 | padding: 5px; 758 | margin: 0px; 759 | } 760 | 761 | QTabWidget::tab-bar { 762 | left: 5px; /* move to the right by 5px */ 763 | } 764 | 765 | QTabBar 766 | { 767 | qproperty-drawBase: 0; 768 | border-radius: 3px; 769 | } 770 | 771 | QTabBar::focus 772 | { 773 | border: 0px transparent black; 774 | color: black; 775 | } 776 | 777 | QTabBar::hover 778 | { 779 | border: 0px transparent black; 780 | color: black; 781 | } 782 | 783 | QTabBar::close-button { 784 | image: url(:/qss_icons/rc/close.png); 785 | background: transparent; 786 | } 787 | 788 | QTabBar::close-button:hover 789 | { 790 | image: url(:/qss_icons/rc/close-hover.png); 791 | background: transparent; 792 | } 793 | 794 | QTabBar::close-button:pressed { 795 | image: url(:/qss_icons/rc/close-pressed.png); 796 | background: transparent; 797 | } 798 | 799 | /* TOP TABS */ 800 | QTabBar::tab:top { 801 | color: #eff0f1; 802 | border: 1px solid #76797C; 803 | border-bottom: 1px transparent black; 804 | background-color: #323232; 805 | padding: 5px; 806 | min-width: 50px; 807 | border-top-left-radius: 2px; 808 | border-top-right-radius: 2px; 809 | } 810 | 811 | QTabBar::tab:top:!selected 812 | { 813 | color: #eff0f1; 814 | background-color: #54575B; 815 | border: 1px solid #76797C; 816 | border-bottom: 1px transparent black; 817 | border-top-left-radius: 2px; 818 | border-top-right-radius: 2px; 819 | } 820 | 821 | QTabBar::tab:top:!selected:hover { 822 | background-color: #D1DBCB; 823 | color: black; 824 | } 825 | 826 | /* BOTTOM TABS */ 827 | QTabBar::tab:bottom { 828 | color: #eff0f1; 829 | border: 1px solid #76797C; 830 | border-top: 1px transparent black; 831 | background-color: #323232; 832 | padding: 5px; 833 | border-bottom-left-radius: 2px; 834 | border-bottom-right-radius: 2px; 835 | min-width: 50px; 836 | } 837 | 838 | QTabBar::tab:bottom:!selected 839 | { 840 | color: #eff0f1; 841 | background-color: #54575B; 842 | border: 1px solid #76797C; 843 | border-top: 1px transparent black; 844 | border-bottom-left-radius: 2px; 845 | border-bottom-right-radius: 2px; 846 | } 847 | 848 | QTabBar::tab:bottom:!selected:hover { 849 | background-color: #D1DBCB; 850 | color: black; 851 | } 852 | 853 | /* LEFT TABS */ 854 | QTabBar::tab:left { 855 | color: #eff0f1; 856 | border: 1px solid #76797C; 857 | border-left: 1px transparent black; 858 | background-color: #323232; 859 | padding: 5px; 860 | border-top-right-radius: 2px; 861 | border-bottom-right-radius: 2px; 862 | min-height: 50px; 863 | } 864 | 865 | QTabBar::tab:left:!selected 866 | { 867 | color: #eff0f1; 868 | background-color: #54575B; 869 | border: 1px solid #76797C; 870 | border-left: 1px transparent black; 871 | border-top-right-radius: 2px; 872 | border-bottom-right-radius: 2px; 873 | } 874 | 875 | QTabBar::tab:left:!selected:hover { 876 | background-color: #D1DBCB; 877 | color: black; 878 | } 879 | 880 | 881 | /* RIGHT TABS */ 882 | QTabBar::tab:right { 883 | color: #eff0f1; 884 | border: 1px solid #76797C; 885 | border-right: 1px transparent black; 886 | background-color: #323232; 887 | padding: 5px; 888 | border-top-left-radius: 2px; 889 | border-bottom-left-radius: 2px; 890 | min-height: 50px; 891 | } 892 | 893 | QTabBar::tab:right:!selected 894 | { 895 | color: #eff0f1; 896 | background-color: #54575B; 897 | border: 1px solid #76797C; 898 | border-right: 1px transparent black; 899 | border-top-left-radius: 2px; 900 | border-bottom-left-radius: 2px; 901 | } 902 | 903 | QTabBar::tab:right:!selected:hover { 904 | background-color: #D1DBCB; 905 | color: black; 906 | } 907 | 908 | QTabBar QToolButton::right-arrow:enabled { 909 | image: url(:/qss_icons/rc/right_arrow.png); 910 | } 911 | 912 | QTabBar QToolButton::left-arrow:enabled { 913 | image: url(:/qss_icons/rc/left_arrow.png); 914 | } 915 | 916 | QTabBar QToolButton::right-arrow:disabled { 917 | image: url(:/qss_icons/rc/right_arrow_disabled.png); 918 | } 919 | 920 | QTabBar QToolButton::left-arrow:disabled { 921 | image: url(:/qss_icons/rc/left_arrow_disabled.png); 922 | } 923 | 924 | 925 | QDockWidget { 926 | background: #323232; 927 | border: 1px solid #403F3F; 928 | titlebar-close-icon: url(:/qss_icons/rc/close.png); 929 | titlebar-normal-icon: url(:/qss_icons/rc/undock.png); 930 | } 931 | 932 | QDockWidget::close-button, QDockWidget::float-button { 933 | border: 1px solid transparent; 934 | border-radius: 2px; 935 | background: transparent; 936 | } 937 | 938 | QDockWidget::close-button:hover, QDockWidget::float-button:hover { 939 | background: rgba(255, 255, 255, 10); 940 | } 941 | 942 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed { 943 | padding: 1px -1px -1px 1px; 944 | background: rgba(255, 255, 255, 10); 945 | } 946 | 947 | QTreeView, QListView 948 | { 949 | border: 1px solid #76797C; 950 | background-color: #1e1e1e; 951 | } 952 | 953 | QTreeView:branch:selected, QTreeView:branch:hover 954 | { 955 | background: url(:/qss_icons/rc/transparent.png); 956 | } 957 | 958 | QTreeView::branch:has-siblings:!adjoins-item { 959 | border-image: url(:/qss_icons/rc/transparent.png); 960 | } 961 | 962 | QTreeView::branch:has-siblings:adjoins-item { 963 | border-image: url(:/qss_icons/rc/transparent.png); 964 | } 965 | 966 | QTreeView::branch:!has-children:!has-siblings:adjoins-item { 967 | border-image: url(:/qss_icons/rc/transparent.png); 968 | } 969 | 970 | QTreeView::branch:has-children:!has-siblings:closed, 971 | QTreeView::branch:closed:has-children:has-siblings { 972 | image: url(:/qss_icons/rc/branch_closed.png); 973 | } 974 | 975 | QTreeView::branch:open:has-children:!has-siblings, 976 | QTreeView::branch:open:has-children:has-siblings { 977 | image: url(:/qss_icons/rc/branch_open.png); 978 | } 979 | 980 | QTreeView::branch:has-children:!has-siblings:closed:hover, 981 | QTreeView::branch:closed:has-children:has-siblings:hover { 982 | image: url(:/qss_icons/rc/branch_closed-on.png); 983 | } 984 | 985 | QTreeView::branch:open:has-children:!has-siblings:hover, 986 | QTreeView::branch:open:has-children:has-siblings:hover { 987 | image: url(:/qss_icons/rc/branch_open-on.png); 988 | } 989 | 990 | QListView::item:!selected:hover, QTreeView::item:!selected:hover { 991 | background: #848383; 992 | outline: 0; 993 | color: #eff0f1; 994 | } 995 | 996 | QListView::item:selected:hover, QTreeView::item:selected:hover { 997 | background: #D1DBCB; 998 | } 999 | 1000 | QSlider::groove:horizontal { 1001 | border: 1px solid #565a5e; 1002 | height: 4px; 1003 | background: #565a5e; 1004 | margin: 0px; 1005 | border-radius: 2px; 1006 | } 1007 | 1008 | QSlider::handle:horizontal { 1009 | background: #D1DBCB; 1010 | border: 1px solid #999999; 1011 | width: 10px; 1012 | height: 10px; 1013 | margin: -5px 0; 1014 | } 1015 | 1016 | QSlider::add-page:qlineargradient { 1017 | background: #595858; 1018 | border-top-right-radius: 5px; 1019 | border-bottom-right-radius: 5px; 1020 | border-top-left-radius: 0px; 1021 | border-bottom-left-radius: 0px; 1022 | } 1023 | 1024 | QSlider::sub-page::qlineargradient:horizontal { 1025 | background: #D1DBCB; 1026 | border-top-right-radius: 0px; 1027 | border-bottom-right-radius: 0px; 1028 | border-top-left-radius: 5px; 1029 | border-bottom-left-radius: 5px; 1030 | } 1031 | 1032 | QSlider::groove:vertical { 1033 | border: 1px solid #565a5e; 1034 | width: 4px; 1035 | background: #565a5e; 1036 | margin: 0px; 1037 | border-radius: 3px; 1038 | } 1039 | 1040 | QSlider::handle:vertical { 1041 | background: #D1DBCB; 1042 | border: 1px solid #999999; 1043 | width: 10px; 1044 | height: 10px; 1045 | margin: 0 -5px; 1046 | } 1047 | 1048 | QToolButton { 1049 | color: #D1DBCB; 1050 | background-color: transparent; 1051 | border: 0px transparent #76797C; 1052 | border-radius: 0px; 1053 | padding: 1px; 1054 | margin-right: 5px; 1055 | } 1056 | 1057 | QToolButton[popupMode="1"] { /* only for MenuButtonPopup */ 1058 | padding-right: 20px; /* make way for the popup button */ 1059 | border: 1px #76797C; 1060 | border-radius: 0px; 1061 | } 1062 | 1063 | QToolButton[popupMode="2"] { /* only for InstantPopup */ 1064 | padding-right: 10px; /* make way for the popup button */ 1065 | border: 0px #76797C; 1066 | } 1067 | 1068 | 1069 | QToolButton:hover, QToolButton::menu-button:hover { 1070 | background-color: transparent; 1071 | border: 1px solid #D1DBCB; 1072 | padding: 2px; 1073 | } 1074 | 1075 | QToolButton:checked, QToolButton:pressed, 1076 | QToolButton::menu-button:pressed { 1077 | color: black; 1078 | background-color: #D1DBCB; 1079 | border: 0px solid #D1DBCB; 1080 | padding: 2px; 1081 | } 1082 | 1083 | /* the subcontrol below is used only in the InstantPopup or DelayedPopup mode */ 1084 | QToolButton::menu-indicator { 1085 | image: url(:/qss_icons/rc/down_arrow.png); 1086 | top: -7px; left: -2px; /* shift it a bit */ 1087 | } 1088 | 1089 | /* the subcontrols below are used only in the MenuButtonPopup mode */ 1090 | QToolButton::menu-button { 1091 | border: 1px transparent #76797C; 1092 | border-top-right-radius: 6px; 1093 | border-bottom-right-radius: 6px; 1094 | /* 16px width + 4px for border = 20px allocated above */ 1095 | width: 16px; 1096 | outline: none; 1097 | } 1098 | 1099 | QToolButton::menu-arrow { 1100 | image: url(:/qss_icons/rc/down_arrow.png); 1101 | } 1102 | 1103 | QToolButton::menu-arrow:open { 1104 | border: 1px solid #76797C; 1105 | } 1106 | 1107 | QPushButton::menu-indicator { 1108 | subcontrol-origin: padding; 1109 | subcontrol-position: bottom right; 1110 | left: 8px; 1111 | } 1112 | 1113 | QTableView 1114 | { 1115 | border: 1px solid #76797C; 1116 | gridline-color: #323232; 1117 | background-color: #1e1e1e; 1118 | } 1119 | 1120 | 1121 | QTableView, QHeaderView 1122 | { 1123 | border-radius: 0px; 1124 | } 1125 | 1126 | QTableView::item:pressed, QListView::item:pressed, QTreeView::item:pressed { 1127 | background: #D1DBCB; 1128 | color: black; 1129 | } 1130 | 1131 | QTableView::item:selected:active, QTreeView::item:selected:active, QListView::item:selected:active { 1132 | background: #D1DBCB; 1133 | color: black; 1134 | } 1135 | 1136 | QHeaderView 1137 | { 1138 | background-color: #323232; 1139 | border: 1px transparent; 1140 | border-radius: 0px; 1141 | margin: 0px; 1142 | padding: 0px; 1143 | 1144 | } 1145 | 1146 | QHeaderView::section { 1147 | background-color: #323232; 1148 | color: #eff0f1; 1149 | padding: 5px; 1150 | border: 1px solid #76797C; 1151 | border-radius: 0px; 1152 | text-align: center; 1153 | } 1154 | 1155 | QHeaderView::section::vertical::first, QHeaderView::section::vertical::only-one 1156 | { 1157 | border-top: 1px solid #76797C; 1158 | } 1159 | 1160 | QHeaderView::section::vertical 1161 | { 1162 | border-top: transparent; 1163 | } 1164 | 1165 | QHeaderView::section::horizontal::first, QHeaderView::section::horizontal::only-one 1166 | { 1167 | border-left: 1px solid #76797C; 1168 | } 1169 | 1170 | QHeaderView::section::horizontal 1171 | { 1172 | border-left: transparent; 1173 | } 1174 | 1175 | 1176 | QHeaderView::section:checked 1177 | { 1178 | color: white; 1179 | background-color: #848383; 1180 | } 1181 | 1182 | /* style the sort indicator */ 1183 | QHeaderView::down-arrow { 1184 | image: url(:/qss_icons/rc/down_arrow.png); 1185 | } 1186 | 1187 | QHeaderView::up-arrow { 1188 | image: url(:/qss_icons/rc/up_arrow.png); 1189 | } 1190 | 1191 | 1192 | QTableCornerButton::section { 1193 | background-color: #323232; 1194 | border: 1px transparent #76797C; 1195 | border-radius: 0px; 1196 | } 1197 | 1198 | QToolBox { 1199 | padding: 5px; 1200 | border: 1px transparent black; 1201 | } 1202 | 1203 | QToolBox::tab { 1204 | color: #eff0f1; 1205 | background-color: #323232; 1206 | border: 1px solid #76797C; 1207 | border-bottom: 1px transparent #323232; 1208 | border-top-left-radius: 5px; 1209 | border-top-right-radius: 5px; 1210 | } 1211 | 1212 | QToolBox::tab:selected { /* italicize selected tabs */ 1213 | font: italic; 1214 | background-color: #323232; 1215 | border-color: #D1DBCB; 1216 | } 1217 | 1218 | QStatusBar::item { 1219 | border: 0px transparent dark; 1220 | margin: 0px; 1221 | border: 0px; 1222 | } 1223 | 1224 | 1225 | QFrame[height="3"], QFrame[width="3"] { 1226 | background-color: #76797C; 1227 | } 1228 | 1229 | 1230 | QSplitter::handle { 1231 | border: 1px dashed #76797C; 1232 | } 1233 | 1234 | QSplitter::handle:hover { 1235 | background-color: #787876; 1236 | border: 1px solid #76797C; 1237 | } 1238 | 1239 | QSplitter::handle:horizontal { 1240 | width: 1px; 1241 | } 1242 | 1243 | QSplitter::handle:vertical { 1244 | height: 1px; 1245 | } 1246 | 1247 | QProgressBar { 1248 | border: 1px solid #76797C; 1249 | border-radius: 5px; 1250 | text-align: center; 1251 | } 1252 | 1253 | QProgressBar::chunk { 1254 | background-color: #D1DBCB; 1255 | } 1256 | 1257 | QDateEdit 1258 | { 1259 | selection-background-color: #D1DBCB; 1260 | border-style: solid; 1261 | border: 1px solid #CEE343; 1262 | border-radius: 2px; 1263 | padding: 1px; 1264 | min-width: 75px; 1265 | } 1266 | 1267 | QDateEdit:on 1268 | { 1269 | padding-top: 3px; 1270 | padding-left: 4px; 1271 | selection-background-color: #4a4a4a; 1272 | } 1273 | 1274 | QDateEdit QAbstractItemView 1275 | { 1276 | background-color: #1e1e1e; 1277 | border-radius: 2px; 1278 | border: 1px solid #3375A3; 1279 | selection-background-color: #D1DBCB; 1280 | } 1281 | 1282 | QDateEdit::drop-down 1283 | { 1284 | subcontrol-origin: padding; 1285 | subcontrol-position: top right; 1286 | width: 15px; 1287 | border-left-width: 0px; 1288 | border-left-color: darkgray; 1289 | border-left-style: solid; 1290 | border-top-right-radius: 3px; 1291 | border-bottom-right-radius: 3px; 1292 | } 1293 | 1294 | QDateEdit::down-arrow 1295 | { 1296 | image: url(:/qss_icons/rc/down_arrow_disabled.png); 1297 | } 1298 | 1299 | QDateEdit::down-arrow:on, QDateEdit::down-arrow:hover, 1300 | QDateEdit::down-arrow:focus 1301 | { 1302 | image: url(:/qss_icons/rc/down_arrow.png); 1303 | } 1304 | 1305 | -------------------------------------------------------------------------------- /LIBRARY MANAGEMENT SYSTEM/themes/darkorange.css: -------------------------------------------------------------------------------- 1 | QToolTip 2 | { 3 | border: 1px solid black; 4 | background-color: #ffa02f; 5 | padding: 1px; 6 | border-radius: 3px; 7 | opacity: 100; 8 | } 9 | 10 | QWidget 11 | { 12 | color: #b1b1b1; 13 | background-color: #323232; 14 | } 15 | 16 | QTreeView, QListView 17 | { 18 | background-color: silver; 19 | margin-left: 5px; 20 | } 21 | 22 | QWidget:item:hover 23 | { 24 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #ca0619); 25 | color: #000000; 26 | } 27 | 28 | QWidget:item:selected 29 | { 30 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 31 | } 32 | 33 | QMenuBar::item 34 | { 35 | background: transparent; 36 | } 37 | 38 | QMenuBar::item:selected 39 | { 40 | background: transparent; 41 | border: 1px solid #ffaa00; 42 | } 43 | 44 | QMenuBar::item:pressed 45 | { 46 | background: #444; 47 | border: 1px solid #000; 48 | background-color: QLinearGradient( 49 | x1:0, y1:0, 50 | x2:0, y2:1, 51 | stop:1 #212121, 52 | stop:0.4 #343434/*, 53 | stop:0.2 #343434, 54 | stop:0.1 #ffaa00*/ 55 | ); 56 | margin-bottom:-1px; 57 | padding-bottom:1px; 58 | } 59 | 60 | QMenu 61 | { 62 | border: 1px solid #000; 63 | } 64 | 65 | QMenu::item 66 | { 67 | padding: 2px 20px 2px 20px; 68 | } 69 | 70 | QMenu::item:selected 71 | { 72 | color: #000000; 73 | } 74 | 75 | QWidget:disabled 76 | { 77 | color: #808080; 78 | background-color: #323232; 79 | } 80 | 81 | QAbstractItemView 82 | { 83 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0.1 #646464, stop: 1 #5d5d5d); 84 | } 85 | 86 | QWidget:focus 87 | { 88 | /*border: 1px solid darkgray;*/ 89 | } 90 | 91 | QLineEdit 92 | { 93 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0 #646464, stop: 1 #5d5d5d); 94 | padding: 1px; 95 | border-style: solid; 96 | border: 1px solid #1e1e1e; 97 | border-radius: 5; 98 | } 99 | 100 | QPushButton 101 | { 102 | color: #b1b1b1; 103 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 104 | border-width: 1px; 105 | border-color: #1e1e1e; 106 | border-style: solid; 107 | border-radius: 6; 108 | padding: 3px; 109 | font-size: 12px; 110 | padding-left: 5px; 111 | padding-right: 5px; 112 | min-width: 40px; 113 | } 114 | 115 | QPushButton:pressed 116 | { 117 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 118 | } 119 | 120 | QComboBox 121 | { 122 | selection-background-color: #ffaa00; 123 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 124 | border-style: solid; 125 | border: 1px solid #1e1e1e; 126 | border-radius: 5; 127 | } 128 | 129 | QComboBox:hover,QPushButton:hover 130 | { 131 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 132 | } 133 | 134 | 135 | QComboBox:on 136 | { 137 | padding-top: 3px; 138 | padding-left: 4px; 139 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 140 | selection-background-color: #ffaa00; 141 | } 142 | 143 | QComboBox QAbstractItemView 144 | { 145 | border: 2px solid darkgray; 146 | selection-background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 147 | } 148 | 149 | QComboBox::drop-down 150 | { 151 | subcontrol-origin: padding; 152 | subcontrol-position: top right; 153 | width: 15px; 154 | 155 | border-left-width: 0px; 156 | border-left-color: darkgray; 157 | border-left-style: solid; /* just a single line */ 158 | border-top-right-radius: 3px; /* same radius as the QComboBox */ 159 | border-bottom-right-radius: 3px; 160 | } 161 | 162 | QComboBox::down-arrow 163 | { 164 | image: url(:/dark_orange/img/down_arrow.png); 165 | } 166 | 167 | QGroupBox 168 | { 169 | border: 1px solid darkgray; 170 | margin-top: 10px; 171 | } 172 | 173 | QGroupBox:focus 174 | { 175 | border: 1px solid darkgray; 176 | } 177 | 178 | QTextEdit:focus 179 | { 180 | border: 1px solid darkgray; 181 | } 182 | 183 | QScrollBar:horizontal { 184 | border: 1px solid #222222; 185 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 186 | height: 7px; 187 | margin: 0px 16px 0 16px; 188 | } 189 | 190 | QScrollBar::handle:horizontal 191 | { 192 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 193 | min-height: 20px; 194 | border-radius: 2px; 195 | } 196 | 197 | QScrollBar::add-line:horizontal { 198 | border: 1px solid #1b1b19; 199 | border-radius: 2px; 200 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 201 | width: 14px; 202 | subcontrol-position: right; 203 | subcontrol-origin: margin; 204 | } 205 | 206 | QScrollBar::sub-line:horizontal { 207 | border: 1px solid #1b1b19; 208 | border-radius: 2px; 209 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 210 | width: 14px; 211 | subcontrol-position: left; 212 | subcontrol-origin: margin; 213 | } 214 | 215 | QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal 216 | { 217 | border: 1px solid black; 218 | width: 1px; 219 | height: 1px; 220 | background: white; 221 | } 222 | 223 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 224 | { 225 | background: none; 226 | } 227 | 228 | QScrollBar:vertical 229 | { 230 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 231 | width: 7px; 232 | margin: 16px 0 16px 0; 233 | border: 1px solid #222222; 234 | } 235 | 236 | QScrollBar::handle:vertical 237 | { 238 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 239 | min-height: 20px; 240 | border-radius: 2px; 241 | } 242 | 243 | QScrollBar::add-line:vertical 244 | { 245 | border: 1px solid #1b1b19; 246 | border-radius: 2px; 247 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 248 | height: 14px; 249 | subcontrol-position: bottom; 250 | subcontrol-origin: margin; 251 | } 252 | 253 | QScrollBar::sub-line:vertical 254 | { 255 | border: 1px solid #1b1b19; 256 | border-radius: 2px; 257 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d7801a, stop: 1 #ffa02f); 258 | height: 14px; 259 | subcontrol-position: top; 260 | subcontrol-origin: margin; 261 | } 262 | 263 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 264 | { 265 | border: 1px solid black; 266 | width: 1px; 267 | height: 1px; 268 | background: white; 269 | } 270 | 271 | 272 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 273 | { 274 | background: none; 275 | } 276 | 277 | QTextEdit 278 | { 279 | background-color: #242424; 280 | } 281 | 282 | QPlainTextEdit 283 | { 284 | background-color: #242424; 285 | } 286 | 287 | QHeaderView::section 288 | { 289 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565); 290 | color: white; 291 | padding-left: 4px; 292 | border: 1px solid #6c6c6c; 293 | } 294 | 295 | QCheckBox:disabled 296 | { 297 | color: #414141; 298 | } 299 | 300 | QDockWidget::title 301 | { 302 | text-align: center; 303 | spacing: 3px; /* spacing between items in the tool bar */ 304 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 305 | } 306 | 307 | QDockWidget::close-button, QDockWidget::float-button 308 | { 309 | text-align: center; 310 | spacing: 1px; /* spacing between items in the tool bar */ 311 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 312 | } 313 | 314 | QDockWidget::close-button:hover, QDockWidget::float-button:hover 315 | { 316 | background: #242424; 317 | } 318 | 319 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed 320 | { 321 | padding: 1px -1px -1px 1px; 322 | } 323 | 324 | QMainWindow::separator 325 | { 326 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 327 | color: white; 328 | padding-left: 4px; 329 | border: 1px solid #4c4c4c; 330 | spacing: 3px; /* spacing between items in the tool bar */ 331 | } 332 | 333 | QMainWindow::separator:hover 334 | { 335 | 336 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f); 337 | color: white; 338 | padding-left: 4px; 339 | border: 1px solid #6c6c6c; 340 | spacing: 3px; /* spacing between items in the tool bar */ 341 | } 342 | 343 | QToolBar::handle 344 | { 345 | spacing: 3px; /* spacing between items in the tool bar */ 346 | background: url(:/dark_orange/img/handle.png); 347 | } 348 | 349 | QMenu::separator 350 | { 351 | height: 2px; 352 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 353 | color: white; 354 | padding-left: 4px; 355 | margin-left: 10px; 356 | margin-right: 5px; 357 | } 358 | 359 | QProgressBar 360 | { 361 | border: 2px solid grey; 362 | border-radius: 5px; 363 | text-align: center; 364 | } 365 | 366 | QProgressBar::chunk 367 | { 368 | background-color: #d7801a; 369 | width: 2.15px; 370 | margin: 0.5px; 371 | } 372 | 373 | QTabBar::tab { 374 | color: #b1b1b1; 375 | border: 1px solid #444; 376 | border-bottom-style: none; 377 | background-color: #323232; 378 | padding-left: 10px; 379 | padding-right: 10px; 380 | padding-top: 3px; 381 | padding-bottom: 2px; 382 | margin-right: -1px; 383 | } 384 | 385 | QTabWidget::pane { 386 | border: 1px solid #444; 387 | top: 1px; 388 | } 389 | 390 | QTabBar::tab:last 391 | { 392 | margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ 393 | border-top-right-radius: 3px; 394 | } 395 | 396 | QTabBar::tab:first:!selected 397 | { 398 | margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */ 399 | 400 | 401 | border-top-left-radius: 3px; 402 | } 403 | 404 | QTabBar::tab:!selected 405 | { 406 | color: #b1b1b1; 407 | border-bottom-style: solid; 408 | margin-top: 3px; 409 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:.4 #343434); 410 | } 411 | 412 | QTabBar::tab:selected 413 | { 414 | border-top-left-radius: 3px; 415 | border-top-right-radius: 3px; 416 | margin-bottom: 0px; 417 | } 418 | 419 | QTabBar::tab:!selected:hover 420 | { 421 | /*border-top: 2px solid #ffaa00; 422 | padding-bottom: 3px;*/ 423 | border-top-left-radius: 3px; 424 | border-top-right-radius: 3px; 425 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:0.4 #343434, stop:0.2 #343434, stop:0.1 #ffaa00); 426 | } 427 | 428 | QRadioButton::indicator:checked, QRadioButton::indicator:unchecked{ 429 | color: #b1b1b1; 430 | background-color: #323232; 431 | border: 1px solid #b1b1b1; 432 | border-radius: 6px; 433 | } 434 | 435 | QRadioButton::indicator:checked 436 | { 437 | background-color: qradialgradient( 438 | cx: 0.5, cy: 0.5, 439 | fx: 0.5, fy: 0.5, 440 | radius: 1.0, 441 | stop: 0.25 #ffaa00, 442 | stop: 0.3 #323232 443 | ); 444 | } 445 | 446 | QCheckBox::indicator{ 447 | color: #b1b1b1; 448 | background-color: #323232; 449 | border: 1px solid #b1b1b1; 450 | width: 9px; 451 | height: 9px; 452 | } 453 | 454 | QRadioButton::indicator 455 | { 456 | border-radius: 6px; 457 | } 458 | 459 | QRadioButton::indicator:hover, QCheckBox::indicator:hover 460 | { 461 | border: 1px solid #ffaa00; 462 | } 463 | 464 | QCheckBox::indicator:checked 465 | { 466 | image:url(:/dark_orange/img/checkbox.png); 467 | } 468 | 469 | QCheckBox::indicator:disabled, QRadioButton::indicator:disabled 470 | { 471 | border: 1px solid #444; 472 | } 473 | 474 | 475 | QSlider::groove:horizontal { 476 | border: 1px solid #3A3939; 477 | height: 8px; 478 | background: #201F1F; 479 | margin: 2px 0; 480 | border-radius: 2px; 481 | } 482 | 483 | QSlider::handle:horizontal { 484 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, 485 | stop: 0.0 silver, stop: 0.2 #a8a8a8, stop: 1 #727272); 486 | border: 1px solid #3A3939; 487 | width: 14px; 488 | height: 14px; 489 | margin: -4px 0; 490 | border-radius: 2px; 491 | } 492 | 493 | QSlider::groove:vertical { 494 | border: 1px solid #3A3939; 495 | width: 8px; 496 | background: #201F1F; 497 | margin: 0 0px; 498 | border-radius: 2px; 499 | } 500 | 501 | QSlider::handle:vertical { 502 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 silver, 503 | stop: 0.2 #a8a8a8, stop: 1 #727272); 504 | border: 1px solid #3A3939; 505 | width: 14px; 506 | height: 14px; 507 | margin: 0 -4px; 508 | border-radius: 2px; 509 | } 510 | 511 | QAbstractSpinBox { 512 | padding-top: 2px; 513 | padding-bottom: 2px; 514 | border: 1px solid darkgray; 515 | 516 | border-radius: 2px; 517 | min-width: 50px; 518 | } 519 | 520 | 521 | -------------------------------------------------------------------------------- /Msp-Certificate-Generator/c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /PDF Converter/PDF Converter.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | import tkinter, tkinter.constants, tkinter.filedialog 3 | import tkinter.filedialog as filedialog 4 | from tkinter import messagebox 5 | import tkinter as tk 6 | import tkinter.ttk as ttk 7 | import random 8 | from PyPDF2 import PdfFileWriter, PdfFileReader 9 | import PyPDF2 10 | import img2pdf 11 | from PIL import Image 12 | import os 13 | 14 | 15 | def pdfconvert(pdf_path,img_path): 16 | image = Image.open(img_path) 17 | pdf_bytes = img2pdf.convert(image.filename) 18 | file = open(pdf_path, "wb") 19 | file.write(pdf_bytes) 20 | image.close() 21 | file.close() 22 | 23 | 24 | #pdf get file functionof btn 25 | def get_img_func(): 26 | root.img_file_name = tkinter.filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("JPG files","*.JPG"),("PNG files","*.PNG"),("all files","*.*"))) 27 | tempname1 = (root.img_file_name).split('/')[-1] 28 | get_file_button.config(text = tempname1,state="disabled") 29 | return root.img_file_name 30 | 31 | def convert(): 32 | print((root.img_file_name)) 33 | root.location = tkinter.filedialog.asksaveasfilename(initialdir = "/",title = "Select file",filetypes = (("PDF files","*.PDF"),("all files","*.*"))) 34 | root.location=root.location+'.pdf' 35 | 36 | tempname=root.location.split('/')[-1] 37 | convert_button.config(text = tempname,state="disabled") 38 | print(tempname) 39 | loc=str(root.location) 40 | name=str(root.img_file_name) 41 | print(loc) 42 | print(name) 43 | pdfconvert(loc,name) 44 | messagebox.showinfo('Message', 'Your PDF file '+tempname+' is Saved Successfully') 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | def splitpdf(inpdf,outpdf,name): 53 | inputpdf = PdfFileReader(open(inpdf, "rb")) 54 | for i in range(inputpdf.numPages): 55 | output = PdfFileWriter() 56 | output.addPage(inputpdf.getPage(i)) 57 | with open(outpdf+"/"+name+" page %s.pdf"%(i+1), "wb") as outputStream: 58 | output.write(outputStream) 59 | 60 | def get_Split_file_func(): 61 | root.get_split_filename = tkinter.filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("PDF files","*.PDF"),("all files","*.*"))) 62 | tempname1 = (root.get_split_filename).split('/')[-1] 63 | split_file_get_button.config(text = tempname1,state="disabled") 64 | return root.get_split_filename 65 | 66 | def split(): 67 | print((root.get_split_filename)) 68 | root.location = filedialog.askdirectory() 69 | print((root.location)) 70 | 71 | tempname=os.path.splitext(os.path.basename(root.get_split_filename))[0] 72 | os.chdir(root.location) 73 | try: 74 | os.mkdir(tempname) 75 | except: 76 | pass 77 | spit_main_button.config(text = tempname,state="disabled") 78 | root.location=root.location+'/'+tempname 79 | print(tempname) 80 | splitpdf(root.get_split_filename,root.location,tempname) 81 | t = (root.get_split_filename).split('/')[-1] 82 | messagebox.showinfo('Message', 'Your PDF file '+t+' is Splited Successfully') 83 | 84 | 85 | 86 | 87 | 88 | 89 | def PDFmerge(pdfs, output): 90 | # creating pdf file merger object 91 | pdfMerger = PyPDF2.PdfFileMerger() 92 | for pdf in pdfs: 93 | with open(pdf, 'rb') as f: 94 | pdfMerger.append(f) 95 | with open(output, 'wb') as f: 96 | pdfMerger.write(f) 97 | 98 | 99 | def get_first_pdf_fn(): 100 | root.first_pdf_file = tkinter.filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("PDF files","*.PDF"),("all files","*.*"))) 101 | tempname1 = (root.first_pdf_file).split('/')[-1] 102 | get_first_pdf_btn.config(text = tempname1,state="disabled") 103 | return root.first_pdf_file 104 | def get_second_pdf_fn(): 105 | root.second_pdf_file = tkinter.filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("PDF files","*.PDF"),("all files","*.*"))) 106 | tempname2 = (root.second_pdf_file).split('/')[-1] 107 | get_second_pdf_btn.config(text = tempname2,state="disabled") 108 | return root.second_pdf_file 109 | 110 | def merge(): 111 | pdfs = [root.first_pdf_file, root.second_pdf_file] 112 | print((root.first_pdf_file)) 113 | print(('\n'+root.second_pdf_file)) 114 | root.filename = tkinter.filedialog.asksaveasfilename(initialdir = "/",title = "Select file",filetypes = (("PDF files","*.PDF"),("all files","*.*"))) 115 | print((root.filename)) 116 | root.filename=root.filename+'.pdf' 117 | tempname=root.filename.split('/')[-1] 118 | merge_button.config(text = tempname,state="disabled") 119 | print(tempname) 120 | PDFmerge(pdfs = pdfs, output = root.filename) 121 | p1 = (root.first_pdf_file).split('/')[-1] 122 | p2 = (root.second_pdf_file).split('/')[-1] 123 | messagebox.showinfo('Message', 'Your PDF file '+p1+' and '+p2+' is Merged Successfully') 124 | 125 | 126 | 127 | root = Tk() 128 | style = ttk.Style(root) 129 | 130 | root.configure( bg='white') 131 | 132 | 133 | 134 | 135 | def select1(): 136 | 137 | f2.grid_forget() 138 | f3.grid_forget() 139 | 140 | f1.place(x=100, y=200) 141 | f1.grid(row=1, column=1) 142 | 143 | def select2(): 144 | 145 | f1.grid_forget() 146 | f3.grid_forget() 147 | f2.place(x=100, y=200) 148 | f2.grid(row=1, column=1) 149 | 150 | def select3(): 151 | 152 | f1.grid_forget() 153 | f2.grid_forget() 154 | f3.place(x=100, y=200) 155 | f3.grid(row=1, column=1) 156 | 157 | 158 | 159 | 160 | 161 | root.geometry('420x300') 162 | option = IntVar() 163 | root.title("PDF Converter v 1.0") 164 | 165 | 166 | x=Radiobutton(root, bg='#ffffff',text="Convert",variable=option,value=1, command=select1,padx = 30,pady=50).grid(column=0, row=0) 167 | y=Radiobutton(root, bg='#ffffff',text="Split", variable=option, value=2, command=select2,padx = 30,pady=50).grid(column=1, row=0) 168 | z=Radiobutton(root,bg='#ffffff', text="Join", variable=option, value=3, command=select3,padx = 30,pady=50).grid(column=2, row=0) 169 | 170 | 171 | f1 = Frame(root) 172 | f2 = Frame(root) 173 | f3 = Frame(root) 174 | f1.configure( bg='red') 175 | select1() 176 | 177 | 178 | 179 | 180 | 181 | 182 | def reset_btn_fn(): 183 | get_file_button.config(text='Load Image',state="enabled") 184 | convert_button.config(text='Convert to PDF',state="enabled") 185 | split_file_get_button.config(text='Load PDF',state="enabled") 186 | spit_main_button.config(text='Split',state="enabled") 187 | get_first_pdf_btn.config(text='Load PDF 1',state="enabled") 188 | get_second_pdf_btn.config(text='Load PDF 2',state="enabled") 189 | merge_button.config(text='Join PDF',state="enabled") 190 | 191 | root.update() 192 | messagebox.showinfo('Message', ' Reseted\n\nDeveloped by Saad') 193 | actionBtn =ttk.Button(root, text="Reset", width=15, command=reset_btn_fn).place(x=155, y=240) 194 | 195 | 196 | 197 | 198 | 199 | #for Radio 1 200 | get_file_button=ttk.Button(f1, text = "Load Image",width=25, command = get_img_func) 201 | get_file_button.grid(row=0, column=1) 202 | convert_button=ttk.Button(f1, text = "Convert to PDF",width=25, command = convert) 203 | convert_button.grid(row=1, column=1) 204 | 205 | 206 | #for Radio 2 207 | split_file_get_button=ttk.Button(f2, text = "Load PDF",width=25, command = get_Split_file_func) 208 | split_file_get_button.grid(row=0, column=1) 209 | spit_main_button=ttk.Button(f2, text = "Split",width=25, command = split) 210 | spit_main_button.grid(row=1, column=1) 211 | 212 | 213 | 214 | # for Radio 3 215 | get_first_pdf_btn=ttk.Button(f3, text = "Load PDF 1",width=25, command = get_first_pdf_fn) 216 | get_first_pdf_btn.grid(row=0, column=1) 217 | get_second_pdf_btn=ttk.Button(f3, text = "Load PDF 2",width=25, command = get_second_pdf_fn) 218 | get_second_pdf_btn.grid(row=1, column=1) 219 | merge_button=ttk.Button(f3, text = "Join PDF",width=25, command = merge) 220 | merge_button.grid(row=2, column=1) 221 | #change_style() 222 | 223 | root.mainloop() 224 | print('Task Compleated') 225 | 226 | 227 | -------------------------------------------------------------------------------- /PDF Converter/setup.py: -------------------------------------------------------------------------------- 1 | from cx_Freeze import setup, Executable 2 | import sys 3 | 4 | base = None 5 | 6 | if sys.platform == 'win32': 7 | base = None 8 | 9 | 10 | executables = [Executable("PDF Converter.py", base=base)] 11 | 12 | packages = ["idna"] 13 | options = { 14 | 'build_exe': { 15 | 16 | 'packages':packages, 17 | }, 18 | 19 | } 20 | 21 | setup( 22 | name = "PDF Converter", 23 | options = options, 24 | version = "1.0", 25 | description = 'any description', 26 | executables = executables 27 | ) 28 | -------------------------------------------------------------------------------- /Password Generator/GUI.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | obj=Tk() 3 | obj.geometry("600x600+400+200") #for whole program gui pixels 4 | import random 5 | num=['1','2','3','4','5','6','7','8','9','0'] 6 | upper=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] 7 | lower=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] 8 | specialchar='`~!@#$%^&*()_+-=[]{}|/;:,<.>?' 9 | specialchar=list(specialchar) 10 | allchar=upper+lower+specialchar 11 | password=[] 12 | 13 | 14 | 15 | a=IntVar() 16 | 17 | L=Label(text='Length:').place(x=100,y=20) 18 | 19 | 20 | #E=Entry(textvariable=a) 21 | E=Text(height=1, width=40) 22 | E.place(x=160,y=20) 23 | 24 | T=Text(width=65,height=25) 25 | T.place(x=30,y=120) 26 | 27 | 28 | 29 | def call(password): 30 | T.delete('1.0',END) 31 | T.insert(END,password) 32 | 33 | def simple(n,password): 34 | print(n) 35 | n=int(n) 36 | B.config(state="disabled") 37 | 38 | for i in range(0,n): 39 | password.append(random.choice(upper+lower+num)) 40 | password=''.join(password) 41 | call(password) 42 | 43 | def complx(n,password): 44 | B.config(state="disabled") 45 | n=int(n) 46 | for i in range(0,n): 47 | password.append(random.choice(upper+lower+num+specialchar)) 48 | password=''.join(password) 49 | call(password) 50 | 51 | 52 | 53 | B=Button(obj,text='Simple ',command= lambda:simple(E.get("1.0",'end-1c'),password)) 54 | B.grid(row=1, column=1) 55 | B.place(x=200,y=80) 56 | 57 | 58 | B2=Button(obj,text='Complex ',command= lambda:complx(E.get("1.0",'end-1c'),password)) 59 | B2.grid(row=1, column=1) 60 | B2.place(x=350,y=80) 61 | 62 | print(password) 63 | 64 | 65 | 66 | 67 | obj.mainloop() 68 | -------------------------------------------------------------------------------- /Password Generator/Secure Password Generator.py: -------------------------------------------------------------------------------- 1 | import random 2 | import string 3 | import datetime 4 | import os 5 | import ctypes 6 | os.system("title Secure Password Generator") 7 | os.system('color 0a') 8 | d_date = datetime.datetime.now() 9 | reg_format_date = d_date.strftime(" %d-%m-%Y\t\t\t\t\t Secure Password Generator\t\t\t\t %I:%M:%S %p") 10 | print ('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++') 11 | print (reg_format_date) 12 | print ('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++') 13 | num=['1','2','3','4','5','6','7','8','9','0'] 14 | upper=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] 15 | lower=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] 16 | specialchar='`~!@#$%^&*()_+-=[]{}|/;:,<.>?' 17 | specialchar=list(specialchar) 18 | allchar=upper+lower+specialchar 19 | n=(input('\n\nEnter length of your password: ')) 20 | password=[] 21 | 22 | def simple(n): #for simple password. 23 | for i in range(0,n): 24 | password.append(random.choice(upper+lower+num)) 25 | def hard(n): 26 | for i in range(0,n): #for complex password 27 | password.append(random.choice(allchar)) 28 | 29 | def choice(n): 30 | z=eval(input('Press 1 for simple password\nPress 2 for complex password\n>')) 31 | if z==1: 32 | simple(n) 33 | if z==2: 34 | hard(n) 35 | elif z>2: 36 | print('Wrong input') 37 | choice(n) 38 | password=''.join(password) 39 | 40 | if len(password)>0: 41 | print(('Your generated password is:\n'+password)) 42 | n=input('\n\n\nEnter Filename to save it: ') 43 | fob=open(n+'.txt','w+') 44 | fob.write('Your generated password is: \n\n') 45 | fob.write(password) 46 | fob.close() 47 | ctypes.windll.user32.MessageBoxA(0,"Your Generated Password save successfully in a text file "+n+".txt","Message",0) 48 | -------------------------------------------------------------------------------- /Qbar Attendance/24-10-2019_11-10-46_AM.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Qbar Attendance/24-10-2019_11-10-46_AM.txt -------------------------------------------------------------------------------- /Qbar Attendance/Qbar Attendance Encoder.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | import pyzbar.pyzbar as pyzbar 4 | import base64 5 | import sys 6 | import time 7 | from datetime import datetime 8 | import xlwt 9 | from xlwt import Workbook 10 | 11 | cap = cv2.VideoCapture(0) 12 | font = cv2.FONT_HERSHEY_PLAIN 13 | 14 | fob=open(datetime.now().strftime("%d-%m-%Y_%I-%M-%S_%p") 15 | +'.txt','w+') 16 | 17 | names=[] 18 | def enterData(z): 19 | if z in names: 20 | pass 21 | else: 22 | names.append(z) 23 | z=''.join(str(z)) 24 | fob.write(z+'\n') 25 | return names 26 | 27 | print('Reading...') 28 | def checkData(data): 29 | try: 30 | data=str(base64.b64decode(data).decode()) 31 | except(TypeError): 32 | print('Invalid ID !!!') 33 | return 34 | if data in names: 35 | print('Already Present') 36 | else: 37 | print('\n'+str(len(names)+1)+'\n'+data) 38 | enterData(data) 39 | cv2.putText(frame, str(base64.b64decode(obj.data)), (50, 50), font, 2, 40 | (255, 0, 0), 3) 41 | 42 | while True: 43 | _, frame = cap.read() 44 | frame= cv2.flip(frame,1) 45 | decodedObjects = pyzbar.decode(frame) 46 | for obj in decodedObjects: 47 | checkData(obj.data) 48 | #print("Data", base64.b64decode(obj.data)) 49 | #enterData(base64.b64decode(obj.data)) 50 | #print(len(names)) 51 | #sys.stdout.write('\r'+'Reading...'+str(len(names))+'\t'+str(base64.b64decode(obj.data))) 52 | #sys.stdout.flush() 53 | time.sleep(1) 54 | 55 | cv2.imshow("Frame", frame) 56 | 57 | if cv2.waitKey(1) == 13: 58 | cv2.destroyAllWindows() 59 | break 60 | 61 | fob.close() 62 | 63 | 64 | d_date = datetime.datetime.now() 65 | reg_format_date = d_date.strftime("%d-%m-%Y %I:%M:%S %p") 66 | reg_format_date=reg_format_date.replace(':',' ') 67 | 68 | 69 | def writeExcel(names,reg_format_date): 70 | 71 | wb = Workbook() 72 | 73 | sheet1 = wb.add_sheet('Sheet 1') 74 | for i in range(0,len(names)): 75 | sheet1.write(i, 1, names[i]) 76 | 77 | wb.save(reg_format_date+'.xls') 78 | writeExcel(names,reg_format_date) 79 | -------------------------------------------------------------------------------- /Qbar Attendance/Qr Generate/Generate Py3.py: -------------------------------------------------------------------------------- 1 | from MyQR import myqr 2 | import os 3 | import base64 4 | 5 | f=open('names.txt','r') 6 | lines = f.read().split("\n") 7 | print (lines) 8 | 9 | 10 | for i in range(0,len(lines)): 11 | data=lines[i].encode('utf-8') 12 | name=str(base64.b64encode(data).decode()) 13 | print(name) 14 | 15 | 16 | version, level, qr_name = myqr.run( 17 | str(name), 18 | version = 1, 19 | level = 'H', 20 | picture = 'a.jpg', 21 | colorized = True, 22 | contrast = 1.0, 23 | brightness = 1.0, 24 | save_name = str(lines[i]+'.bmp'), 25 | save_dir = os.getcwd() 26 | ) 27 | -------------------------------------------------------------------------------- /Qbar Attendance/Qr Generate/a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Qbar Attendance/Qr Generate/a.jpg -------------------------------------------------------------------------------- /Qbar Attendance/Qr Generate/names.txt: -------------------------------------------------------------------------------- 1 | sumama 2 | saad -------------------------------------------------------------------------------- /Qbar Attendance/Qr Generate/saad.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Qbar Attendance/Qr Generate/saad.bmp -------------------------------------------------------------------------------- /Qbar Attendance/Qr Generate/sumama.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/Qbar Attendance/Qr Generate/sumama.bmp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Awesome Python Projects

3 |

A Curated List of Awesome projects made with Python.

4 | 5 | [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) 6 | [![GitHub forks](https://img.shields.io/github/forks/saadhaxxan/Awesome-Python-Projects.svg?style=social&label=Fork&maxAge=2592000)](https://github.com/saadhaxxan/Awesome-Python-Projects/network/) 7 | [![GitHub stars](https://img.shields.io/github/stars/saadhaxxan/Awesome-Python-Projects.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/saadhaxxan/Awesome-Python-Projects/stargazers/) 8 | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/ansicolortags.svg)](https://pypi.python.org/pypi/ansicolortags/) 9 | [![GitHub Issues](https://img.shields.io/github/issues/saadhaxxan/Visual-and-EDA-of-Corona-Virus.svg?style=flat&label=Issues&maxAge=2592000)](https://github.com/saadhaxxan/Awesome-Python-Projetcs/issues) 10 | [![Open Source Love png3](https://badges.frapsoft.com/os/v3/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/) 11 | [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) 12 |
13 | 14 | ## Author 15 | You can get in touch with me on my LinkedIn Profile: 16 | 17 | #### Saad Hassan 18 | [![LinkedIn Link](https://img.shields.io/badge/Connect-saadhaxxan-blue.svg?logo=linkedin&longCache=true&style=social&label=Connect 19 | )](https://www.linkedin.com/in/saadhaxxan) 20 | 21 | You can also follow my GitHub Profile to stay updated about my latest projects: [![GitHub Follow](https://img.shields.io/badge/Connect-saadhaxxan-blue.svg?logo=Github&longCache=true&style=social&label=Follow)](https://github.com/saadhaxxan) 22 | 23 | If you liked the repo then kindly support it by giving it a star ⭐! 24 | 25 | ## Contributions Welcome 26 | [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](#) 27 | 28 | If you find any bug in the code or have any improvements in mind then feel free to generate a pull request. 29 | 30 | 31 | ## LICENSE 32 | - MIT (2021) 33 | -------------------------------------------------------------------------------- /Scraping software/index.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtCore import * 2 | from PyQt5.QtGui import * 3 | from PyQt5.QtWidgets import * 4 | import sys 5 | import MySQLdb 6 | from PyQt5.uic import loadUiType 7 | 8 | 9 | ui,_ = loadUiType('scraper.ui') 10 | 11 | class MainApp(QMainWindow , ui): 12 | def __init__(self): 13 | QMainWindow.__init__(self) 14 | self.setupUi(self) 15 | 16 | 17 | 18 | def main(): 19 | app = QApplication(sys.argv) 20 | window = MainApp() 21 | window.show() 22 | app.exec_() 23 | 24 | 25 | if __name__ == '__main__': 26 | main() 27 | -------------------------------------------------------------------------------- /Scraping software/scrapApp.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import QtCore, QtGui, QtWidgets 2 | from urllib.request import urlopen 3 | from bs4 import BeautifulSoup 4 | 5 | class Ui_Form(object): 6 | 7 | 8 | def setupUi(self, Form): 9 | Form.setObjectName("Form") 10 | Form.resize(732, 589) 11 | self.textBrowser = QtWidgets.QTextBrowser(Form) 12 | self.textBrowser.setGeometry(QtCore.QRect(30, 50, 671, 491)) 13 | self.textBrowser.setStyleSheet("QTextBrowser{\n" 14 | "\n" 15 | "background:#ffffff\n" 16 | "\n" 17 | "}") 18 | self.textBrowser.setObjectName("textBrowser") 19 | self.pushButton = QtWidgets.QPushButton(Form) 20 | self.pushButton.setGeometry(QtCore.QRect(174, 552, 411, 31)) 21 | font = QtGui.QFont() 22 | font.setPointSize(12) 23 | font.setBold(True) 24 | font.setWeight(75) 25 | self.pushButton.setFont(font) 26 | self.pushButton.clicked.connect(self.scrapWeb) 27 | self.pushButton.setStyleSheet("QPushButton{\n" 28 | "\n" 29 | "border: 1px solid gray;\n" 30 | "border-radius : 15px;\n" 31 | "background:qradialgradient(spread:repeat, cx:0.5, cy:0.5, radius:0.077, fx:0.5, fy:0.5, stop:0 rgba(0, 169, 255, 147), stop:0.497326 rgba(0, 0, 0, 147), stop:1 rgba(0, 169, 255, 147))\n" 32 | "\n" 33 | "}\n" 34 | "\n" 35 | "QPushButton:hover{\n" 36 | "color:white;\n" 37 | "background-color:blue;\n" 38 | "border-radius:15px;\n" 39 | "border-width:0px\n" 40 | "}") 41 | 42 | self.pushButton.setObjectName("pushButton") 43 | self.lineEdit = QtWidgets.QLineEdit(Form) 44 | self.lineEdit.setGeometry(QtCore.QRect(30, 10, 671, 31)) 45 | font = QtGui.QFont() 46 | font.setPointSize(12) 47 | font.setBold(True) 48 | font.setWeight(75) 49 | self.lineEdit.setFont(font) 50 | self.lineEdit.setStyleSheet("QLineEdit{\n" 51 | "\n" 52 | "background: rgb(255, 255, 255);\n" 53 | "\n" 54 | "\n" 55 | "\n" 56 | "}") 57 | self.lineEdit.setObjectName("lineEdit") 58 | self.retranslateUi(Form) 59 | QtCore.QMetaObject.connectSlotsByName(Form) 60 | 61 | def scrapWeb(self): 62 | line_edit = self.lineEdit.text() 63 | html = urlopen(line_edit).read() 64 | bs_obj = BeautifulSoup(html,'lxml') 65 | self.textBrowser.append(str(bs_obj)) 66 | 67 | def retranslateUi(self, Form): 68 | _translate = QtCore.QCoreApplication.translate 69 | Form.setWindowTitle(_translate("Form", "Form")) 70 | self.pushButton.setText(_translate("Form", "Scrap URL")) 71 | self.lineEdit.setText(_translate("Form", "ENTER URL TO SCRAP")) 72 | 73 | 74 | if __name__ == "__main__": 75 | import sys 76 | app = QtWidgets.QApplication(sys.argv) 77 | Form = QtWidgets.QWidget() 78 | ui = Ui_Form() 79 | ui.setupUi(Form) 80 | Form.show() 81 | sys.exit(app.exec_()) 82 | 83 | -------------------------------------------------------------------------------- /Scraping software/scraper.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 732 10 | 589 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 30 20 | 50 21 | 671 22 | 491 23 | 24 | 25 | 26 | QTextBrowser{ 27 | 28 | background:rgb(255, 170, 255) 29 | 30 | } 31 | 32 | 33 | 34 | 35 | 36 | 174 37 | 552 38 | 411 39 | 31 40 | 41 | 42 | 43 | 44 | 12 45 | 75 46 | true 47 | 48 | 49 | 50 | QPushButton{ 51 | 52 | border: 1px solid gray; 53 | border-radius : 15px; 54 | background:qradialgradient(spread:repeat, cx:0.5, cy:0.5, radius:0.077, fx:0.5, fy:0.5, stop:0 rgba(0, 169, 255, 147), stop:0.497326 rgba(0, 0, 0, 147), stop:1 rgba(0, 169, 255, 147)) 55 | 56 | } 57 | 58 | QPushButton:hover{ 59 | color:white; 60 | background-color:black; 61 | border-radius:15px; 62 | border-width:0px 63 | } 64 | 65 | 66 | Scrap URL 67 | 68 | 69 | 70 | 71 | 72 | 30 73 | 10 74 | 671 75 | 31 76 | 77 | 78 | 79 | 80 | 12 81 | 75 82 | true 83 | 84 | 85 | 86 | QLineEdit{ 87 | 88 | background: rgb(255, 255, 255); 89 | 90 | 91 | 92 | } 93 | 94 | 95 | ENTER URL TO SCRAP 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /audio control/audio_control.py: -------------------------------------------------------------------------------- 1 | import pyaudio 2 | import numpy as np 3 | from datetime import date 4 | from sound import Sound 5 | import time 6 | import os 7 | 8 | CHUNK = 2**11 9 | RATE = 44100 10 | 11 | def pause(): 12 | Sound.volume_set(50) 13 | time.sleep(1) 14 | start() 15 | 16 | 17 | p=pyaudio.PyAudio() 18 | stream=p.open(format=pyaudio.paInt16,channels=1,rate=RATE,input=True, 19 | frames_per_buffer=CHUNK) 20 | 21 | def start(): 22 | for i in range(int(100*44100/1024)): 23 | Sound.volume_set(100) 24 | data = np.fromstring(stream.read(CHUNK),dtype=np.int16) 25 | peak=np.average(np.abs(data))*2 26 | bars="#"*int(50*peak/2**16) 27 | print("%04d %05d %s"%(i,peak,bars)) 28 | if len(bars)>15: 29 | pause() 30 | 31 | 32 | start() 33 | 34 | stream.stop_stream() 35 | stream.close() 36 | p.terminate() 37 | -------------------------------------------------------------------------------- /get project import/get-import.py: -------------------------------------------------------------------------------- 1 | from os import walk 2 | 3 | def getFileName(name): 4 | f=open(name,'r+') 5 | lines = f.read().split("\n") 6 | 7 | data=[] 8 | for i in range(0,len(lines)): 9 | #this program also take this line because of import 10 | if 'import' in lines[i]: 11 | if 'from' in lines[i]: 12 | temp=lines[i].split(' ') 13 | data.append(temp[1]) 14 | 15 | else: 16 | temp=lines[i].split(' ') 17 | data.append(temp[-1]) 18 | 19 | #print(lines[i]) 20 | 21 | #print('Imported modules are: ',data) 22 | print(data) 23 | return data 24 | 25 | 26 | 27 | f = [] 28 | for (dirpath, dirnames, filenames) in walk("."): 29 | f.extend(filenames) 30 | break 31 | print(f) 32 | 33 | modulesName=[] 34 | 35 | fileWrite=open('yourmodules.txt','w+') 36 | 37 | def addin(data): 38 | for i in range(0,len(data)): 39 | if ',' in data[i]: 40 | temp=data[i].split(',') 41 | for i in range(0,len(temp)): 42 | modulesName.append(temp[i]) 43 | fileWrite.write(temp[i]+'\n') 44 | 45 | else: 46 | modulesName.append(data[i]) 47 | fileWrite.write(data[i]+'\n') 48 | 49 | for i in range(0,len(f)): 50 | 51 | try: 52 | print(f[i]) 53 | fileWrite.write(f[i]+'\n') 54 | data=getFileName(f[i]) 55 | addin(data) 56 | fileWrite.write('\n') 57 | except: 58 | fileWrite.write(f[i]+'\n\n') 59 | print('Cannot Process File !!!') 60 | pass 61 | 62 | fileWrite.close() 63 | 64 | #if file name is present then do not get fro modules 65 | -------------------------------------------------------------------------------- /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/image.png -------------------------------------------------------------------------------- /python wifi key/WiFi Password.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n') 4 | profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i] 5 | for i in profiles: 6 | results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8').split('\n') 7 | results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b] 8 | try: 9 | print ("{:<30}| {:<}".format(i, results[0])) 10 | except IndexError: 11 | print ("{:<30}| {:<}".format(i, "")) 12 | -------------------------------------------------------------------------------- /speech recognition/audiofile recognition.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | 3 | r = sr.Recognizer() 4 | 5 | audio = "maybe-next-time-huh.wav" 6 | 7 | with sr.AudioFile(audio) as source: 8 | audio = r.record(source) 9 | print("done") 10 | 11 | 12 | try: 13 | text = r.recognize_google(audio) 14 | print(text) 15 | except: 16 | print("not recognized") 17 | -------------------------------------------------------------------------------- /speech recognition/info.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/speech recognition/info.mp3 -------------------------------------------------------------------------------- /speech recognition/maybe-next-time-huh.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/speech recognition/maybe-next-time-huh.wav -------------------------------------------------------------------------------- /speech recognition/pick-up-the-phone-1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/speech recognition/pick-up-the-phone-1.wav -------------------------------------------------------------------------------- /speech recognition/speech recognition.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | 3 | r = sr.Recognizer() 4 | 5 | with sr.Microphone() as source: 6 | print("speak anything") 7 | audio = r.listen(source) 8 | try: 9 | text = r.recognize_google(audio) 10 | print(text) 11 | except: 12 | print("speak again") 13 | 14 | -------------------------------------------------------------------------------- /speech recognition/temp.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/speech recognition/temp.mp3 -------------------------------------------------------------------------------- /speech recognition/temp.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saadhaxxan/Awesome-Python-Projects/0be4eb73eee92899d6cc09c5ea9e0a31195d8bd4/speech recognition/temp.wav -------------------------------------------------------------------------------- /speech recognition/text to speech.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | import pyglet 3 | import os 4 | import time 5 | import speech_recognition as sr 6 | import pyglet 7 | 8 | r = sr.Recognizer() 9 | 10 | 11 | with sr.Microphone() as source: 12 | print("speak anything") 13 | audio = r.listen(source) 14 | try: 15 | text = r.recognize_google(audio) 16 | print(text) 17 | lang = "en" 18 | file = gTTS(text=text, lang=lang,slow=False) 19 | file.save("info.mp3") 20 | os.system("start info.mp3") 21 | 22 | 23 | except Exception as e: 24 | print(e) 25 | -------------------------------------------------------------------------------- /speech recognition/url open.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import webbrowser as wb 3 | from gtts import gTTS 4 | import pyglet 5 | import os 6 | import time 7 | 8 | path = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s" 9 | 10 | r = sr.Recognizer() 11 | #def tts(text,lang): 12 | #file = gTTS(text=text, lang=lang) 13 | 14 | 15 | #music = pyglet.resource.media("temp.wav", streaming= False) 16 | #music.play() 17 | #pyglet.app.run() 18 | 19 | #time.sleep(music.duration) 20 | #os.remove(filename) 21 | 22 | with sr.Microphone() as source: 23 | print("speak anything") 24 | audio = r.listen(source) 25 | try: 26 | text = r.recognize_google(audio) 27 | print(text) 28 | #lang = "en" 29 | #tts(text,lang) 30 | #search_text = "https://www.google.com/search?q=" + text 31 | wb.get(path).open(text) 32 | 33 | 34 | except Exception as e: 35 | print(e) 36 | 37 | 38 | -------------------------------------------------------------------------------- /usb port disabler/usb-port-disabler.py: -------------------------------------------------------------------------------- 1 | import os 2 | import ctypes 3 | os.system('color a') 4 | ICON_INFO = 0x40 5 | print '\n\t\t\t\t\t Please run it as Administrator\n\n\n' 6 | print '-----------------------------------------------------------------------------------------------------------------------' 7 | print '\t\t\t\t\t USB PORT DISABLER' 8 | print '-----------------------------------------------------------------------------------------------------------------------\n\n' 9 | a=raw_input('\n\t\t\t\t\t Press e for ENABLE USB PORT \n\t\t\t\t\t press d for DISABLE USB PORT\n\n\t\t\t\t\t\t Enter your choice: ') 10 | 11 | if a=='e' or a=='E': 12 | os.system('reg add HKLM\SYSTEM\CurrentControlSet\Services\UsbStor /v "Start" /t REG_DWORD /d "3" /f') 13 | ctypes.windll.user32.MessageBoxA(0,"USB is enabled","Message",ICON_INFO) 14 | exit(0) 15 | 16 | if a=='d' or a=='D': 17 | os.system('reg add HKLM\SYSTEM\CurrentControlSet\Services\UsbStor /v "Start" /t REG_DWORD /d "4" /f') #3 for enable 18 | ctypes.windll.user32.MessageBoxA(0,"USB is disabled ","Message",ICON_INFO) 19 | exit(0) 20 | 21 | else: 22 | ctypes.windll.user32.MessageBoxA(0,"Wrong input","Message",ICON_INFO) 23 | exit(0) -------------------------------------------------------------------------------- /web automation/LinkedinBot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.keys import Keys 3 | import time 4 | 5 | class Linkedin: 6 | def __init__(self,username,password): 7 | self.username=username 8 | self.password=password 9 | self.bot=webdriver.Chrome() 10 | 11 | def login(self): 12 | bot=self.bot 13 | bot.get("https://www.linkedin.com/uas/login") 14 | time.sleep(3) 15 | email=bot.find_element_by_id("username") 16 | email.send_keys(self.username) 17 | password=bot.find_element_by_id("password") 18 | password.send_keys(self.password) 19 | time.sleep(3) 20 | password.send_keys(Keys.RETURN) 21 | 22 | load=Linkedin("your_email","your_password") 23 | load.login() 24 | -------------------------------------------------------------------------------- /web automation/YoutubeBot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.keys import Keys 3 | import time 4 | 5 | class YoutubeBot: 6 | def __init__(self,username,password): 7 | self.username=username 8 | self.password=password 9 | self.bot=webdriver.Firefox() 10 | 11 | def login(self): 12 | bot=self.bot 13 | bot.get('https://accounts.google.com/signin/v2/identifier?service=youtube&uilel=3&passive=true&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Den%26next%3D%252F&hl=en&flowName=GlifWebSignIn&flowEntry=ServiceLogin') 14 | time.sleep(2) 15 | email=bot.find_element_by_id('identifierId') 16 | email.send_keys(self.username) 17 | time.sleep(3) 18 | email.send_keys(Keys.RETURN) 19 | time.sleep(2) 20 | password=bot.find_element_by_name('password') 21 | password.send_keys(self.password) 22 | time.sleep(2) 23 | password.send_keys(Keys.RETURN) 24 | 25 | load=YoutubeBot("Your_Email","Your_Password") 26 | load.login() 27 | -------------------------------------------------------------------------------- /web automation/debug.log: -------------------------------------------------------------------------------- 1 | [0713/085526.093:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022) 2 | [0713/085526.205:ERROR:exception_snapshot_win.cc(98)] thread ID 2616 not found in process 3 | [0713/085526.298:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022) 4 | [0713/085526.300:ERROR:exception_snapshot_win.cc(98)] thread ID 13976 not found in process 5 | -------------------------------------------------------------------------------- /web automation/facebookbot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.keys import Keys 3 | import time 4 | 5 | class Facebookbot: 6 | def __init__(self,username,password): 7 | self.username=username 8 | self.password=password 9 | self.bot=webdriver.Chrome() 10 | 11 | def login(self): 12 | bot=self.bot 13 | bot.get("https://www.facebook.com/") 14 | time.sleep(5) 15 | email=bot.find_element_by_id("email") 16 | email.clear() 17 | email.send_keys(self.username) 18 | password=bot.find_element_by_id("pass") 19 | password.clear() 20 | password.send_keys(self.password) 21 | password.send_keys(Keys.RETURN) 22 | 23 | load=Facebookbot("Your_Email","Your_password") 24 | load.login() 25 | -------------------------------------------------------------------------------- /web automation/instagrambot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.keys import Keys 3 | import time 4 | 5 | class Twitter: 6 | def __init__(self,username,password): 7 | self.username=username 8 | self.password=password 9 | self.bot=webdriver.Chrome() 10 | 11 | def login(self): 12 | bot=self.bot 13 | bot.get("https://www.instagram.com/accounts/login/?source=auth_switcher") 14 | time.sleep(2) 15 | email=bot.find_element_by_name('username') 16 | email.clear() 17 | email.send_keys(self.username) 18 | password=bot.find_element_by_name('password') 19 | password.clear() 20 | password.send_keys(self.password) 21 | password.send_keys(Keys.RETURN) 22 | 23 | 24 | 25 | load=Twitter("Your_Email","Your_password") 26 | load.login() 27 | -------------------------------------------------------------------------------- /web automation/twitterbot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.keys import Keys 3 | import time 4 | 5 | class Twitter: 6 | def __init__(self,username,password): 7 | self.username=username 8 | self.password=password 9 | self.bot=webdriver.Chrome() 10 | 11 | def login(self): 12 | bot=self.bot 13 | bot.get("https://twitter.com/login") 14 | time.sleep(3) 15 | email=bot.find_element_by_name('session[username_or_email]') 16 | email.send_keys(self.username) 17 | email.send_keys(Keys.RETURN) 18 | password=bot.find_element_by_name('session[password]') 19 | password.send_keys(self.password) 20 | time.sleep(3) 21 | password.send_keys(Keys.RETURN) 22 | load=Twitter("Your_Email","Your_password") 23 | load.login() --------------------------------------------------------------------------------