├── Assignment 21
├── Media_Mohammad.sql
├── Media_mohammad.py
├── class_actor.py
└── class_media.py
├── Assignment 22
├── 1.png
├── README.md
├── database.py
├── main.py
├── main.spec
├── main_window.py
├── main_window.ui
└── todo_list.db
├── Assignment 23
├── 2.png
├── README.md
├── __pycache__
│ └── main_window.cpython-310.pyc
├── main.py
├── main_window.py
├── main_window.ui
└── s1.text
├── Assignment 24
├── README.md
├── Space-Shooter
│ ├── __pycache__
│ │ ├── bollet.cpython-310.pyc
│ │ ├── class_spaceship.cpython-310.pyc
│ │ └── enemy.cpython-310.pyc
│ ├── bollet.py
│ ├── class_spaceship.py
│ ├── enemy.py
│ └── interstellar.py
└── music
│ ├── 1.py
│ └── 2.py
├── Clock App
├── README.md
├── __pycache__
│ ├── db.cpython-310.pyc
│ ├── main_window.cpython-310.pyc
│ └── time_class.cpython-310.pyc
├── alarm_list.db
├── db.py
├── img
│ ├── Alarm.png
│ ├── Clock.png
│ ├── Stop_Wach.png
│ └── Timer.png
├── main.py
├── main.ui
├── main_2.ui
├── main_window.py
└── time_class.py
├── README.md
└── seson 20
└── sql
├── 2.py
├── delete.sql
├── digikala.db
├── insert.sql
├── select.sql
└── updat.sql
/Assignment 21/Media_Mohammad.sql:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 21/Media_Mohammad.sql
--------------------------------------------------------------------------------
/Assignment 21/Media_mohammad.py:
--------------------------------------------------------------------------------
1 | import pyfiglet
2 | from class_media import Media
3 | from class_media import Actor
4 | from class_actor import Film
5 | from class_actor import Series
6 | from class_actor import Clip
7 | from class_actor import Documentary
8 | import mysql.connector
9 |
10 | PRODUCTS = []
11 | def Title():
12 | title = pyfiglet.figlet_format("MediaMohamad@-@",font="slant")
13 | print(title)
14 | # ._._._._._._._._._._._.
15 | def read_from_databse():
16 | mydb = mysql.connector.connect(
17 | host="localhost",
18 | user="root",
19 | password="",
20 | database="Media_Mohammad"
21 | )
22 | mycursor = mydb.cursor()
23 | # ._._._._._._._._._._._.
24 | def Show_menu():
25 | print("1-Add")
26 | print("3-Removoe")
27 | print("4-Search")
28 | print("5-Show List")
29 | print("6-Exit")
30 | # ._._._._._._._._._._._.
31 |
32 | def Add():
33 | id = input("enter code: ")
34 | name_filem = input("enter name: ")
35 | duration = input("enter duration: ")
36 | new_product = {"id": id,"name_filem":name_filem,"duration":duration}
37 | PRODUCTS.append(new_product)
38 | # ._._._._._._._._._._._.
39 | def Serch():
40 | print("1-Search With Name_filem id ")
41 | print("2-Search With Duration ")
42 | choice=int(input("Which Method do You Want to Search : "))
43 | if choice==1:
44 | userKey=input("Pls Enter Media Id : " )
45 | f=0
46 | for i in range(len(PRODUCTS)):
47 | if str(PRODUCTS[i]['id'])==userKey or (PRODUCTS[i]['name_filem'].lower()==userKey.lower()) :
48 | print(PRODUCTS[i])
49 | f=1
50 | if f==0:
51 | print("Media Not Found!")
52 | elif choice==2:
53 | print("Duration between A and B ")
54 | A=int(input("A : "))
55 | B=int(input("B : "))
56 | f=0
57 | for i in range(len(PRODUCTS)):
58 | if PRODUCTS[i]["duration"]>=A and PRODUCTS[i]["duration"]>=B :
59 | print(PRODUCTS[i])
60 | f=1
61 | if f==0:
62 | print("Media Not Found!")
63 |
64 | else:
65 | print('Try Again !')
66 | # ._._._._._._._._._._._.
67 | def Show_list():
68 | mycursor.execute("SELECT * FROM falm")
69 |
70 | myresult = mycursor.fetchall()
71 | for x in myresult:
72 | print(x)
73 | # ._._._._._._._._._._._.
74 | def Remove():
75 | A = 0
76 | id = input("enter id: ")
77 | for product in PRODUCTS:
78 | code_a = A + 1
79 | if product["id"] == id:
80 | del PRODUCTS[A-1]
81 | print("Your item has been successfully deleted")
82 | break
83 | else:
84 | print("not found")
85 | # ._._._._._._._._._._._.
86 |
87 | Title()
88 | print("wellcom to medie mohammad")
89 |
90 | print("Loading...")
91 | read_from_databse()
92 | print("Data Loaded.")
93 |
94 | while True:
95 | Show_menu()
96 | choice = int(input("enter your choice: "))
97 |
98 | if choice == 1:
99 | Add()
100 |
101 | elif choice == 2:
102 | Edit()
103 |
104 | elif choice == 3:
105 | Remove()
106 |
107 | elif choice == 4:
108 | Serch()
109 |
110 | elif choice == 5:
111 | Show_list()
112 |
113 | elif choice == 7 :
114 | Exit(0)
115 | else:
116 | print("dorost vared kon")
117 |
118 |
119 |
--------------------------------------------------------------------------------
/Assignment 21/class_actor.py:
--------------------------------------------------------------------------------
1 | from class_media import Media
2 |
3 | class Documentary(Media):
4 | def __init__(self,id,name,director):
5 | Media.__init__(self,id,name,director)
6 | self.parts=parts
7 |
8 | class Series(Media):
9 | def __init__(self,N_o_e):
10 | super().__init__()
11 | self.N_o_e = N_o_episodes
12 |
13 | class Film(Media):
14 | def __init__(self,id=None,name=None,director=None):
15 | Media.__init__(self,id,name,director)
16 |
17 | class Clip(Media):
18 | def __init__(self,id=None,name=None,director=None):
19 | Media.__init__(self,id,name,director)
--------------------------------------------------------------------------------
/Assignment 21/class_media.py:
--------------------------------------------------------------------------------
1 | class Media():
2 | def __init__(self,n,d,i_s,u,dura,c):
3 | self.name = n
4 | self.duration = d
5 | self.imdb_score = i_s
6 | self.url = u
7 | self.duration = dura
8 | self.casts = c
9 |
10 | def Show_menu(self):
11 | print("1-Add")
12 | print("2-Edit")
13 | print("3-Removoe")
14 | print("4-Search")
15 | print("5-Show List")
16 | print("7-Exit")
17 |
18 | # def download(self):
19 | # url=self.url
20 | # yt = YouTube(url)
21 | # yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download()
22 |
23 | class Actor():
24 | def __init__(self,casts):
25 | self.casts = casts
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Assignment 22/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 22/1.png
--------------------------------------------------------------------------------
/Assignment 22/README.md:
--------------------------------------------------------------------------------
1 |

2 |
3 | # Python_dataBase
4 |
5 | ## Assignment 22
6 | ## **ToDoList**
7 | 
8 |
--------------------------------------------------------------------------------
/Assignment 22/database.py:
--------------------------------------------------------------------------------
1 | from datetime import datetime
2 | import sqlite3
3 | class Database:
4 | def __init__(self):
5 | self.con = sqlite3.connect("todo_list.db")
6 | self.cursor = self.con.cursor()
7 |
8 | def get_tasks (self):
9 | query = "SELECT * FROM tasks"
10 | result= self.cursor.execute(query)
11 | tasks = result.fetchall()
12 | return tasks
13 | def add_new_task(self,new_title,new_description,new_time,new_date):
14 | try:
15 | query = f"INSERT INTO tasks(title,description,time,date) VALUES ('{new_title}','{new_description}',{new_time},{new_date})"
16 | self.cursor.execute(query)
17 | self.con.commit()
18 | return True
19 | except:
20 | return False
21 | def delet_tasks (self,id):
22 | self.cursor.execute(f"DELETE FROM tasks WHERE id = {id}")
23 | self.con.commit()
24 | return True
25 |
26 | def task_done(self,id):
27 | self.cursor.execute(f"SELECT * FROM tasks WHERE id ='{id}'")
28 | task = self.cursor.fetchone()
29 | if task != None:
30 | self.cursor.execute(f"UPDATE tasks SET is_done ='1' WHERE id ='{id}'")
31 | self.con.commit()
32 |
33 |
--------------------------------------------------------------------------------
/Assignment 22/main.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from PySide6.QtWidgets import *
3 | from PySide6.QtCore import *
4 | from main_window import Ui_MainWindow
5 | from functools import partial
6 | from database import Database
7 | class MainWindow(QMainWindow):
8 | def __init__(self):
9 | super().__init__()
10 | self.ui = Ui_MainWindow()
11 | self.ui.setupUi(self)
12 | self.db = Database()
13 | self.read_from_database()
14 | self.ui.btn_new_task.clicked.connect(self.new_task)
15 |
16 | def new_task(self):
17 | new_title = self.ui.tb_new_task_title.text()
18 | new_description = self.ui.tb_new_task_description.text()
19 | new_time = self.ui.tame.text()
20 | new_date = self.ui.date.text()
21 | feedback = self.db.add_new_task(new_title, new_description, new_time, new_date)
22 | if feedback ==True:
23 | self.read_from_database()
24 | self.ui.tb_new_task_title.setText("")
25 | self.ui.tb_new_task_description.setText("")
26 | self.ui.tb_new_task_description.setText("")
27 | self.ui.tb_new_task_description.setText("")
28 |
29 | else:
30 | msg_box = QMessageBox()
31 | msg_box.setText("مشکل")
32 | msg_box.exec_()
33 |
34 |
35 | # def delete_tasks(self,id):
36 | # ...
37 | def read_from_database(self):
38 | tasks = self.db.get_tasks()
39 | for i in range(len(tasks)):
40 | new_checkbox = QCheckBox()
41 | new_label = QLabel()
42 | new_label.setText(tasks[i][1])
43 | new_de = QLabel()
44 | new_de .setText(tasks[i][2])
45 | new_de.setStyleSheet('color: white;')
46 | btun_del = QPushButton()
47 | btun_del.setText("x")
48 | btun_del.setStyleSheet('background-color: red; color: white; border: 0px; border-radius: 5px;')
49 | new_time = QLabel()
50 | new_time.setText(tasks[i][5])
51 | new_time.setStyleSheet('color: white;')
52 | new_date = QLabel()
53 | new_date.setText(tasks[i][6])
54 | new_date.setStyleSheet('color: white;')
55 | \
56 | self.ui.gl_tasks.addWidget(new_checkbox, i, 0)
57 | if tasks[i][3] == 1:
58 | new_checkbox.setChecked(True)
59 | new_de.setStyleSheet("text-decoration: line-through")
60 | new_label.setStyleSheet("text-decoration: line-through")
61 | else :
62 | new_checkbox.setChecked(False)
63 | if tasks[i][3] == 1:
64 | new_label.setStyleSheet("color:red")
65 | else :
66 | new_label.setStyleSheet("color: #00aaff")
67 | self.ui.gl_tasks.addWidget(new_checkbox,i ,1)
68 | self.ui.gl_tasks.addWidget(new_label,i , 3)
69 | self.ui.gl_tasks.addWidget(new_de,i , 4)
70 | self.ui.gl_tasks.addWidget(new_time,i , 5)
71 | self.ui.gl_tasks.addWidget(new_date, i,6)
72 | self.ui.gl_tasks.addWidget(btun_del,i , 7)
73 | btun_del.clicked.connect(partial(self.db.delet_tasks, tasks[i][0]))
74 | new_checkbox.clicked.connect(partial(self.db.task_done, tasks[i][1]))
75 |
76 |
77 |
78 | if __name__ =="__main__":
79 | app = QApplication(sys.argv)
80 | main_window = MainWindow()
81 | main_window.show()
82 | app.exec_()
83 |
84 |
85 |
--------------------------------------------------------------------------------
/Assignment 22/main.spec:
--------------------------------------------------------------------------------
1 | # -*- mode: python ; coding: utf-8 -*-
2 |
3 |
4 | block_cipher = None
5 |
6 |
7 | a = Analysis(
8 | ['main.py'],
9 | pathex=[],
10 | binaries=[],
11 | datas=[],
12 | hiddenimports=[],
13 | hookspath=[],
14 | hooksconfig={},
15 | runtime_hooks=[],
16 | excludes=[],
17 | win_no_prefer_redirects=False,
18 | win_private_assemblies=False,
19 | cipher=block_cipher,
20 | noarchive=False,
21 | )
22 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
23 |
24 | exe = EXE(
25 | pyz,
26 | a.scripts,
27 | a.binaries,
28 | a.zipfiles,
29 | a.datas,
30 | [],
31 | name='main',
32 | debug=False,
33 | bootloader_ignore_signals=False,
34 | strip=False,
35 | upx=True,
36 | upx_exclude=[],
37 | runtime_tmpdir=None,
38 | console=True,
39 | disable_windowed_traceback=False,
40 | argv_emulation=False,
41 | target_arch=None,
42 | codesign_identity=None,
43 | entitlements_file=None,
44 | )
45 |
--------------------------------------------------------------------------------
/Assignment 22/main_window.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'main_window.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.2
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15 | QFont, QFontDatabase, QGradient, QIcon,
16 | QImage, QKeySequence, QLinearGradient, QPainter,
17 | QPalette, QPixmap, QRadialGradient, QTransform)
18 | from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QLayout,
19 | QLineEdit, QMainWindow, QMenuBar, QPushButton,
20 | QSizePolicy, QStatusBar, QVBoxLayout, QWidget)
21 |
22 | class Ui_MainWindow(object):
23 | def setupUi(self, MainWindow):
24 | if not MainWindow.objectName():
25 | MainWindow.setObjectName(u"MainWindow")
26 | MainWindow.resize(308, 423)
27 | MainWindow.setStyleSheet(u"background-color: rgb(255, 93, 39);\n"
28 | "background-color: rgb(14, 30, 84);")
29 | MainWindow.setIconSize(QSize(12, 12))
30 | MainWindow.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
31 | self.centralwidget = QWidget(MainWindow)
32 | self.centralwidget.setObjectName(u"centralwidget")
33 | self.gridLayout_3 = QGridLayout(self.centralwidget)
34 | self.gridLayout_3.setObjectName(u"gridLayout_3")
35 | self.tb_new_task_description = QLineEdit(self.centralwidget)
36 | self.tb_new_task_description.setObjectName(u"tb_new_task_description")
37 | self.tb_new_task_description.setMinimumSize(QSize(0, 30))
38 | font = QFont()
39 | font.setFamilies([u"IRANSansFaNum Black"])
40 | font.setPointSize(8)
41 | font.setBold(True)
42 | self.tb_new_task_description.setFont(font)
43 | self.tb_new_task_description.setStyleSheet(u"background-color: #fff; border: 0px; border-radius: 3px;")
44 |
45 | self.gridLayout_3.addWidget(self.tb_new_task_description, 4, 8, 1, 1)
46 |
47 | self.tame = QLineEdit(self.centralwidget)
48 | self.tame.setObjectName(u"tame")
49 | self.tame.setMinimumSize(QSize(100, 30))
50 | self.tame.setMaximumSize(QSize(100, 16777215))
51 | self.tame.setFont(font)
52 | self.tame.setStyleSheet(u"background-color: #fff; border: 0px; border-radius: 3px;")
53 |
54 | self.gridLayout_3.addWidget(self.tame, 6, 7, 1, 1)
55 |
56 | self.gl_tasks = QGridLayout()
57 | self.gl_tasks.setObjectName(u"gl_tasks")
58 | self.gl_tasks.setSizeConstraint(QLayout.SetMinimumSize)
59 | self.gl_tasks.setContentsMargins(-1, -1, -1, 0)
60 |
61 | self.gridLayout_3.addLayout(self.gl_tasks, 1, 5, 1, 4)
62 |
63 | self.tb_new_task_title = QLineEdit(self.centralwidget)
64 | self.tb_new_task_title.setObjectName(u"tb_new_task_title")
65 | self.tb_new_task_title.setMinimumSize(QSize(100, 30))
66 | self.tb_new_task_title.setMaximumSize(QSize(100, 16777215))
67 | self.tb_new_task_title.setFont(font)
68 | self.tb_new_task_title.setStyleSheet(u"background-color: #fff; border: 0px; border-radius: 3px;")
69 |
70 | self.gridLayout_3.addWidget(self.tb_new_task_title, 4, 7, 1, 1)
71 |
72 | self.verticalLayout = QVBoxLayout()
73 | self.verticalLayout.setObjectName(u"verticalLayout")
74 | self.lbl_caption = QLabel(self.centralwidget)
75 | self.lbl_caption.setObjectName(u"lbl_caption")
76 | self.lbl_caption.setEnabled(True)
77 | sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Ignored)
78 | sizePolicy.setHorizontalStretch(0)
79 | sizePolicy.setVerticalStretch(0)
80 | sizePolicy.setHeightForWidth(self.lbl_caption.sizePolicy().hasHeightForWidth())
81 | self.lbl_caption.setSizePolicy(sizePolicy)
82 | font1 = QFont()
83 | font1.setFamilies([u"IRANSansFaNum Black"])
84 | font1.setPointSize(19)
85 | font1.setBold(True)
86 | self.lbl_caption.setFont(font1)
87 | self.lbl_caption.setStyleSheet(u"border: 0px;\n"
88 | "background-color: rgb(255, 255, 255);")
89 | self.lbl_caption.setAlignment(Qt.AlignCenter)
90 |
91 | self.verticalLayout.addWidget(self.lbl_caption)
92 |
93 |
94 | self.gridLayout_3.addLayout(self.verticalLayout, 0, 5, 1, 4)
95 |
96 | self.date = QLineEdit(self.centralwidget)
97 | self.date.setObjectName(u"date")
98 | self.date.setMinimumSize(QSize(0, 30))
99 | self.date.setFont(font)
100 | self.date.setStyleSheet(u"background-color: #fff; border: 0px; border-radius: 3px;")
101 | self.date.setMaxLength(12)
102 |
103 | self.gridLayout_3.addWidget(self.date, 5, 7, 1, 2)
104 |
105 | self.btn_new_task = QPushButton(self.centralwidget)
106 | self.btn_new_task.setObjectName(u"btn_new_task")
107 | sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
108 | sizePolicy1.setHorizontalStretch(0)
109 | sizePolicy1.setVerticalStretch(10)
110 | sizePolicy1.setHeightForWidth(self.btn_new_task.sizePolicy().hasHeightForWidth())
111 | self.btn_new_task.setSizePolicy(sizePolicy1)
112 | self.btn_new_task.setMinimumSize(QSize(100, 10))
113 | self.btn_new_task.setSizeIncrement(QSize(12, 19))
114 | font2 = QFont()
115 | font2.setFamilies([u"Segoe MDL2 Assets"])
116 | font2.setPointSize(18)
117 | font2.setBold(True)
118 | self.btn_new_task.setFont(font2)
119 | self.btn_new_task.setStyleSheet(u"border-radius: 90\n"
120 | "px; background-color: #184d47; border: 10px; color: #96bb7c;\n"
121 | "background-color: rgb(0, 85, 255);")
122 |
123 | self.gridLayout_3.addWidget(self.btn_new_task, 6, 8, 1, 1)
124 |
125 | MainWindow.setCentralWidget(self.centralwidget)
126 | self.menubar = QMenuBar(MainWindow)
127 | self.menubar.setObjectName(u"menubar")
128 | self.menubar.setGeometry(QRect(0, 0, 308, 25))
129 | MainWindow.setMenuBar(self.menubar)
130 | self.statusbar = QStatusBar(MainWindow)
131 | self.statusbar.setObjectName(u"statusbar")
132 | MainWindow.setStatusBar(self.statusbar)
133 |
134 | self.retranslateUi(MainWindow)
135 |
136 | QMetaObject.connectSlotsByName(MainWindow)
137 | # setupUi
138 |
139 | def retranslateUi(self, MainWindow):
140 | MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
141 | self.tb_new_task_description.setPlaceholderText(QCoreApplication.translate("MainWindow", u"enter your task...", None))
142 | self.tame.setPlaceholderText(QCoreApplication.translate("MainWindow", u"\u062f\u0631\u06cc\u0627\u0641\u062a \u0633\u0627\u0639\u062a", None))
143 | self.tb_new_task_title.setPlaceholderText(QCoreApplication.translate("MainWindow", u"task", None))
144 | self.lbl_caption.setText(QCoreApplication.translate("MainWindow", u"ToDo List", None))
145 | self.date.setPlaceholderText(QCoreApplication.translate("MainWindow", u"\u062f\u0631\u06cc\u0627\u0641\u062a \u062a\u0627\u0631\u06cc\u062e", None))
146 | self.btn_new_task.setText(QCoreApplication.translate("MainWindow", u"+", None))
147 | #if QT_CONFIG(shortcut)
148 | self.btn_new_task.setShortcut(QCoreApplication.translate("MainWindow", u"Return", None))
149 | #endif // QT_CONFIG(shortcut)
150 | # retranslateUi
151 |
152 |
--------------------------------------------------------------------------------
/Assignment 22/main_window.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 308
10 | 423
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 | background-color: rgb(255, 93, 39);
18 | background-color: rgb(14, 30, 84);
19 |
20 |
21 |
22 | 12
23 | 12
24 |
25 |
26 |
27 | Qt::ToolButtonTextBesideIcon
28 |
29 |
30 |
31 | -
32 |
33 |
34 |
35 | 0
36 | 30
37 |
38 |
39 |
40 |
41 | IRANSansFaNum Black
42 | 8
43 | true
44 |
45 |
46 |
47 | background-color: #fff; border: 0px; border-radius: 3px;
48 |
49 |
50 | enter your task...
51 |
52 |
53 |
54 | -
55 |
56 |
57 |
58 | 100
59 | 30
60 |
61 |
62 |
63 |
64 | 100
65 | 16777215
66 |
67 |
68 |
69 |
70 | IRANSansFaNum Black
71 | 8
72 | true
73 |
74 |
75 |
76 | background-color: #fff; border: 0px; border-radius: 3px;
77 |
78 |
79 | دریافت ساعت
80 |
81 |
82 |
83 | -
84 |
85 |
86 | QLayout::SetMinimumSize
87 |
88 |
89 | 0
90 |
91 |
92 |
93 | -
94 |
95 |
96 |
97 | 100
98 | 30
99 |
100 |
101 |
102 |
103 | 100
104 | 16777215
105 |
106 |
107 |
108 |
109 | IRANSansFaNum Black
110 | 8
111 | true
112 |
113 |
114 |
115 | background-color: #fff; border: 0px; border-radius: 3px;
116 |
117 |
118 | task
119 |
120 |
121 |
122 | -
123 |
124 |
-
125 |
126 |
127 | true
128 |
129 |
130 |
131 | 0
132 | 0
133 |
134 |
135 |
136 |
137 | IRANSansFaNum Black
138 | 19
139 | true
140 |
141 |
142 |
143 | border: 0px;
144 | background-color: rgb(255, 255, 255);
145 |
146 |
147 | ToDo List
148 |
149 |
150 | Qt::AlignCenter
151 |
152 |
153 |
154 |
155 |
156 | -
157 |
158 |
159 |
160 | 0
161 | 30
162 |
163 |
164 |
165 |
166 | IRANSansFaNum Black
167 | 8
168 | true
169 |
170 |
171 |
172 | background-color: #fff; border: 0px; border-radius: 3px;
173 |
174 |
175 | 12
176 |
177 |
178 | دریافت تاریخ
179 |
180 |
181 |
182 | -
183 |
184 |
185 |
186 | 0
187 | 10
188 |
189 |
190 |
191 |
192 | 100
193 | 10
194 |
195 |
196 |
197 |
198 | 12
199 | 19
200 |
201 |
202 |
203 |
204 | Segoe MDL2 Assets
205 | 18
206 | true
207 |
208 |
209 |
210 | border-radius: 90
211 | px; background-color: #184d47; border: 10px; color: #96bb7c;
212 | background-color: rgb(0, 85, 255);
213 |
214 |
215 | +
216 |
217 |
218 | Return
219 |
220 |
221 |
222 |
223 |
224 |
234 |
235 |
236 |
237 |
238 |
239 |
--------------------------------------------------------------------------------
/Assignment 22/todo_list.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 22/todo_list.db
--------------------------------------------------------------------------------
/Assignment 23/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 23/2.png
--------------------------------------------------------------------------------
/Assignment 23/README.md:
--------------------------------------------------------------------------------
1 | 
2 | ## Python_Qt
3 |
4 |
5 | ## Assignment 23
6 |
7 | ## **Sodoko**
8 |
9 | ## PyInstaller
10 | ```
11 | pyinstaller --onefile main.py
12 | ```
13 |
14 | 
15 |
--------------------------------------------------------------------------------
/Assignment 23/__pycache__/main_window.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 23/__pycache__/main_window.cpython-310.pyc
--------------------------------------------------------------------------------
/Assignment 23/main.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import random
3 | from functools import partial
4 | from sudoku import Sudoku
5 | from PySide6.QtGui import *
6 | from PySide6.QtWidgets import *
7 | from PySide6.QtUiTools import QUiLoader
8 | from main_window import Ui_MainWindow
9 |
10 | class MainWindow(QMainWindow):
11 | def __init__(self):
12 | super().__init__()
13 | self.ui = Ui_MainWindow()
14 | self.ui.setupUi(self)
15 | self.ui.menu_new.triggered.connect(self.new_game)
16 | self.ui.menu_theme.triggered.connect(self.dark_game)
17 | self.ui.menu_help_3.triggered.connect(self.menu_help)
18 | self.ui.menu_about_3.triggered.connect(self.menu_about)
19 | self.ui.menu_exit_3.triggered.connect(self.menu_exit)
20 | self.ui.open_file.triggered.connect(self.open_file)
21 |
22 | self.game = [[None for i in range(9)] for j in range(9)] # backend
23 | self.dark = 0
24 | for i in range (9):
25 | for j in range (9):
26 | linedit = QLineEdit()
27 | linedit.setStyleSheet('font-size: 28px')
28 | linedit.setSizePolicy(QSizePolicy.Preferred , QSizePolicy.Preferred)
29 | self.game[i][j] = linedit
30 | self.ui.grid_layout.addWidget(linedit ,i ,j)
31 | self.game[i][j].setAlignment(Qt.AlignCenter)
32 | linedit.textChanged.connect(self.check_game)
33 | self.new_game()
34 | self.win = 1
35 |
36 | def open_file(self):
37 | file_path = QFileDialog.getOpenFileName(self, 'Open file...')[0]
38 | # print(file_path)
39 | f = open(file_path, 'r')
40 | big_text = f.read()
41 | rows = big_text.split('\n')
42 | puzzle_board = [[None for i in range(9)] for j in range(9)]
43 | for i in range(len(rows)):
44 | cells = rows[i].split(' ')
45 | for j in range(len(cells)):
46 | puzzle_board[i][j] = int(cells[j])
47 |
48 | self.checkable = False
49 | for i in range(9):
50 | for j in range(9):
51 | if puzzle_board[i][j] != 0:
52 | self.game[i][j].setText(str(puzzle_board[i][j]))
53 | self.game[i][j].setReadOnly(True)
54 | else:
55 | self.game[i][j].setText('')
56 | self.game[i][j].setReadOnly(False)
57 | self.checkable = True
58 |
59 | def dark_game(self):
60 | self.dark = 1
61 | self.ui.setStyleSheet('background: dark gray; color: white')
62 | for i in range(9):
63 | for j in range(9):
64 | self.game[i][j].setStyleSheet('background: gray; color: white')
65 |
66 | def check_game(self):
67 | self.win = 1
68 | for row in range(9): # Check rows
69 | for i in range(9):
70 | for j in range(9):
71 | if self.game[row][i].text() == self.game[row][j].text() and i != j and self.game[row][i].text() != '':
72 | self.game[row][i].setStyleSheet('font-size :32 px; color: black; background-color :pink')
73 | self.win = 0
74 |
75 |
76 | for col in range(9): # Check colums
77 | for i in range(9):
78 | for j in range(9):
79 | if self.game[i][col].text() == self.game[j][col].text() and i != j and self.game[i][col].text() != '':
80 | self.game[i][col].setStyleSheet('font-size :32 px; color: black; background-color :pink')
81 | self.win = 0
82 |
83 | for i in range(0, 3):
84 | for j in range(0, 3):
85 | for row in range(0, 3):
86 | for col in range(0, 3):
87 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
88 | self.game[row][col].text() != '':
89 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
90 | self.win = 0
91 |
92 | for i in range(3, 6):
93 | for j in range(0, 3):
94 | for row in range(3, 6):
95 | for col in range(0,3):
96 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
97 | self.game[row][col].text() != '':
98 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
99 | self.win = 0
100 |
101 | for i in range(6, 9):
102 | for j in range(0, 3):
103 | for row in range(6, 9):
104 | for col in range(0, 3):
105 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
106 | self.game[row][col].text() != '':
107 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
108 | self.win = 0
109 |
110 | for i in range(0, 3):
111 | for j in range(3, 6):
112 | for row in range(0, 3):
113 | for col in range(3, 6):
114 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
115 | self.game[row][col].text() != '':
116 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
117 | self.win = 0
118 |
119 | for i in range(3, 6):
120 | for j in range(3, 6):
121 | for row in range(3, 6):
122 | for col in range(3, 6):
123 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
124 | self.game[row][col].text() != '':
125 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
126 | self.win = 0
127 |
128 | for i in range(6, 9):
129 | for j in range(3, 6):
130 | for row in range(6, 9):
131 | for col in range(3, 6):
132 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
133 | self.game[row][col].text() != '':
134 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
135 | self.win = 0
136 |
137 | for i in range(6, 9):
138 | for j in range(0, 3):
139 | for row in range(6, 9):
140 | for col in range(0, 3):
141 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
142 | self.game[row][col].text() != '':
143 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
144 | self.win = 0
145 |
146 | for i in range(6, 9):
147 | for j in range(3, 6):
148 | for row in range(6, 9):
149 | for col in range(3, 6):
150 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
151 | self.game[row][col].text() != '':
152 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
153 | self.win = 0
154 |
155 | for i in range(6, 9):
156 | for j in range(6, 9):
157 | for row in range(6, 9):
158 | for col in range(6, 9):
159 | if self.game[i][j].text() == self.game[row][col].text() and i != row and j != col and \
160 | self.game[row][col].text() != '':
161 | self.game[i][j].setStyleSheet('font-size :32 px; color: black; background-color :pink')
162 | self.win = 0
163 | for i in range(9):
164 | for j in range(9):
165 | if self.game[i][j].text() == '':
166 | self.win = 0
167 |
168 | if self.win == 1:
169 | msgBox = QMessageBox()
170 | msgBox.setText('Congratulation! You Win')
171 | msgBox.exec()
172 |
173 | def new_game(self):
174 | puzzle = Sudoku(3,seed=random.randint(1, 100)).difficulty(0.5)
175 | for i in range(9):
176 | for j in range(9):
177 | new_cell = QLineEdit()
178 | new_cell.setStyleSheet('font-size: 30px ; text-align:center')
179 | new_cell.setSizePolicy(QSizePolicy.Preferred , QSizePolicy.Preferred)
180 | if puzzle.board[i][j] != None:
181 | new_cell.setText(str(puzzle.board[i][j]))
182 | new_cell.setReadOnly(True)
183 | self.ui.grid_layout.addWidget(new_cell, i, j)
184 | new_cell.textChanged.connect(partial(self.validation,i, j))
185 | self.game[i][j] = new_cell
186 |
187 | def validation(self ,i,j,text):
188 | if text not in ["1","2","3","4","5","6","7","8","9"]:
189 | self.game[i][j].setText("")
190 |
191 | def menu_about(self):
192 | ms_box = QMessageBox()
193 | ms_box.setText("We created this sudoku for you to make your mind stronger")
194 | ms_box.exec()
195 | def menu_help(self):
196 | ms_box = QMessageBox()
197 | ms_box.setText("Complete Sudoku from 1 to 100")
198 | ms_box.exec()
199 | def menu_exit(self):
200 | QCoreApplication.exit(0)
201 |
202 |
203 | if __name__ =="__main__":
204 | app = QApplication(sys.argv)
205 | window = MainWindow()
206 | window.show()
207 | app.exec_()
208 |
--------------------------------------------------------------------------------
/Assignment 23/main_window.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'main_window.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.2
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
15 | QCursor, QFont, QFontDatabase, QGradient,
16 | QIcon, QImage, QKeySequence, QLinearGradient,
17 | QPainter, QPalette, QPixmap, QRadialGradient,
18 | QTransform)
19 | from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel,
20 | QMainWindow, QMenu, QMenuBar, QPushButton,
21 | QSizePolicy, QStatusBar, QVBoxLayout, QWidget)
22 |
23 | class Ui_MainWindow(object):
24 | def setupUi(self, MainWindow):
25 | if not MainWindow.objectName():
26 | MainWindow.setObjectName(u"MainWindow")
27 | MainWindow.resize(333, 456)
28 | self.menu_new = QAction(MainWindow)
29 | self.menu_new.setObjectName(u"menu_new")
30 | self.menu_file = QAction(MainWindow)
31 | self.menu_file.setObjectName(u"menu_file")
32 | self.menu_help = QAction(MainWindow)
33 | self.menu_help.setObjectName(u"menu_help")
34 | self.menu_exit = QAction(MainWindow)
35 | self.menu_exit.setObjectName(u"menu_exit")
36 | self.menu_about = QAction(MainWindow)
37 | self.menu_about.setObjectName(u"menu_about")
38 | self.menu_check = QAction(MainWindow)
39 | self.menu_check.setObjectName(u"menu_check")
40 | self.menu_help_2 = QAction(MainWindow)
41 | self.menu_help_2.setObjectName(u"menu_help_2")
42 | self.menu_about_2 = QAction(MainWindow)
43 | self.menu_about_2.setObjectName(u"menu_about_2")
44 | self.menu_exit_2 = QAction(MainWindow)
45 | self.menu_exit_2.setObjectName(u"menu_exit_2")
46 | self.menu_theme = QAction(MainWindow)
47 | self.menu_theme.setObjectName(u"menu_theme")
48 | self.menu_exit_3 = QAction(MainWindow)
49 | self.menu_exit_3.setObjectName(u"menu_exit_3")
50 | self.menu_about_3 = QAction(MainWindow)
51 | self.menu_about_3.setObjectName(u"menu_about_3")
52 | self.menu_help_3 = QAction(MainWindow)
53 | self.menu_help_3.setObjectName(u"menu_help_3")
54 | self.open_file = QAction(MainWindow)
55 | self.open_file.setObjectName(u"open_file")
56 | self.centralwidget = QWidget(MainWindow)
57 | self.centralwidget.setObjectName(u"centralwidget")
58 | self.verticalLayout = QVBoxLayout(self.centralwidget)
59 | self.verticalLayout.setObjectName(u"verticalLayout")
60 | self.label = QLabel(self.centralwidget)
61 | self.label.setObjectName(u"label")
62 | font = QFont()
63 | font.setPointSize(22)
64 | font.setBold(True)
65 | self.label.setFont(font)
66 | self.label.setScaledContents(False)
67 | self.label.setAlignment(Qt.AlignCenter)
68 | self.label.setWordWrap(False)
69 |
70 | self.verticalLayout.addWidget(self.label)
71 |
72 | self.verticalLayout_2 = QVBoxLayout()
73 | self.verticalLayout_2.setObjectName(u"verticalLayout_2")
74 | self.grid_layout = QGridLayout()
75 | self.grid_layout.setObjectName(u"grid_layout")
76 |
77 | self.verticalLayout_2.addLayout(self.grid_layout)
78 |
79 | self.horizontalLayout = QHBoxLayout()
80 | self.horizontalLayout.setObjectName(u"horizontalLayout")
81 | self.New_Button = QPushButton(self.centralwidget)
82 | self.New_Button.setObjectName(u"New_Button")
83 | self.New_Button.setStyleSheet(u"background-color: rgb(196, 255, 174);")
84 |
85 | self.horizontalLayout.addWidget(self.New_Button)
86 |
87 | self.check_button = QPushButton(self.centralwidget)
88 | self.check_button.setObjectName(u"check_button")
89 | self.check_button.setStyleSheet(u"background-color: rgb(255, 184, 98);")
90 |
91 | self.horizontalLayout.addWidget(self.check_button)
92 |
93 | self.restart_button = QPushButton(self.centralwidget)
94 | self.restart_button.setObjectName(u"restart_button")
95 | self.restart_button.setStyleSheet(u"background-color: rgb(196, 255, 174);")
96 |
97 | self.horizontalLayout.addWidget(self.restart_button)
98 |
99 |
100 | self.verticalLayout_2.addLayout(self.horizontalLayout)
101 |
102 |
103 | self.verticalLayout.addLayout(self.verticalLayout_2)
104 |
105 | self.mode_button = QPushButton(self.centralwidget)
106 | self.mode_button.setObjectName(u"mode_button")
107 | self.mode_button.setStyleSheet(u"background-color: rgb(150, 0, 209);\n"
108 | "background-color: rgb(58, 135, 126);")
109 |
110 | self.verticalLayout.addWidget(self.mode_button)
111 |
112 | MainWindow.setCentralWidget(self.centralwidget)
113 | self.menubar = QMenuBar(MainWindow)
114 | self.menubar.setObjectName(u"menubar")
115 | self.menubar.setGeometry(QRect(0, 0, 333, 25))
116 | self.menugame = QMenu(self.menubar)
117 | self.menugame.setObjectName(u"menugame")
118 | self.menuHelp = QMenu(self.menubar)
119 | self.menuHelp.setObjectName(u"menuHelp")
120 | MainWindow.setMenuBar(self.menubar)
121 | self.statusbar = QStatusBar(MainWindow)
122 | self.statusbar.setObjectName(u"statusbar")
123 | MainWindow.setStatusBar(self.statusbar)
124 |
125 | self.menubar.addAction(self.menugame.menuAction())
126 | self.menubar.addAction(self.menuHelp.menuAction())
127 | self.menugame.addSeparator()
128 | self.menugame.addAction(self.menu_new)
129 | self.menugame.addAction(self.menu_theme)
130 | self.menugame.addAction(self.menu_exit_3)
131 | self.menugame.addAction(self.open_file)
132 | self.menuHelp.addAction(self.menu_about_3)
133 | self.menuHelp.addAction(self.menu_help_3)
134 |
135 | self.retranslateUi(MainWindow)
136 |
137 | QMetaObject.connectSlotsByName(MainWindow)
138 | # setupUi
139 |
140 | def retranslateUi(self, MainWindow):
141 | MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Sudo", None))
142 | self.menu_new.setText(QCoreApplication.translate("MainWindow", u"New", None))
143 | self.menu_file.setText(QCoreApplication.translate("MainWindow", u"Open File..", None))
144 | self.menu_help.setText(QCoreApplication.translate("MainWindow", u"help", None))
145 | self.menu_exit.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
146 | self.menu_about.setText(QCoreApplication.translate("MainWindow", u"About", None))
147 | self.menu_check.setText(QCoreApplication.translate("MainWindow", u"check", None))
148 | self.menu_help_2.setText(QCoreApplication.translate("MainWindow", u"Help", None))
149 | self.menu_about_2.setText(QCoreApplication.translate("MainWindow", u"About", None))
150 | self.menu_exit_2.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
151 | self.menu_theme.setText(QCoreApplication.translate("MainWindow", u"theme", None))
152 | self.menu_exit_3.setText(QCoreApplication.translate("MainWindow", u"Exit", None))
153 | self.menu_about_3.setText(QCoreApplication.translate("MainWindow", u"About", None))
154 | self.menu_help_3.setText(QCoreApplication.translate("MainWindow", u"Help gam", None))
155 | self.open_file.setText(QCoreApplication.translate("MainWindow", u"Open File.....", None))
156 | self.label.setText(QCoreApplication.translate("MainWindow", u"Sudoku game", None))
157 | self.New_Button.setText(QCoreApplication.translate("MainWindow", u"New Game", None))
158 | self.check_button.setText(QCoreApplication.translate("MainWindow", u"Check", None))
159 | self.restart_button.setText(QCoreApplication.translate("MainWindow", u"Restart", None))
160 | self.mode_button.setText(QCoreApplication.translate("MainWindow", u"Dark mode", None))
161 | self.menugame.setTitle(QCoreApplication.translate("MainWindow", u"game", None))
162 | self.menuHelp.setTitle(QCoreApplication.translate("MainWindow", u"Help", None))
163 | # retranslateUi
164 |
165 |
--------------------------------------------------------------------------------
/Assignment 23/main_window.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 333
10 | 456
11 |
12 |
13 |
14 | Sudo
15 |
16 |
17 |
18 | -
19 |
20 |
21 |
22 | 22
23 | true
24 |
25 |
26 |
27 | Sudoku game
28 |
29 |
30 | false
31 |
32 |
33 | Qt::AlignCenter
34 |
35 |
36 | false
37 |
38 |
39 |
40 | -
41 |
42 |
-
43 |
44 |
45 | -
46 |
47 |
-
48 |
49 |
50 | background-color: rgb(196, 255, 174);
51 |
52 |
53 | New Game
54 |
55 |
56 |
57 | -
58 |
59 |
60 | background-color: rgb(255, 184, 98);
61 |
62 |
63 | Check
64 |
65 |
66 |
67 | -
68 |
69 |
70 | background-color: rgb(196, 255, 174);
71 |
72 |
73 | Restart
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | -
82 |
83 |
84 | background-color: rgb(150, 0, 209);
85 | background-color: rgb(58, 135, 126);
86 |
87 |
88 | Dark mode
89 |
90 |
91 |
92 |
93 |
94 |
123 |
124 |
125 |
126 | New
127 |
128 |
129 |
130 |
131 | Open File..
132 |
133 |
134 |
135 |
136 | help
137 |
138 |
139 |
140 |
141 | Exit
142 |
143 |
144 |
145 |
146 | About
147 |
148 |
149 |
150 |
151 | check
152 |
153 |
154 |
155 |
156 | Help
157 |
158 |
159 |
160 |
161 | About
162 |
163 |
164 |
165 |
166 | Exit
167 |
168 |
169 |
170 |
171 | theme
172 |
173 |
174 |
175 |
176 | Exit
177 |
178 |
179 |
180 |
181 | About
182 |
183 |
184 |
185 |
186 | Help gam
187 |
188 |
189 |
190 |
191 | Open File.....
192 |
193 |
194 |
195 |
196 |
197 |
198 |
--------------------------------------------------------------------------------
/Assignment 23/s1.text:
--------------------------------------------------------------------------------
1 | 3 8 0 6 4 0 9 0 7
2 | 5 0 0 1 0 3 0 2 8
3 | 1 4 7 2 0 0 3 0 6
4 | 7 5 0 0 2 0 6 4 0
5 | 8 0 0 7 1 4 0 0 5
6 | 0 2 1 5 9 6 8 7 0
7 | 2 3 0 4 6 7 0 0 9
8 | 0 0 4 0 0 1 5 0 2
9 | 6 1 8 9 0 0 0 3 4
--------------------------------------------------------------------------------
/Assignment 24/README.md:
--------------------------------------------------------------------------------
1 | # Assignment 24 📼🎵
2 | # **music**
3 | #### 1-time =>14.426
4 | #### 2-time => 7.6577
5 | # **Space-Shooter**
6 | 
7 |
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/__pycache__/bollet.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 24/Space-Shooter/__pycache__/bollet.cpython-310.pyc
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/__pycache__/class_spaceship.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 24/Space-Shooter/__pycache__/class_spaceship.cpython-310.pyc
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/__pycache__/enemy.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Assignment 24/Space-Shooter/__pycache__/enemy.cpython-310.pyc
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/bollet.py:
--------------------------------------------------------------------------------
1 | import arcade
2 |
3 | class Bullet(arcade.Sprite):
4 | def __init__(self, host):
5 | super().__init__ (":resources:images/space_shooter/laserRed01.png")
6 | self.center_x = host.center_x
7 | self.center_y = host.center_y
8 | self.speed = 3
9 | self.change_x = 0
10 | self.change_y = 1
11 | def collision(self):
12 | arcade.play_sound(arcade.sound.Sound(':resources:sounds/laser4.wav'), 0.2, 0.0,False)
13 |
14 | def move(self):
15 | self.center_y+=self.speed
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/class_spaceship.py:
--------------------------------------------------------------------------------
1 | import arcade
2 | from bollet import Bullet
3 | class Spaceship(arcade.Sprite):
4 | def __init__ (self, w):
5 | super().__init__("img/12.png")
6 | self.center_x = w//2
7 | self.center_y = 57
8 | self.change_x = 0
9 | self.change_y = 0
10 | self.width = 99
11 | self.height = 99
12 | self.speed = 4
13 | self.game_width = w
14 | self.bullet_list = []
15 | self.health = 3
16 |
17 |
18 |
19 | def move(self):
20 | if self.change_x == -1:
21 | if self.center_x > 0:
22 | self.center_x -=self.speed
23 |
24 | elif self.change_x == 1 :
25 | if self.center_x < self.game_width:
26 | self.center_x +=self.speed
27 |
28 | def fire(self):
29 | new_bullet = Bullet(self)
30 | self.bullet_list.append(new_bullet)
31 |
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/enemy.py:
--------------------------------------------------------------------------------
1 | import random
2 | import arcade
3 | class Enemy(arcade.Sprite):
4 | def __init__(self,w,h,s=3):
5 | super().__init__("img/bullet2.png")
6 | self.center_x = random.randint(0,w)
7 | self.center_y = h+24
8 | self.angle = 180
9 | self.width = 48
10 | self.height = 48
11 | self.speed = s
12 |
13 | def move(self):
14 | self.center_y-= self.speed
--------------------------------------------------------------------------------
/Assignment 24/Space-Shooter/interstellar.py:
--------------------------------------------------------------------------------
1 | import random
2 | import arcade
3 | import time
4 | import threading
5 | from class_spaceship import Spaceship
6 | from enemy import Enemy
7 | from threading import Thread
8 |
9 | SCREEN_WIDTH = 600
10 | SCREEN_HEHGHT = 600
11 | class Game(arcade.Window):
12 | def __init__(self):
13 | super().__init__(width=800, height=800,title="Interstellar Geme_Mohammad 2023")
14 | arcade.set_background_color(arcade.color.DARK_BLUE)
15 | self.background = arcade.load_texture("img/SaharaAndromeda_Coy_6135-scaled.jpeg")
16 | self.gameover_image = arcade.load_texture("img/GameOver.png")
17 | self.me = Spaceship(self.width)
18 | self.enemy_list = []
19 | self.game_start_time = time.time()
20 | self.my_thread = threading.Thread(target=self.new_enemy)
21 | self.my_thread.start()
22 | self.game_status = True
23 | self.start_time = time.time()
24 | self.speed = 2
25 | self.health_image = arcade.load_texture("img/ghalb2.png")
26 |
27 | def new_enemy(self):
28 | while True:
29 | self.speed+=0.5
30 | self.new_enemy = Enemy(self,self.enemy_list)
31 | self.doshman2.append(self.new_enemy)
32 | time.sleep(3)
33 | # برای نمایش
34 | def on_draw(self):
35 | arcade.start_render()
36 | arcade.draw_lrwh_rectangle_textured(0,0,self.width,self.height,self.background)
37 | self.me.draw()
38 | for enemy in self.enemy_list:
39 | enemy.draw()
40 |
41 | for bullet in self.me.bullet_list:
42 | bullet.draw()
43 |
44 | if self.game_status == False:
45 |
46 | arcade.draw_lrwh_rectangle_textured(0, 0, SCREEN_WIDTH, SCREEN_HEHGHT, self.gameover_image)
47 |
48 | def on_key_press(self, symbol:int, modifiers:int):
49 | if symbol == arcade.key.LEFT:
50 | self.me.change_x = -1
51 | elif symbol == arcade.key.RIGHT:
52 | self.me.change_x = 1
53 | elif symbol == arcade.key.DOWN:
54 | self.me.change_x = 0
55 | elif symbol == arcade.key.SPACE:
56 | self.me.fire()
57 | elif symbol == 97: # left
58 | self.me.move("L")
59 | elif symbol == 100: #right
60 | self.me.move("R")
61 | def on_key_release(self, symbol:int, modifiers:int):
62 | self.me.change_x = 0
63 |
64 |
65 | def on_update(self, delta_time:float):
66 | for enemy in self.enemy_list:
67 | if arcade.check_for_collision(self.me, enemy):
68 | arcade.draw_lrwh_rectangle_textured(0, 0, SCREEN_WIDTH, SCREEN_HEHGHT, self.gameover_image)
69 | exit(0)
70 |
71 | for enemy in self.enemy_list:
72 | for bullet in self.me.bullet_list:
73 | if arcade.check_for_collision(enemy , bullet):
74 | self.enemy_list.remove(enemy)
75 | self.me.bullet_list.remove(bullet)
76 |
77 | self.me.move()
78 |
79 | for enemy in self.enemy_list:
80 | enemy.move()
81 |
82 | for bullet in self.me.bullet_list:
83 | bullet.move()
84 | for enemy in self.enemy_list:
85 | if enemy.center_y < 0:
86 | self.enemy_list.remove(enemy)
87 |
88 | if random.randint(1, 100) == 6:
89 | self.new_enemy = Enemy(self.width , self.height)
90 | self.enemy_list.append(self.new_enemy)
91 |
92 |
93 | window = Game()
94 | arcade.run()
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/Assignment 24/music/1.py:
--------------------------------------------------------------------------------
1 |
2 | import moviepy.editor as mp
3 | import time
4 |
5 | start_time = time.time()
6 |
7 | for i in range(1,4):
8 | video = mp.VideoFileClip(f"{i}.mp4")
9 | audio = video.audio
10 | audio.write_audiofile(f"{i}.mp3")
11 |
12 | end_time = time.time()
13 |
14 | print( end_time - start_time)
--------------------------------------------------------------------------------
/Assignment 24/music/2.py:
--------------------------------------------------------------------------------
1 |
2 | import moviepy.editor as mp
3 | from threading import Thread
4 | import time
5 |
6 | start_time = time.time()
7 |
8 | def convert_video_to_audio(video_file, audio_file):
9 | video = mp.VideoFileClip(video_file)
10 | audio = video.audio
11 | audio.write_audiofile(audio_file)
12 |
13 | threads = []
14 |
15 | for i in range(1,7):
16 | t = Thread(target=convert_video_to_audio, args=(f"{i}.mp4", f"{i}.mp3"))
17 | threads.append(t)
18 |
19 | for t in threads:
20 | t.start()
21 |
22 | for t in threads:
23 | t.join()
24 |
25 | end_time = time.time()
26 |
27 | print( end_time - start_time)
28 |
--------------------------------------------------------------------------------
/Clock App/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Assignment 25
4 | # **Clock App**
5 | 
6 |
7 | 
8 |
9 | 
10 |
11 | 
--------------------------------------------------------------------------------
/Clock App/__pycache__/db.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/__pycache__/db.cpython-310.pyc
--------------------------------------------------------------------------------
/Clock App/__pycache__/main_window.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/__pycache__/main_window.cpython-310.pyc
--------------------------------------------------------------------------------
/Clock App/__pycache__/time_class.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/__pycache__/time_class.cpython-310.pyc
--------------------------------------------------------------------------------
/Clock App/alarm_list.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/alarm_list.db
--------------------------------------------------------------------------------
/Clock App/db.py:
--------------------------------------------------------------------------------
1 | import sqlite3
2 |
3 | class Database:
4 | def __init__(self):
5 | self.con = sqlite3.connect('alarm_list.db')
6 | self.cursor = self.con.cursor()
7 |
8 | def get_alarms(self):
9 | query = 'SELECT * FROM alarms'
10 | result = self.cursor.execute(query)
11 | alarms = result = result.fetchall()
12 | return alarms
13 |
14 | def add_new_alarm(self, time):
15 | try:
16 | query = f'INSERT INTO alarms(time) VALUES("{time}")'
17 | self.cursor.execute(query)
18 | self.con.commit()
19 | return True
20 | except:
21 | return False
22 |
23 | def remove_alarm(self,id):
24 | try:
25 | query = f'DELETE FROM alarms WHERE id = "{id}"'
26 | self.cursor.execute(query)
27 | self.con.commit()
28 | return True
29 | except:
30 | return False
31 |
32 | def edit_alarm(self, second, id):
33 | try:
34 | query = f'UPDATE alarms SET time="{second}" WHERE id = {id}'
35 | self.cursor.execute(query)
36 | self.con.commit()
37 | return True
38 | except:
39 | return False
40 |
--------------------------------------------------------------------------------
/Clock App/img/Alarm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/img/Alarm.png
--------------------------------------------------------------------------------
/Clock App/img/Clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/img/Clock.png
--------------------------------------------------------------------------------
/Clock App/img/Stop_Wach.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/img/Stop_Wach.png
--------------------------------------------------------------------------------
/Clock App/img/Timer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/Clock App/img/Timer.png
--------------------------------------------------------------------------------
/Clock App/main.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | from functools import partial
4 | from PySide6.QtWidgets import *
5 | from PySide6.QtGui import *
6 | from PySide6.QtCore import *
7 | from main_window import Ui_MainWindow
8 | from time_class import MyTime
9 | from datetime import datetime
10 | from db import Database
11 | from plyer import notification
12 | from plyer.utils import platform
13 | from db import Database
14 |
15 | class AlarmThread(QThread):
16 | def __init__(self):
17 | super().__init__()
18 | self.Time_Alarms = []
19 | self.current_time = MyTime(int(time.strftime('%H')),int(time.strftime('%M')),int(time.strftime('%S')))
20 |
21 | def run(self):
22 | while True:
23 | self.current_time.add_second()
24 | time.sleep(1)
25 |
26 | #_#_#_WorldClock#_#_#
27 | class WorldClock(QThread):
28 | signal_show = Signal(MyTime)
29 | def __init__(self):
30 | super().__init__()
31 | self.timeTehran = MyTime(int(time.strftime('%H')),int(time.strftime('%M')),int(time.strftime('%S')))
32 | self.timeBerlin = self.timeTehran.sub(MyTime(2,30,0))
33 | self.timeWashington = self.timeTehran.sub(MyTime(7,30,0))
34 | def run(self):
35 | while True:
36 | self.timeTehran.add_second()
37 | self.signal_show.emit(self.timeTehran)
38 | time.sleep(1)
39 | #_#_#_StopWatch#_#_#
40 | class StopWatch(QThread):
41 | signal_show = Signal(MyTime)
42 | def __init__(self):
43 | super().__init__()
44 | self.time = MyTime(0,0,0)
45 | def run(self):
46 | while True:
47 | self.time.add_second()
48 | self.signal_show.emit(self.time)
49 | time.sleep(1)
50 | def reset(self):
51 | self.time.second = 0
52 | self.time.minute = 0
53 | self.time.hour = 0
54 | #_#_#_Timer#_#_#
55 | class Timer(QThread):
56 | signal_show = Signal(MyTime)
57 | def __init__(self):
58 | super().__init__()
59 | self.time = MyTime(0,15,0)
60 | def run(self):
61 | while True:
62 | self.time.sub_second()
63 | self.signal_show.emit(self.time)
64 | time.sleep(1)
65 | def set_time(self,hour,minute,second):
66 | self.time.hour = hour
67 | self.time.minute = minute
68 | self.time.second = second
69 |
70 | class MainWindow(QMainWindow):
71 | def __init__(self):
72 | super().__init__()
73 | self.ui = Ui_MainWindow()
74 | self.ui.setupUi(self)
75 |
76 | self.thread_stopwatch = StopWatch()
77 | self.thread_stopwatch.signal_show.connect(self.show_number_stopwatch)
78 |
79 | self.thered_timer = Timer()
80 | self.thered_timer.signal_show.connect(self.show_time_timer)
81 |
82 | self.thread_WorldClock = WorldClock()
83 | self.thread_WorldClock.signal_show.connect(self.show_world_clock)
84 | self.thread_WorldClock.start()
85 | self.db = Database()
86 | self.alarm_labels = []
87 | self.alarm_edits = []
88 | self.editable = True
89 | self.thread_alarm = AlarmThread()
90 |
91 |
92 |
93 | #_#_#_StopWatch#_#_#
94 | self.ui.stop_watch.setText('0:0:0')
95 | self.ui.start_sw.clicked.connect(self.start_stopwatch)
96 | self.ui.stop_sw.clicked.connect(self.stop_stopwatch)
97 | self.ui.reset_sw.clicked.connect(self.reset_stopwatch)
98 | #_#_#_Timer#_#_#
99 | self.ui.btn_start_timer.clicked.connect(self.start_timer)
100 | self.ui.btn_stop_timer.clicked.connect(self.stop_timer)
101 | #_#_#_Alarm#_#_#
102 | self.ui.btn_addalarm.clicked.connect(self.add_alarm)
103 | #_#_#_world_clock#_#_#
104 | def show_world_clock(self):
105 | self.thread_WorldClock.timeBerlin = self.thread_WorldClock.timeTehran.sub(MyTime(2,30,0))
106 | self.thread_WorldClock.timeWashington = self.thread_WorldClock.timeTehran.sub(MyTime(7,30,0))
107 | self.ui.tehran.setText(f'{self.thread_WorldClock.timeTehran.hour}:{self.thread_WorldClock.timeTehran.minute}:{self.thread_WorldClock.timeTehran.second}')
108 | self.ui.berlin.setText(f'{self.thread_WorldClock.timeBerlin.hour}:{self.thread_WorldClock.timeBerlin.minute}:{self.thread_WorldClock.timeBerlin.second}')
109 | self.ui.washington.setText(f'{self.thread_WorldClock.timeWashington.hour}:{self.thread_WorldClock.timeWashington.minute}:{self.thread_WorldClock.timeWashington.second}')
110 | #_#_#_StopWatch#_#_#
111 | def start_stopwatch(self):
112 | self.thread_stopwatch.start()
113 | def show_number_stopwatch(self):
114 | self.ui.stop_watch.setText(f'{self.thread_stopwatch.time.hour}:{self.thread_stopwatch.time.minute}:{self.thread_stopwatch.time.second}')
115 | def reset_stopwatch(self):
116 | self.thread_stopwatch.reset()
117 | def stop_stopwatch(self):
118 | self.thread_stopwatch.terminate()
119 | #_#_#_Timer#_#_#
120 | def start_timer(self):
121 | if self.thered_timer.time.second + self.thered_timer.time.minute + self.thered_timer.time.hour != 0:
122 | self.thered_timer.set_time(int(self.ui.tb_hour_timer_2.text()),int(self.ui.tb_minute_timer_2.text()),int(self.ui.tb_second_timer_2.text()))
123 | self.thered_timer.start()
124 | def show_time_timer(self):
125 | self.ui.tb_hour_timer_2.setText(str(self.thered_timer.time.hour))
126 | self.ui.tb_minute_timer_2.setText(str(self.thered_timer.time.minute))
127 | self.ui.tb_second_timer_2.setText(str(self.thered_timer.time.second))
128 | if self.thered_timer.time.second + self.thered_timer.time.minute + self.thered_timer.time.hour == 0:
129 | self.thered_timer.terminate()
130 | notification.notify(title='Timer', message='Alarm', app_name='Clock')
131 | def stop_timer(self):
132 | self.thered_timer.terminate()
133 | #_#_#_db#_#_#
134 | def read_from_database(self):
135 | alarms = self.db.get_alarms()
136 | self.alarm_labels = []
137 | for row in range(len(alarms)):
138 | self.add_alarm_to_grid(alarms,row)
139 | #_#_#Alarm#_#_#
140 | def add_alarm(self):
141 | if not self.editable:
142 | self.editable = True
143 | self.ui.btn_addalarm.setText('Add')
144 | self.ui.timeEdit.setStyleSheet('')
145 | self.thread_alarm.Time_Alarms[self.edit_alarm_row] = MyTime(self.ui.timeEdit.time().hour(), self.ui.timeEdit.time().minute(), self.ui.timeEdit.time().second())
146 | self.db.edit_alarm(self.thread_alarm.Time_Alarms[self.edit_alarm_row].convert_time_to_second(), self.edit_alarm_id)
147 | else:
148 | self.db.add_new_alarm(MyTime.convert_time_to_second(MyTime(self.ui.timeEdit.time().hour(), self.ui.timeEdit.time().minute(), self.ui.timeEdit.time().second())))
149 | self.remove_alarm()
150 | self.read_from_database()
151 |
152 | def add_alarm_to_grid(self,alarms,row):
153 | new_label = QLabel()
154 | new_btn = QPushButton()
155 | new_btn_edit = QPushButton()
156 | new_time = MyTime.convert_second_to_time(alarms[row][1])
157 | self.thread_alarm.Time_Alarms.append(new_time)
158 | new_label.setText(f'{new_time.hour}:{new_time.minute}:{new_time.second}')
159 | new_label.setFont(QFont('Centaur', pointSize=15))
160 | new_btn_edit.setText('📝')
161 | new_btn.setText('❌')
162 | new_btn.setMaximumWidth(50)
163 | new_btn_edit.setMaximumWidth(50)
164 | self.alarm_labels.append(new_label)
165 | self.alarm_edits.append(new_btn_edit)
166 |
167 | self.ui.gl_alarms.addWidget(new_label, row, 0)
168 | self.ui.gl_alarms.addWidget(new_btn_edit, row, 1)
169 | self.ui.gl_alarms.addWidget(new_btn, row, 2)
170 |
171 | new_btn_edit.clicked.connect(partial(self.edit_alarms,row,alarms[row][0]))
172 | new_btn.clicked.connect(partial(self.remove_alarm,alarms[row][0]))
173 |
174 | def edit_alarms(self, row, id):
175 | if self.editable:
176 | self.editable = False
177 | else:
178 | return
179 | self.ui.btn_addalarm.setText('Save')
180 | self.ui.timeEdit.setStyleSheet("background-color: yellow; color: black")
181 | self.alarm_labels[row].setStyleSheet("background-color: yellow; color: black")
182 | self.thread_alarm.Time_Alarms[row] = MyTime(self.thread_alarm.Time_Alarms[row].hour, self.thread_alarm.Time_Alarms[row].minute, self.thread_alarm.Time_Alarms[row].second)
183 | self.ui.timeEdit.setTime(QTime(self.thread_alarm.Time_Alarms[row].hour,self.thread_alarm.Time_Alarms[row].minute,self.thread_alarm.Time_Alarms[row].second))
184 | self.edit_alarm_id = id
185 | self.edit_alarm_row = row
186 |
187 | def remove_alarm(self,id = None):
188 | if id != None:
189 | self.db.remove_alarm(id)
190 | children = []
191 | for i in range(self.ui.gl_alarms.count()):
192 | child = self.ui.gl_alarms.itemAt(i).widget()
193 | if child:
194 | children.append(child)
195 | for child in children:
196 | child.deleteLater()
197 | self.read_from_database()
198 |
199 | if __name__ == "__main__":
200 | app = QApplication(sys.argv)
201 | main_window = MainWindow()
202 | main_window.show()
203 | app.exec()
--------------------------------------------------------------------------------
/Clock App/main.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 | true
7 |
8 |
9 |
10 | 0
11 | 0
12 | 498
13 | 372
14 |
15 |
16 |
17 | false
18 |
19 |
20 | false
21 |
22 |
23 | Qt::NoFocus
24 |
25 |
26 | Qt::DefaultContextMenu
27 |
28 |
29 | false
30 |
31 |
32 | Clock
33 |
34 |
35 | -1
36 |
37 |
38 | Qt::RightToLeft
39 |
40 |
41 | false
42 |
43 |
44 | background-color: rgb(66, 66, 66);
45 |
46 |
47 | false
48 |
49 |
50 | QTabWidget::Rounded
51 |
52 |
53 |
54 | -
55 |
56 |
57 |
58 | 471
59 | 321
60 |
61 |
62 |
63 |
64 | Rockwell
65 | 11
66 | true
67 | true
68 | false
69 | false
70 | false
71 |
72 |
73 |
74 | ArrowCursor
75 |
76 |
77 | false
78 |
79 |
80 | false
81 |
82 |
83 | Qt::TabFocus
84 |
85 |
86 | false
87 |
88 |
89 | Qt::LeftToRight
90 |
91 |
92 | false
93 |
94 |
95 | background-color: rgb(66, 66, 66);
96 | color: rgb(255, 255, 255);
97 |
98 |
99 | QTabWidget::North
100 |
101 |
102 | QTabWidget::Triangular
103 |
104 |
105 | 1
106 |
107 |
108 | Qt::ElideMiddle
109 |
110 |
111 | true
112 |
113 |
114 | true
115 |
116 |
117 | false
118 |
119 |
120 |
121 | World Clock
122 |
123 |
124 |
125 |
126 | 30
127 | 40
128 | 191
129 | 61
130 |
131 |
132 |
133 |
134 | Seven Segment
135 | 24
136 | true
137 |
138 |
139 |
140 | Qt::LeftToRight
141 |
142 |
143 | false
144 |
145 |
146 | color: rgb(154, 154, 154);
147 | background-color:None;
148 |
149 |
150 | 0 : 0 : 0
151 |
152 |
153 | false
154 |
155 |
156 | Qt::AlignCenter
157 |
158 |
159 | false
160 |
161 |
162 |
163 |
164 |
165 | 240
166 | 170
167 | 231
168 | 61
169 |
170 |
171 |
172 |
173 | Seven Segment
174 | 24
175 | true
176 |
177 |
178 |
179 | Qt::LeftToRight
180 |
181 |
182 | false
183 |
184 |
185 | color: rgb(154, 154, 154);
186 | background-color:None;
187 |
188 |
189 | 0 : 0 : 0
190 |
191 |
192 | false
193 |
194 |
195 | Qt::AlignCenter
196 |
197 |
198 | false
199 |
200 |
201 |
202 |
203 |
204 | 260
205 | 40
206 | 191
207 | 61
208 |
209 |
210 |
211 |
212 | Seven Segment
213 | 24
214 | true
215 |
216 |
217 |
218 | Qt::LeftToRight
219 |
220 |
221 | false
222 |
223 |
224 | color: rgb(154, 154, 154);
225 | background-color:None;
226 |
227 |
228 | 0 : 0 : 0
229 |
230 |
231 | false
232 |
233 |
234 | Qt::AlignCenter
235 |
236 |
237 | false
238 |
239 |
240 |
241 |
242 |
243 | 20
244 | 170
245 | 221
246 | 61
247 |
248 |
249 |
250 |
251 | Seven Segment
252 | 24
253 | true
254 |
255 |
256 |
257 | Qt::LeftToRight
258 |
259 |
260 | false
261 |
262 |
263 | color: rgb(154, 154, 154);
264 | background-color:None;
265 |
266 |
267 | 0 : 0 : 0
268 |
269 |
270 | false
271 |
272 |
273 | Qt::AlignCenter
274 |
275 |
276 | false
277 |
278 |
279 |
280 |
281 |
282 | 310
283 | 90
284 | 91
285 | 20
286 |
287 |
288 |
289 |
290 | Rockwell
291 | 16
292 | false
293 |
294 |
295 |
296 | background-color:None;
297 | color: rgb(154, 154, 154);
298 |
299 |
300 | Tehran
301 |
302 |
303 | Qt::AlignCenter
304 |
305 |
306 |
307 |
308 |
309 | 40
310 | 219
311 | 181
312 | 21
313 |
314 |
315 |
316 |
317 | Rockwell
318 | 16
319 | false
320 |
321 |
322 |
323 | background-color:None;
324 | color: rgb(154, 154, 154);
325 |
326 |
327 | Washington
328 |
329 |
330 | Qt::AlignCenter
331 |
332 |
333 |
334 |
335 |
336 | 310
337 | 220
338 | 91
339 | 20
340 |
341 |
342 |
343 |
344 | Rockwell
345 | 16
346 | true
347 |
348 |
349 |
350 | background-color:None;
351 | color: rgb(154, 154, 154);
352 |
353 |
354 | Berlin
355 |
356 |
357 | Qt::AlignCenter
358 |
359 |
360 |
361 |
362 |
363 | 330
364 | 110
365 | 49
366 | 16
367 |
368 |
369 |
370 |
371 | Rockwell
372 | 12
373 | true
374 |
375 |
376 |
377 | background-color:None;
378 | color: rgb(154, 154, 154);
379 |
380 |
381 | IRAN
382 |
383 |
384 | Qt::AlignCenter
385 |
386 |
387 |
388 |
389 |
390 | 100
391 | 240
392 | 49
393 | 21
394 |
395 |
396 |
397 |
398 | Rockwell
399 | 12
400 | true
401 |
402 |
403 |
404 | background-color:None;
405 | color: rgb(154, 154, 154);
406 |
407 |
408 | U.S.A
409 |
410 |
411 | Qt::AlignCenter
412 |
413 |
414 |
415 |
416 |
417 | 310
418 | 240
419 | 91
420 | 20
421 |
422 |
423 |
424 |
425 | Rockwell
426 | 12
427 | true
428 |
429 |
430 |
431 | background-color:None;
432 | color: rgb(154, 154, 154);
433 |
434 |
435 | Germany
436 |
437 |
438 | Qt::AlignCenter
439 |
440 |
441 |
442 |
443 |
444 | 90
445 | 90
446 | 71
447 | 41
448 |
449 |
450 |
451 |
452 | Rockwell
453 | 16
454 | false
455 |
456 |
457 |
458 | background-color:None;
459 | color: rgb(154, 154, 154);
460 |
461 |
462 | G.M.T
463 |
464 |
465 | Qt::AlignCenter
466 |
467 |
468 |
469 |
470 |
471 | Alarm
472 |
473 |
474 |
475 |
476 | 210
477 | 270
478 | 151
479 | 31
480 |
481 |
482 |
483 |
484 | Rockwell
485 | 11
486 | false
487 |
488 |
489 |
490 | border-color: rgb(162, 162, 162);
491 | color: rgb(255, 255, 255);
492 | border-style: outset;
493 | border-width:2px;
494 | border-radius:7px;
495 |
496 |
497 | 25
498 |
499 |
500 | true
501 |
502 |
503 | 0
504 |
505 |
506 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
507 |
508 |
509 | Title...
510 |
511 |
512 | Qt::LogicalMoveStyle
513 |
514 |
515 | false
516 |
517 |
518 |
519 |
520 |
521 | 0
522 | 10
523 | 471
524 | 231
525 |
526 |
527 |
528 | border-color: rgb(162, 162, 162);
529 | border-style: outset;
530 | border-width:2px;
531 | border-radius:10px;
532 |
533 |
534 | QFrame::StyledPanel
535 |
536 |
537 | QFrame::Raised
538 |
539 |
540 |
541 |
542 | 10
543 | 10
544 | 451
545 | 21
546 |
547 |
548 |
549 |
550 | 11
551 | true
552 |
553 |
554 |
555 | border-color: rgb(162, 162, 162);
556 | border-style: outset;
557 | border-width:2px;
558 | border-radius:4px;
559 | border-bottom-color: rgb(66, 66, 66);
560 |
561 |
562 | Alarms
563 |
564 |
565 | Qt::AlignCenter
566 |
567 |
568 |
569 |
570 |
571 | 20
572 | 30
573 | 431
574 | 161
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 | 10
583 | 200
584 | 451
585 | 24
586 |
587 |
588 |
589 | Set Changes
590 |
591 |
592 | false
593 |
594 |
595 |
596 |
597 |
598 |
599 | 370
600 | 250
601 | 91
602 | 51
603 |
604 |
605 |
606 |
607 | 32
608 |
609 |
610 |
611 | border-color: rgb(162, 162, 162);
612 | border-style: outset;
613 | border-width:2px;
614 | border-radius:7px;
615 |
616 |
617 | +
618 |
619 |
620 |
621 |
622 |
623 | 50
624 | 250
625 | 101
626 | 21
627 |
628 |
629 |
630 |
631 | 14
632 | true
633 |
634 |
635 |
636 | background-color: None;
637 | border-color: rgb(162, 162, 162);
638 | border-style: outset;
639 | border-width:2px;
640 | border-radius:4px;
641 | color: white;
642 | border-bottom-color: rgb(66, 66, 66);
643 |
644 |
645 | Time
646 |
647 |
648 | Qt::AlignCenter
649 |
650 |
651 |
652 |
653 |
654 | 230
655 | 250
656 | 101
657 | 21
658 |
659 |
660 |
661 |
662 | 14
663 | true
664 |
665 |
666 |
667 | background-color: None;
668 | border-color: rgb(162, 162, 162);
669 | border-style: outset;
670 | border-width:2px;
671 | border-radius:4px;
672 | color: white;
673 | border-bottom-color: rgb(66, 66, 66);
674 |
675 |
676 | Title
677 |
678 |
679 | Qt::AlignCenter
680 |
681 |
682 |
683 |
684 |
685 | 110
686 | 270
687 | 91
688 | 31
689 |
690 |
691 |
692 | border-color: rgb(162, 162, 162);
693 | border-left-color: rgb(66, 66, 66);
694 | border-style: outset;
695 | border-width:2px;
696 |
697 |
698 |
699 | Qt::AlignCenter
700 |
701 |
702 | 30
703 |
704 |
705 |
706 |
707 |
708 | 0
709 | 270
710 | 91
711 | 31
712 |
713 |
714 |
715 | border-color: rgb(162, 162, 162);
716 | border-right-color: rgb(66, 66, 66);
717 | border-style: outset;
718 | border-width:2px;
719 |
720 |
721 |
722 | Qt::AlignCenter
723 |
724 |
725 | 12
726 |
727 |
728 |
729 |
730 |
731 | 60
732 | 270
733 | 81
734 | 31
735 |
736 |
737 |
738 | border-color: rgb(162, 162, 162);
739 | border-style: outset;
740 | border-width:2px;
741 | border-right-color: rgb(66, 66, 66);
742 | border-left-color: rgb(66, 66, 66);
743 |
744 |
745 | :
746 |
747 |
748 | Qt::AlignCenter
749 |
750 |
751 | label_13
752 | title_a
753 | frame
754 | add_a
755 | label_11
756 | label_12
757 | min_a
758 | hour_a
759 |
760 |
761 |
762 | Stop Watch
763 |
764 |
765 |
766 |
767 | 0
768 | 10
769 | 341
770 | 61
771 |
772 |
773 |
774 |
775 | Seven Segment
776 | 32
777 | true
778 |
779 |
780 |
781 | Qt::LeftToRight
782 |
783 |
784 | false
785 |
786 |
787 | color: rgb(154, 154, 154);
788 | background-color:None;
789 |
790 |
791 | 0:0:0.0
792 |
793 |
794 | false
795 |
796 |
797 | Qt::AlignCenter
798 |
799 |
800 | false
801 |
802 |
803 |
804 |
805 |
806 | 350
807 | 10
808 | 119
809 | 31
810 |
811 |
812 |
813 |
814 | 12
815 |
816 |
817 |
818 | border-color: rgb(162, 162, 162);
819 | border-style: outset;
820 | border-width:2px;
821 | border-radius:10px;
822 |
823 |
824 | Start
825 |
826 |
827 |
828 |
829 |
830 | 350
831 | 50
832 | 119
833 | 31
834 |
835 |
836 |
837 |
838 | 12
839 |
840 |
841 |
842 | border-color: rgb(162, 162, 162);
843 | border-style: outset;
844 | border-width:2px;
845 | border-radius:10px;
846 |
847 |
848 | Flag
849 |
850 |
851 |
852 |
853 |
854 | 350
855 | 270
856 | 119
857 | 31
858 |
859 |
860 |
861 |
862 | 12
863 |
864 |
865 |
866 | border-color: rgb(162, 162, 162);
867 | border-style: outset;
868 | border-width:2px;
869 | border-radius:10px;
870 |
871 |
872 | Reset
873 |
874 |
875 |
876 |
877 |
878 | 350
879 | 90
880 | 119
881 | 31
882 |
883 |
884 |
885 |
886 | 12
887 |
888 |
889 |
890 | border-color: rgb(162, 162, 162);
891 | border-style: outset;
892 | border-width:2px;
893 | border-radius:10px;
894 |
895 |
896 | Stop
897 |
898 |
899 |
900 |
901 |
902 | 9
903 | 100
904 | 331
905 | 201
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 | Timer
914 |
915 |
916 |
917 |
918 | 350
919 | 10
920 | 119
921 | 31
922 |
923 |
924 |
925 |
926 | 12
927 |
928 |
929 |
930 | border-color: rgb(162, 162, 162);
931 | border-style: outset;
932 | border-width:2px;
933 | border-radius:10px;
934 |
935 |
936 | Start
937 |
938 |
939 |
940 |
941 |
942 | 350
943 | 270
944 | 119
945 | 31
946 |
947 |
948 |
949 |
950 | 12
951 |
952 |
953 |
954 | border-color: rgb(162, 162, 162);
955 | border-style: outset;
956 | border-width:2px;
957 | border-radius:10px;
958 |
959 |
960 | Reset
961 |
962 |
963 |
964 |
965 |
966 | 350
967 | 50
968 | 119
969 | 31
970 |
971 |
972 |
973 |
974 | 12
975 |
976 |
977 |
978 | border-color: rgb(162, 162, 162);
979 | border-style: outset;
980 | border-width:2px;
981 | border-radius:10px;
982 |
983 |
984 | Stop
985 |
986 |
987 |
988 |
989 |
990 | 240
991 | 200
992 | 71
993 | 41
994 |
995 |
996 |
997 | border-color: rgb(162, 162, 162);
998 | border-style: outset;
999 | border-width:2px;
1000 | border-radius:1px;
1001 |
1002 |
1003 | Qt::AlignCenter
1004 |
1005 |
1006 | 30
1007 |
1008 |
1009 |
1010 |
1011 |
1012 | 130
1013 | 200
1014 | 71
1015 | 41
1016 |
1017 |
1018 |
1019 |
1020 | 9
1021 |
1022 |
1023 |
1024 | border-color: rgb(162, 162, 162);
1025 | border-style: outset;
1026 | border-width:2px;
1027 | border-radius:1px;
1028 |
1029 |
1030 | Qt::AlignCenter
1031 |
1032 |
1033 | 1
1034 |
1035 |
1036 |
1037 |
1038 |
1039 | 20
1040 | 200
1041 | 71
1042 | 41
1043 |
1044 |
1045 |
1046 | border-color: rgb(162, 162, 162);
1047 | border-style: outset;
1048 | border-width:2px;
1049 | border-radius:1px;
1050 |
1051 |
1052 | Qt::AlignCenter
1053 |
1054 |
1055 |
1056 |
1057 |
1058 | 20
1059 | 260
1060 | 291
1061 | 31
1062 |
1063 |
1064 |
1065 | border-color: rgb(162, 162, 162);
1066 | border-style: outset;
1067 | border-width:2px;
1068 | border-radius:5px;
1069 |
1070 |
1071 | Set
1072 |
1073 |
1074 |
1075 |
1076 |
1077 | 100
1078 | 200
1079 | 21
1080 | 41
1081 |
1082 |
1083 |
1084 |
1085 | 27
1086 |
1087 |
1088 |
1089 | background-color: None;
1090 |
1091 |
1092 |
1093 | :
1094 |
1095 |
1096 | Qt::AlignCenter
1097 |
1098 |
1099 | false
1100 |
1101 |
1102 |
1103 |
1104 |
1105 | 210
1106 | 200
1107 | 21
1108 | 41
1109 |
1110 |
1111 |
1112 |
1113 | 27
1114 |
1115 |
1116 |
1117 | background-color: None;
1118 |
1119 |
1120 |
1121 | :
1122 |
1123 |
1124 | Qt::AlignCenter
1125 |
1126 |
1127 | false
1128 |
1129 |
1130 |
1131 |
1132 |
1133 | 60
1134 | 80
1135 | 201
1136 | 51
1137 |
1138 |
1139 |
1140 |
1141 | Seven Segment
1142 | 32
1143 | false
1144 | true
1145 |
1146 |
1147 |
1148 | color: rgb(154, 154, 154);
1149 | background-color: None;
1150 |
1151 |
1152 | 0 : 1 : 30
1153 |
1154 |
1155 | Qt::AlignCenter
1156 |
1157 |
1158 |
1159 |
1160 | true
1161 |
1162 |
1163 |
1164 | 20
1165 | 140
1166 | 291
1167 | 23
1168 |
1169 |
1170 |
1171 |
1172 | false
1173 | true
1174 |
1175 |
1176 |
1177 | false
1178 |
1179 |
1180 | false
1181 |
1182 |
1183 | Qt::NoFocus
1184 |
1185 |
1186 | Qt::DefaultContextMenu
1187 |
1188 |
1189 | false
1190 |
1191 |
1192 | -1
1193 |
1194 |
1195 | Qt::RightToLeft
1196 |
1197 |
1198 | false
1199 |
1200 |
1201 |
1202 |
1203 |
1204 | 100
1205 |
1206 |
1207 | Qt::AlignCenter
1208 |
1209 |
1210 | false
1211 |
1212 |
1213 | Qt::Horizontal
1214 |
1215 |
1216 | false
1217 |
1218 |
1219 | QProgressBar::BottomToTop
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1237 |
1238 |
1239 |
1240 |
--------------------------------------------------------------------------------
/Clock App/main_2.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 549
10 | 367
11 |
12 |
13 |
14 | MainWindow
15 |
16 |
17 |
18 |
19 |
20 | 0
21 | 0
22 | 851
23 | 341
24 |
25 |
26 |
27 | 1
28 |
29 |
30 |
31 | Clock
32 |
33 |
34 |
35 |
36 | 221
37 | -177
38 | 480
39 | 141
40 |
41 |
42 |
43 | true
44 |
45 |
46 | <?xml version="1.0" encoding="UTF-8"?>
47 | <ui version="4.0">
48 | <widget name="__qt_fake_top_level">
49 | <widget class="QWidget" name="widget" native="true">
50 | <property name="geometry">
51 | <rect>
52 | <x>9</x>
53 | <y>192</y>
54 | <width>356</width>
55 | <height>85</height>
56 | </rect>
57 | </property>
58 | <property name="autoFillBackground">
59 | <bool>true</bool>
60 | </property>
61 | <widget class="QLabel" name="lb_washington">
62 | <property name="geometry">
63 | <rect>
64 | <x>190</x>
65 | <y>10</y>
66 | <width>175</width>
67 | <height>62</height>
68 | </rect>
69 | </property>
70 | <property name="font">
71 | <font>
72 | <family>Centaur</family>
73 | <pointsize>16</pointsize>
74 | </font>
75 | </property>
76 | <property name="text">
77 | <string>0:0:0</string>
78 | </property>
79 | </widget>
80 | <widget class="QLabel" name="lb_tehran_5">
81 | <property name="geometry">
82 | <rect>
83 | <x>0</x>
84 | <y>10</y>
85 | <width>175</width>
86 | <height>62</height>
87 | </rect>
88 | </property>
89 | <property name="font">
90 | <font>
91 | <family>Centaur</family>
92 | <pointsize>16</pointsize>
93 | </font>
94 | </property>
95 | <property name="text">
96 | <string>Washington</string>
97 | </property>
98 | </widget>
99 | </widget>
100 | </widget>
101 | <resources/>
102 | </ui>
103 |
104 |
105 |
106 |
107 |
108 | 130
109 | 40
110 | 175
111 | 41
112 |
113 |
114 |
115 |
116 | Seven Segment
117 | 28
118 | true
119 |
120 |
121 |
122 | 0:0:0
123 |
124 |
125 | Qt::AlignCenter
126 |
127 |
128 |
129 |
130 |
131 | 0
132 | -10
133 | 491
134 | 41
135 |
136 |
137 |
138 | false
139 |
140 |
141 | background-color: rgb(255, 85, 0);
142 | color: rgb(255, 255, 255);
143 |
144 |
145 |
146 |
147 | 130
148 | -10
149 | 175
150 | 63
151 |
152 |
153 |
154 |
155 | Centaur
156 | 16
157 |
158 |
159 |
160 | Tehran
161 |
162 |
163 | Qt::AlignCenter
164 |
165 |
166 |
167 |
168 |
169 | 140
170 | 80
171 | 356
172 | 85
173 |
174 |
175 |
176 | false
177 |
178 |
179 | <?xml version="1.0" encoding="UTF-8"?>
180 | <ui version="4.0">
181 | <widget name="__qt_fake_top_level">
182 | <widget class="QWidget" name="widget" native="true">
183 | <property name="geometry">
184 | <rect>
185 | <x>9</x>
186 | <y>192</y>
187 | <width>356</width>
188 | <height>85</height>
189 | </rect>
190 | </property>
191 | <property name="autoFillBackground">
192 | <bool>true</bool>
193 | </property>
194 | <widget class="QLabel" name="lb_washington">
195 | <property name="geometry">
196 | <rect>
197 | <x>190</x>
198 | <y>10</y>
199 | <width>175</width>
200 | <height>62</height>
201 | </rect>
202 | </property>
203 | <property name="font">
204 | <font>
205 | <family>Centaur</family>
206 | <pointsize>16</pointsize>
207 | </font>
208 | </property>
209 | <property name="text">
210 | <string>0:0:0</string>
211 | </property>
212 | </widget>
213 | <widget class="QLabel" name="lb_tehran_5">
214 | <property name="geometry">
215 | <rect>
216 | <x>0</x>
217 | <y>10</y>
218 | <width>175</width>
219 | <height>62</height>
220 | </rect>
221 | </property>
222 | <property name="font">
223 | <font>
224 | <family>Centaur</family>
225 | <pointsize>16</pointsize>
226 | </font>
227 | </property>
228 | <property name="text">
229 | <string>Washington</string>
230 | </property>
231 | </widget>
232 | </widget>
233 | </widget>
234 | <resources/>
235 | </ui>
236 |
237 |
238 |
239 |
240 |
241 | 170
242 | 10
243 | 175
244 | 63
245 |
246 |
247 |
248 |
249 | Centaur
250 | 16
251 |
252 |
253 |
254 | 0:0:0
255 |
256 |
257 |
258 |
259 |
260 | 10
261 | 10
262 | 175
263 | 63
264 |
265 |
266 |
267 |
268 | Centaur
269 | 16
270 |
271 |
272 |
273 | Tehran
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 | 10
283 | 20
284 | 241
285 | 141
286 |
287 |
288 |
289 | true
290 |
291 |
292 |
293 |
294 | -10
295 | 0
296 | 501
297 | 31
298 |
299 |
300 |
301 | false
302 |
303 |
304 | background-color: rgb(255, 85, 0);
305 | color: rgb(255, 255, 255);
306 |
307 |
308 |
309 |
310 |
311 | 140
312 | 80
313 | 356
314 | 85
315 |
316 |
317 |
318 | false
319 |
320 |
321 | <?xml version="1.0" encoding="UTF-8"?>
322 | <ui version="4.0">
323 | <widget name="__qt_fake_top_level">
324 | <widget class="QWidget" name="widget" native="true">
325 | <property name="geometry">
326 | <rect>
327 | <x>9</x>
328 | <y>192</y>
329 | <width>356</width>
330 | <height>85</height>
331 | </rect>
332 | </property>
333 | <property name="autoFillBackground">
334 | <bool>true</bool>
335 | </property>
336 | <widget class="QLabel" name="lb_washington">
337 | <property name="geometry">
338 | <rect>
339 | <x>190</x>
340 | <y>10</y>
341 | <width>175</width>
342 | <height>62</height>
343 | </rect>
344 | </property>
345 | <property name="font">
346 | <font>
347 | <family>Centaur</family>
348 | <pointsize>16</pointsize>
349 | </font>
350 | </property>
351 | <property name="text">
352 | <string>0:0:0</string>
353 | </property>
354 | </widget>
355 | <widget class="QLabel" name="lb_tehran_5">
356 | <property name="geometry">
357 | <rect>
358 | <x>0</x>
359 | <y>10</y>
360 | <width>175</width>
361 | <height>62</height>
362 | </rect>
363 | </property>
364 | <property name="font">
365 | <font>
366 | <family>Centaur</family>
367 | <pointsize>16</pointsize>
368 | </font>
369 | </property>
370 | <property name="text">
371 | <string>Washington</string>
372 | </property>
373 | </widget>
374 | </widget>
375 | </widget>
376 | <resources/>
377 | </ui>
378 |
379 |
380 |
381 |
382 |
383 | 170
384 | 10
385 | 175
386 | 63
387 |
388 |
389 |
390 |
391 | Centaur
392 | 16
393 |
394 |
395 |
396 | 0:0:0
397 |
398 |
399 |
400 |
401 |
402 | 10
403 | 10
404 | 175
405 | 63
406 |
407 |
408 |
409 |
410 | Centaur
411 | 16
412 |
413 |
414 |
415 | Tehran
416 |
417 |
418 |
419 |
420 |
421 |
422 | 40
423 | -10
424 | 175
425 | 62
426 |
427 |
428 |
429 |
430 | Centaur
431 | 16
432 |
433 |
434 |
435 | Iran
436 |
437 |
438 | Qt::AlignCenter
439 |
440 |
441 |
442 |
443 |
444 |
445 | 40
446 | 60
447 | 175
448 | 41
449 |
450 |
451 |
452 |
453 | Seven Segment
454 | 28
455 | true
456 |
457 |
458 |
459 | 0:0:0
460 |
461 |
462 | Qt::AlignCenter
463 |
464 |
465 |
466 |
467 |
468 |
469 | 0
470 | 190
471 | 261
472 | 141
473 |
474 |
475 |
476 | true
477 |
478 |
479 |
480 |
481 | 0
482 | 0
483 | 491
484 | 31
485 |
486 |
487 |
488 | false
489 |
490 |
491 | background-color: rgb(255, 85, 0);
492 | color: rgb(255, 255, 255);
493 |
494 |
495 |
496 |
497 | 140
498 | 80
499 | 356
500 | 85
501 |
502 |
503 |
504 | false
505 |
506 |
507 | <?xml version="1.0" encoding="UTF-8"?>
508 | <ui version="4.0">
509 | <widget name="__qt_fake_top_level">
510 | <widget class="QWidget" name="widget" native="true">
511 | <property name="geometry">
512 | <rect>
513 | <x>9</x>
514 | <y>192</y>
515 | <width>356</width>
516 | <height>85</height>
517 | </rect>
518 | </property>
519 | <property name="autoFillBackground">
520 | <bool>true</bool>
521 | </property>
522 | <widget class="QLabel" name="lb_washington">
523 | <property name="geometry">
524 | <rect>
525 | <x>190</x>
526 | <y>10</y>
527 | <width>175</width>
528 | <height>62</height>
529 | </rect>
530 | </property>
531 | <property name="font">
532 | <font>
533 | <family>Centaur</family>
534 | <pointsize>16</pointsize>
535 | </font>
536 | </property>
537 | <property name="text">
538 | <string>0:0:0</string>
539 | </property>
540 | </widget>
541 | <widget class="QLabel" name="lb_tehran_5">
542 | <property name="geometry">
543 | <rect>
544 | <x>0</x>
545 | <y>10</y>
546 | <width>175</width>
547 | <height>62</height>
548 | </rect>
549 | </property>
550 | <property name="font">
551 | <font>
552 | <family>Centaur</family>
553 | <pointsize>16</pointsize>
554 | </font>
555 | </property>
556 | <property name="text">
557 | <string>Washington</string>
558 | </property>
559 | </widget>
560 | </widget>
561 | </widget>
562 | <resources/>
563 | </ui>
564 |
565 |
566 |
567 |
568 |
569 | 170
570 | 10
571 | 175
572 | 63
573 |
574 |
575 |
576 |
577 | Centaur
578 | 16
579 |
580 |
581 |
582 | 0:0:0
583 |
584 |
585 |
586 |
587 |
588 | 10
589 | 10
590 | 175
591 | 63
592 |
593 |
594 |
595 |
596 | Centaur
597 | 16
598 |
599 |
600 |
601 | Tehran
602 |
603 |
604 |
605 |
606 |
607 |
608 | 50
609 | -10
610 | 175
611 | 41
612 |
613 |
614 |
615 |
616 | Centaur
617 | 16
618 |
619 |
620 |
621 | Germeny
622 |
623 |
624 | Qt::AlignCenter
625 |
626 |
627 |
628 |
629 |
630 |
631 | 60
632 | 50
633 | 175
634 | 41
635 |
636 |
637 |
638 |
639 | Seven Segment
640 | 28
641 | true
642 |
643 |
644 |
645 | 0:0:0
646 |
647 |
648 | Qt::AlignCenter
649 |
650 |
651 |
652 |
653 |
654 |
655 | 270
656 | 20
657 | 271
658 | 141
659 |
660 |
661 |
662 | true
663 |
664 |
665 |
666 |
667 | 0
668 | 0
669 | 491
670 | 31
671 |
672 |
673 |
674 | false
675 |
676 |
677 | background-color: rgb(255, 85, 0);
678 | color: rgb(255, 255, 255);
679 |
680 |
681 |
682 |
683 | 140
684 | 80
685 | 356
686 | 85
687 |
688 |
689 |
690 | false
691 |
692 |
693 | <?xml version="1.0" encoding="UTF-8"?>
694 | <ui version="4.0">
695 | <widget name="__qt_fake_top_level">
696 | <widget class="QWidget" name="widget" native="true">
697 | <property name="geometry">
698 | <rect>
699 | <x>9</x>
700 | <y>192</y>
701 | <width>356</width>
702 | <height>85</height>
703 | </rect>
704 | </property>
705 | <property name="autoFillBackground">
706 | <bool>true</bool>
707 | </property>
708 | <widget class="QLabel" name="lb_washington">
709 | <property name="geometry">
710 | <rect>
711 | <x>190</x>
712 | <y>10</y>
713 | <width>175</width>
714 | <height>62</height>
715 | </rect>
716 | </property>
717 | <property name="font">
718 | <font>
719 | <family>Centaur</family>
720 | <pointsize>16</pointsize>
721 | </font>
722 | </property>
723 | <property name="text">
724 | <string>0:0:0</string>
725 | </property>
726 | </widget>
727 | <widget class="QLabel" name="lb_tehran_5">
728 | <property name="geometry">
729 | <rect>
730 | <x>0</x>
731 | <y>10</y>
732 | <width>175</width>
733 | <height>62</height>
734 | </rect>
735 | </property>
736 | <property name="font">
737 | <font>
738 | <family>Centaur</family>
739 | <pointsize>16</pointsize>
740 | </font>
741 | </property>
742 | <property name="text">
743 | <string>Washington</string>
744 | </property>
745 | </widget>
746 | </widget>
747 | </widget>
748 | <resources/>
749 | </ui>
750 |
751 |
752 |
753 |
754 |
755 | 170
756 | 10
757 | 175
758 | 63
759 |
760 |
761 |
762 |
763 | Centaur
764 | 16
765 |
766 |
767 |
768 | 0:0:0
769 |
770 |
771 |
772 |
773 |
774 | 10
775 | 10
776 | 175
777 | 63
778 |
779 |
780 |
781 |
782 | Centaur
783 | 16
784 |
785 |
786 |
787 | Tehran
788 |
789 |
790 |
791 |
792 |
793 |
794 | 60
795 | 0
796 | 175
797 | 41
798 |
799 |
800 |
801 |
802 | Centaur
803 | 16
804 |
805 |
806 |
807 | USA
808 |
809 |
810 | Qt::AlignCenter
811 |
812 |
813 |
814 |
815 |
816 |
817 | 60
818 | 60
819 | 175
820 | 41
821 |
822 |
823 |
824 |
825 | Seven Segment
826 | 28
827 | true
828 |
829 |
830 |
831 | 0:0:0
832 |
833 |
834 | Qt::AlignCenter
835 |
836 |
837 |
838 |
839 |
840 |
841 | Alarm
842 |
843 |
844 |
845 |
846 | 0
847 | 0
848 | 531
849 | 321
850 |
851 |
852 |
853 | 0
854 |
855 |
856 |
857 | Alarms
858 |
859 |
860 |
861 |
862 | 10
863 | 0
864 | 511
865 | 261
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 | Add Alarm
874 |
875 |
876 |
877 |
878 | 70
879 | 20
880 | 60
881 | 60
882 |
883 |
884 |
885 |
886 | 60
887 | 60
888 |
889 |
890 |
891 |
892 | 60
893 | 60
894 |
895 |
896 |
897 |
898 | 10
899 |
900 |
901 |
902 | PointingHandCursor
903 |
904 |
905 | border: 0px; border-radius: 30px; background-color: #000; color: #fff;
906 |
907 |
908 | Add
909 |
910 |
911 |
912 |
913 |
914 | 290
915 | 30
916 | 221
917 | 31
918 |
919 |
920 |
921 |
922 | 14
923 |
924 |
925 |
926 | hh:mm:ss
927 |
928 |
929 |
930 |
931 |
932 | 290
933 | 0
934 | 58
935 | 19
936 |
937 |
938 |
939 | Timer
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 | Timer
948 |
949 |
950 |
951 |
952 | 10
953 | 0
954 | 531
955 | 181
956 |
957 |
958 |
959 | -
960 |
961 |
962 |
963 | 15
964 | 70
965 |
966 |
967 |
968 |
969 | 15
970 | 70
971 |
972 |
973 |
974 |
975 | Seven Segment
976 | 40
977 |
978 |
979 |
980 | :
981 |
982 |
983 | Qt::AlignCenter
984 |
985 |
986 |
987 | -
988 |
989 |
990 |
991 | 70
992 | 70
993 |
994 |
995 |
996 |
997 | 70
998 | 70
999 |
1000 |
1001 |
1002 |
1003 | Seven Segment
1004 | 40
1005 |
1006 |
1007 |
1008 | 15
1009 |
1010 |
1011 | Qt::AlignCenter
1012 |
1013 |
1014 |
1015 | -
1016 |
1017 |
1018 |
1019 | 70
1020 | 70
1021 |
1022 |
1023 |
1024 |
1025 | 70
1026 | 70
1027 |
1028 |
1029 |
1030 |
1031 | Seven Segment
1032 | 40
1033 |
1034 |
1035 |
1036 | 0
1037 |
1038 |
1039 | Qt::AlignCenter
1040 |
1041 |
1042 |
1043 | -
1044 |
1045 |
1046 |
1047 | 15
1048 | 70
1049 |
1050 |
1051 |
1052 |
1053 | 15
1054 | 70
1055 |
1056 |
1057 |
1058 |
1059 | Seven Segment
1060 | 40
1061 |
1062 |
1063 |
1064 | :
1065 |
1066 |
1067 | Qt::AlignCenter
1068 |
1069 |
1070 |
1071 | -
1072 |
1073 |
1074 |
1075 | 70
1076 | 70
1077 |
1078 |
1079 |
1080 |
1081 | 70
1082 | 70
1083 |
1084 |
1085 |
1086 |
1087 | Seven Segment
1088 | 40
1089 |
1090 |
1091 |
1092 | 0
1093 |
1094 |
1095 | Qt::AlignCenter
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 |
1104 | 30
1105 | 220
1106 | 241
1107 | 27
1108 |
1109 |
1110 |
1111 | stop
1112 |
1113 |
1114 |
1115 |
1116 |
1117 | 300
1118 | 220
1119 | 210
1120 | 27
1121 |
1122 |
1123 |
1124 | Start
1125 |
1126 |
1127 |
1128 |
1129 |
1130 | Stop Watch
1131 |
1132 |
1133 |
1134 |
1135 | 11
1136 | 0
1137 | 551
1138 | 201
1139 |
1140 |
1141 |
1142 | -
1143 |
1144 |
1145 | start
1146 |
1147 |
1148 |
1149 | -
1150 |
1151 |
1152 | Rest
1153 |
1154 |
1155 |
1156 | -
1157 |
1158 |
1159 | stop
1160 |
1161 |
1162 |
1163 | -
1164 |
1165 |
1166 |
1167 | 0
1168 | 120
1169 |
1170 |
1171 |
1172 |
1173 | Seven Segment
1174 | 55
1175 |
1176 |
1177 |
1178 | 0:0:0
1179 |
1180 |
1181 | Qt::AlignCenter
1182 |
1183 |
1184 |
1185 |
1186 |
1187 |
1188 |
1189 |
1190 |
1200 |
1201 |
1202 |
1203 |
1204 |
1205 |
--------------------------------------------------------------------------------
/Clock App/main_window.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'main_2.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.2
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15 | QFont, QFontDatabase, QGradient, QIcon,
16 | QImage, QKeySequence, QLinearGradient, QPainter,
17 | QPalette, QPixmap, QRadialGradient, QTransform)
18 | from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QLineEdit,
19 | QMainWindow, QMenuBar, QPushButton, QSizePolicy,
20 | QStatusBar, QTabWidget, QTimeEdit, QWidget)
21 |
22 | class Ui_MainWindow(object):
23 | def setupUi(self, MainWindow):
24 | if not MainWindow.objectName():
25 | MainWindow.setObjectName(u"MainWindow")
26 | MainWindow.resize(549, 367)
27 | self.centralwidget = QWidget(MainWindow)
28 | self.centralwidget.setObjectName(u"centralwidget")
29 | self.tabWidget = QTabWidget(self.centralwidget)
30 | self.tabWidget.setObjectName(u"tabWidget")
31 | self.tabWidget.setGeometry(QRect(0, 0, 851, 341))
32 | self.tab = QWidget()
33 | self.tab.setObjectName(u"tab")
34 | self.widget_3 = QWidget(self.tab)
35 | self.widget_3.setObjectName(u"widget_3")
36 | self.widget_3.setGeometry(QRect(221, -177, 480, 141))
37 | self.widget_3.setAutoFillBackground(True)
38 | self.widget_3.setStyleSheet(u"\n"
39 | "\n"
40 | " \n"
41 | " \n"
42 | " \n"
43 | " \n"
44 | " 9\n"
45 | " 192\n"
46 | " 356\n"
47 | " 85\n"
48 | " \n"
49 | " \n"
50 | " \n"
51 | " true\n"
52 | " \n"
53 | " \n"
54 | " \n"
55 | " \n"
56 | " 190\n"
57 | " 10\n"
58 | " 175\n"
59 | " 62\n"
60 | " \n"
61 | " \n"
62 | " \n"
63 | " \n"
64 | " Centaur\n"
65 | " 16\n"
66 | " \n"
67 | " \n"
68 | " \n"
69 | " 0:0:0\n"
70 | " \n"
71 | " \n"
72 | " \n"
73 | " \n"
75 | " \n"
76 | " 0\n"
77 | " 10\n"
78 | " 175\n"
79 | " 62\n"
80 | " \n"
81 | " \n"
82 | " \n"
83 | " \n"
84 | " Centaur\n"
85 | " 16\n"
86 | " \n"
87 | " \n"
88 | " \n"
89 | " Washington\n"
90 | " \n"
91 | " \n"
92 | " \n"
93 | " \n"
94 | " \n"
95 | "\n"
96 | "")
97 | self.lb_tehran = QLabel(self.widget_3)
98 | self.lb_tehran.setObjectName(u"lb_tehran")
99 | self.lb_tehran.setGeometry(QRect(130, 40, 175, 41))
100 | font = QFont()
101 | font.setFamilies([u"Seven Segment"])
102 | font.setPointSize(28)
103 | font.setBold(True)
104 | self.lb_tehran.setFont(font)
105 | self.lb_tehran.setAlignment(Qt.AlignCenter)
106 | self.widget_5 = QWidget(self.widget_3)
107 | self.widget_5.setObjectName(u"widget_5")
108 | self.widget_5.setGeometry(QRect(0, -10, 491, 41))
109 | self.widget_5.setAutoFillBackground(False)
110 | self.widget_5.setStyleSheet(u"background-color: rgb(255, 85, 0);\n"
111 | "color: rgb(255, 255, 255);")
112 | self.lb_tehran_8 = QLabel(self.widget_5)
113 | self.lb_tehran_8.setObjectName(u"lb_tehran_8")
114 | self.lb_tehran_8.setGeometry(QRect(130, -10, 175, 63))
115 | font1 = QFont()
116 | font1.setFamilies([u"Centaur"])
117 | font1.setPointSize(16)
118 | self.lb_tehran_8.setFont(font1)
119 | self.lb_tehran_8.setAlignment(Qt.AlignCenter)
120 | self.widget_6 = QWidget(self.widget_5)
121 | self.widget_6.setObjectName(u"widget_6")
122 | self.widget_6.setGeometry(QRect(140, 80, 356, 85))
123 | self.widget_6.setAutoFillBackground(False)
124 | self.widget_6.setStyleSheet(u"\n"
125 | "\n"
126 | " \n"
127 | " \n"
128 | " \n"
129 | " \n"
130 | " 9\n"
131 | " 192\n"
132 | " 356\n"
133 | " 85\n"
134 | " \n"
135 | " \n"
136 | " \n"
137 | " true\n"
138 | " \n"
139 | " \n"
140 | " \n"
141 | " \n"
142 | " 190\n"
143 | " 10\n"
144 | " 175\n"
145 | " 62\n"
146 | " \n"
147 | " \n"
148 | " \n"
149 | " \n"
150 | " Centaur\n"
151 | " 16\n"
152 | " \n"
153 | " \n"
154 | " \n"
155 | " 0:0:0\n"
156 | " \n"
157 | " \n"
158 | " \n"
159 | " \n"
161 | " \n"
162 | " 0\n"
163 | " 10\n"
164 | " 175\n"
165 | " 62\n"
166 | " \n"
167 | " \n"
168 | " \n"
169 | " \n"
170 | " Centaur\n"
171 | " 16\n"
172 | " \n"
173 | " \n"
174 | " \n"
175 | " Washington\n"
176 | " \n"
177 | " \n"
178 | " \n"
179 | " \n"
180 | " \n"
181 | "\n"
182 | "")
183 | self.lb_tehran_9 = QLabel(self.widget_6)
184 | self.lb_tehran_9.setObjectName(u"lb_tehran_9")
185 | self.lb_tehran_9.setGeometry(QRect(170, 10, 175, 63))
186 | self.lb_tehran_9.setFont(font1)
187 | self.lb_tehran_10 = QLabel(self.widget_6)
188 | self.lb_tehran_10.setObjectName(u"lb_tehran_10")
189 | self.lb_tehran_10.setGeometry(QRect(10, 10, 175, 63))
190 | self.lb_tehran_10.setFont(font1)
191 | self.widget_2 = QWidget(self.tab)
192 | self.widget_2.setObjectName(u"widget_2")
193 | self.widget_2.setGeometry(QRect(10, 20, 241, 141))
194 | self.widget_2.setAutoFillBackground(True)
195 | self.widget_7 = QWidget(self.widget_2)
196 | self.widget_7.setObjectName(u"widget_7")
197 | self.widget_7.setGeometry(QRect(-10, 0, 501, 31))
198 | self.widget_7.setAutoFillBackground(False)
199 | self.widget_7.setStyleSheet(u"background-color: rgb(255, 85, 0);\n"
200 | "color: rgb(255, 255, 255);\n"
201 | "")
202 | self.widget_8 = QWidget(self.widget_7)
203 | self.widget_8.setObjectName(u"widget_8")
204 | self.widget_8.setGeometry(QRect(140, 80, 356, 85))
205 | self.widget_8.setAutoFillBackground(False)
206 | self.widget_8.setStyleSheet(u"\n"
207 | "\n"
208 | " \n"
209 | " \n"
210 | " \n"
211 | " \n"
212 | " 9\n"
213 | " 192\n"
214 | " 356\n"
215 | " 85\n"
216 | " \n"
217 | " \n"
218 | " \n"
219 | " true\n"
220 | " \n"
221 | " \n"
222 | " \n"
223 | " \n"
224 | " 190\n"
225 | " 10\n"
226 | " 175\n"
227 | " 62\n"
228 | " \n"
229 | " \n"
230 | " \n"
231 | " \n"
232 | " Centaur\n"
233 | " 16\n"
234 | " \n"
235 | " \n"
236 | " \n"
237 | " 0:0:0\n"
238 | " \n"
239 | " \n"
240 | " \n"
241 | " \n"
243 | " \n"
244 | " 0\n"
245 | " 10\n"
246 | " 175\n"
247 | " 62\n"
248 | " \n"
249 | " \n"
250 | " \n"
251 | " \n"
252 | " Centaur\n"
253 | " 16\n"
254 | " \n"
255 | " \n"
256 | " \n"
257 | " Washington\n"
258 | " \n"
259 | " \n"
260 | " \n"
261 | " \n"
262 | " \n"
263 | "\n"
264 | "")
265 | self.lb_tehran_12 = QLabel(self.widget_8)
266 | self.lb_tehran_12.setObjectName(u"lb_tehran_12")
267 | self.lb_tehran_12.setGeometry(QRect(170, 10, 175, 63))
268 | self.lb_tehran_12.setFont(font1)
269 | self.lb_tehran_13 = QLabel(self.widget_8)
270 | self.lb_tehran_13.setObjectName(u"lb_tehran_13")
271 | self.lb_tehran_13.setGeometry(QRect(10, 10, 175, 63))
272 | self.lb_tehran_13.setFont(font1)
273 | self.lb_tehran_3 = QLabel(self.widget_7)
274 | self.lb_tehran_3.setObjectName(u"lb_tehran_3")
275 | self.lb_tehran_3.setGeometry(QRect(40, -10, 175, 62))
276 | self.lb_tehran_3.setFont(font1)
277 | self.lb_tehran_3.setAlignment(Qt.AlignCenter)
278 | self.tehran = QLabel(self.widget_2)
279 | self.tehran.setObjectName(u"tehran")
280 | self.tehran.setGeometry(QRect(40, 60, 175, 41))
281 | self.tehran.setFont(font)
282 | self.tehran.setAlignment(Qt.AlignCenter)
283 | self.widget = QWidget(self.tab)
284 | self.widget.setObjectName(u"widget")
285 | self.widget.setGeometry(QRect(0, 190, 261, 141))
286 | self.widget.setAutoFillBackground(True)
287 | self.widget_9 = QWidget(self.widget)
288 | self.widget_9.setObjectName(u"widget_9")
289 | self.widget_9.setGeometry(QRect(0, 0, 491, 31))
290 | self.widget_9.setAutoFillBackground(False)
291 | self.widget_9.setStyleSheet(u"background-color: rgb(255, 85, 0);\n"
292 | "color: rgb(255, 255, 255);")
293 | self.widget_10 = QWidget(self.widget_9)
294 | self.widget_10.setObjectName(u"widget_10")
295 | self.widget_10.setGeometry(QRect(140, 80, 356, 85))
296 | self.widget_10.setAutoFillBackground(False)
297 | self.widget_10.setStyleSheet(u"\n"
298 | "\n"
299 | " \n"
300 | " \n"
301 | " \n"
302 | " \n"
303 | " 9\n"
304 | " 192\n"
305 | " 356\n"
306 | " 85\n"
307 | " \n"
308 | " \n"
309 | " \n"
310 | " true\n"
311 | " \n"
312 | " \n"
313 | " \n"
314 | " \n"
315 | " 190\n"
316 | " 10\n"
317 | " 175\n"
318 | " 62\n"
319 | " \n"
320 | " \n"
321 | " \n"
322 | " \n"
323 | " Centaur\n"
324 | " 16\n"
325 | " \n"
326 | " \n"
327 | " \n"
328 | " 0:0:0\n"
329 | " \n"
330 | " \n"
331 | " \n"
332 | " \n"
334 | " \n"
335 | " 0\n"
336 | " 10\n"
337 | " 175\n"
338 | " 62\n"
339 | " \n"
340 | " \n"
341 | " \n"
342 | " \n"
343 | " Centaur\n"
344 | " 16\n"
345 | " \n"
346 | " \n"
347 | " \n"
348 | " Washington\n"
349 | " \n"
350 | " \n"
351 | " \n"
352 | " \n"
353 | " \n"
354 | "\n"
355 | "")
356 | self.lb_tehran_14 = QLabel(self.widget_10)
357 | self.lb_tehran_14.setObjectName(u"lb_tehran_14")
358 | self.lb_tehran_14.setGeometry(QRect(170, 10, 175, 63))
359 | self.lb_tehran_14.setFont(font1)
360 | self.lb_tehran_15 = QLabel(self.widget_10)
361 | self.lb_tehran_15.setObjectName(u"lb_tehran_15")
362 | self.lb_tehran_15.setGeometry(QRect(10, 10, 175, 63))
363 | self.lb_tehran_15.setFont(font1)
364 | self.lb_tehran_5 = QLabel(self.widget_9)
365 | self.lb_tehran_5.setObjectName(u"lb_tehran_5")
366 | self.lb_tehran_5.setGeometry(QRect(50, -10, 175, 41))
367 | self.lb_tehran_5.setFont(font1)
368 | self.lb_tehran_5.setAlignment(Qt.AlignCenter)
369 | self.berlin = QLabel(self.widget)
370 | self.berlin.setObjectName(u"berlin")
371 | self.berlin.setGeometry(QRect(60, 50, 175, 41))
372 | self.berlin.setFont(font)
373 | self.berlin.setAlignment(Qt.AlignCenter)
374 | self.widget_4 = QWidget(self.tab)
375 | self.widget_4.setObjectName(u"widget_4")
376 | self.widget_4.setGeometry(QRect(270, 20, 271, 141))
377 | self.widget_4.setAutoFillBackground(True)
378 | self.widget_11 = QWidget(self.widget_4)
379 | self.widget_11.setObjectName(u"widget_11")
380 | self.widget_11.setGeometry(QRect(0, 0, 491, 31))
381 | self.widget_11.setAutoFillBackground(False)
382 | self.widget_11.setStyleSheet(u"background-color: rgb(255, 85, 0);\n"
383 | "color: rgb(255, 255, 255);")
384 | self.widget_12 = QWidget(self.widget_11)
385 | self.widget_12.setObjectName(u"widget_12")
386 | self.widget_12.setGeometry(QRect(140, 80, 356, 85))
387 | self.widget_12.setAutoFillBackground(False)
388 | self.widget_12.setStyleSheet(u"\n"
389 | "\n"
390 | " \n"
391 | " \n"
392 | " \n"
393 | " \n"
394 | " 9\n"
395 | " 192\n"
396 | " 356\n"
397 | " 85\n"
398 | " \n"
399 | " \n"
400 | " \n"
401 | " true\n"
402 | " \n"
403 | " \n"
404 | " \n"
405 | " \n"
406 | " 190\n"
407 | " 10\n"
408 | " 175\n"
409 | " 62\n"
410 | " \n"
411 | " \n"
412 | " \n"
413 | " \n"
414 | " Centaur\n"
415 | " 16\n"
416 | " \n"
417 | " \n"
418 | " \n"
419 | " 0:0:0\n"
420 | " \n"
421 | " \n"
422 | " \n"
423 | " \n"
425 | " \n"
426 | " 0\n"
427 | " 10\n"
428 | " 175\n"
429 | " 62\n"
430 | " \n"
431 | " \n"
432 | " \n"
433 | " \n"
434 | " Centaur\n"
435 | " 16\n"
436 | " \n"
437 | " \n"
438 | " \n"
439 | " Washington\n"
440 | " \n"
441 | " \n"
442 | " \n"
443 | " \n"
444 | " \n"
445 | "\n"
446 | "")
447 | self.lb_tehran_16 = QLabel(self.widget_12)
448 | self.lb_tehran_16.setObjectName(u"lb_tehran_16")
449 | self.lb_tehran_16.setGeometry(QRect(170, 10, 175, 63))
450 | self.lb_tehran_16.setFont(font1)
451 | self.lb_tehran_17 = QLabel(self.widget_12)
452 | self.lb_tehran_17.setObjectName(u"lb_tehran_17")
453 | self.lb_tehran_17.setGeometry(QRect(10, 10, 175, 63))
454 | self.lb_tehran_17.setFont(font1)
455 | self.lb_tehran_6 = QLabel(self.widget_11)
456 | self.lb_tehran_6.setObjectName(u"lb_tehran_6")
457 | self.lb_tehran_6.setGeometry(QRect(60, 0, 175, 41))
458 | self.lb_tehran_6.setFont(font1)
459 | self.lb_tehran_6.setAlignment(Qt.AlignCenter)
460 | self.washington = QLabel(self.widget_4)
461 | self.washington.setObjectName(u"washington")
462 | self.washington.setGeometry(QRect(60, 60, 175, 41))
463 | self.washington.setFont(font)
464 | self.washington.setAlignment(Qt.AlignCenter)
465 | self.tabWidget.addTab(self.tab, "")
466 | self.tab_2 = QWidget()
467 | self.tab_2.setObjectName(u"tab_2")
468 | self.tabWidget_2 = QTabWidget(self.tab_2)
469 | self.tabWidget_2.setObjectName(u"tabWidget_2")
470 | self.tabWidget_2.setGeometry(QRect(0, 0, 531, 321))
471 | self.tab_5 = QWidget()
472 | self.tab_5.setObjectName(u"tab_5")
473 | self.gridLayoutWidget_2 = QWidget(self.tab_5)
474 | self.gridLayoutWidget_2.setObjectName(u"gridLayoutWidget_2")
475 | self.gridLayoutWidget_2.setGeometry(QRect(10, 0, 511, 261))
476 | self.gl_alarms = QGridLayout(self.gridLayoutWidget_2)
477 | self.gl_alarms.setObjectName(u"gl_alarms")
478 | self.gl_alarms.setContentsMargins(0, 0, 0, 0)
479 | self.tabWidget_2.addTab(self.tab_5, "")
480 | self.tab_6 = QWidget()
481 | self.tab_6.setObjectName(u"tab_6")
482 | self.btn_addalarm = QPushButton(self.tab_6)
483 | self.btn_addalarm.setObjectName(u"btn_addalarm")
484 | self.btn_addalarm.setGeometry(QRect(70, 20, 60, 60))
485 | self.btn_addalarm.setMinimumSize(QSize(60, 60))
486 | self.btn_addalarm.setMaximumSize(QSize(60, 60))
487 | font2 = QFont()
488 | font2.setPointSize(10)
489 | self.btn_addalarm.setFont(font2)
490 | self.btn_addalarm.setCursor(QCursor(Qt.PointingHandCursor))
491 | self.btn_addalarm.setStyleSheet(u"border: 0px; border-radius: 30px; background-color: #000; color: #fff;")
492 | self.timeEdit = QTimeEdit(self.tab_6)
493 | self.timeEdit.setObjectName(u"timeEdit")
494 | self.timeEdit.setGeometry(QRect(290, 30, 221, 31))
495 | font3 = QFont()
496 | font3.setPointSize(14)
497 | self.timeEdit.setFont(font3)
498 | self.label_2 = QLabel(self.tab_6)
499 | self.label_2.setObjectName(u"label_2")
500 | self.label_2.setGeometry(QRect(290, 0, 58, 19))
501 | self.tabWidget_2.addTab(self.tab_6, "")
502 | self.tabWidget.addTab(self.tab_2, "")
503 | self.tab_4 = QWidget()
504 | self.tab_4.setObjectName(u"tab_4")
505 | self.layoutWidget_2 = QWidget(self.tab_4)
506 | self.layoutWidget_2.setObjectName(u"layoutWidget_2")
507 | self.layoutWidget_2.setGeometry(QRect(10, 0, 531, 181))
508 | self.gridLayout_14 = QGridLayout(self.layoutWidget_2)
509 | self.gridLayout_14.setObjectName(u"gridLayout_14")
510 | self.gridLayout_14.setContentsMargins(0, 0, 0, 0)
511 | self.lineEdit_6 = QLineEdit(self.layoutWidget_2)
512 | self.lineEdit_6.setObjectName(u"lineEdit_6")
513 | self.lineEdit_6.setMinimumSize(QSize(15, 70))
514 | self.lineEdit_6.setMaximumSize(QSize(15, 70))
515 | font4 = QFont()
516 | font4.setFamilies([u"Seven Segment"])
517 | font4.setPointSize(40)
518 | self.lineEdit_6.setFont(font4)
519 | self.lineEdit_6.setAlignment(Qt.AlignCenter)
520 |
521 | self.gridLayout_14.addWidget(self.lineEdit_6, 0, 1, 1, 1)
522 |
523 | self.tb_hour_timer_2 = QLineEdit(self.layoutWidget_2)
524 | self.tb_hour_timer_2.setObjectName(u"tb_hour_timer_2")
525 | self.tb_hour_timer_2.setMinimumSize(QSize(70, 70))
526 | self.tb_hour_timer_2.setMaximumSize(QSize(70, 70))
527 | self.tb_hour_timer_2.setFont(font4)
528 | self.tb_hour_timer_2.setAlignment(Qt.AlignCenter)
529 |
530 | self.gridLayout_14.addWidget(self.tb_hour_timer_2, 0, 2, 1, 1)
531 |
532 | self.tb_minute_timer_2 = QLineEdit(self.layoutWidget_2)
533 | self.tb_minute_timer_2.setObjectName(u"tb_minute_timer_2")
534 | self.tb_minute_timer_2.setMinimumSize(QSize(70, 70))
535 | self.tb_minute_timer_2.setMaximumSize(QSize(70, 70))
536 | self.tb_minute_timer_2.setFont(font4)
537 | self.tb_minute_timer_2.setAlignment(Qt.AlignCenter)
538 |
539 | self.gridLayout_14.addWidget(self.tb_minute_timer_2, 0, 0, 1, 1)
540 |
541 | self.lineEdit_7 = QLineEdit(self.layoutWidget_2)
542 | self.lineEdit_7.setObjectName(u"lineEdit_7")
543 | self.lineEdit_7.setMinimumSize(QSize(15, 70))
544 | self.lineEdit_7.setMaximumSize(QSize(15, 70))
545 | self.lineEdit_7.setFont(font4)
546 | self.lineEdit_7.setAlignment(Qt.AlignCenter)
547 |
548 | self.gridLayout_14.addWidget(self.lineEdit_7, 0, 3, 1, 1)
549 |
550 | self.tb_second_timer_2 = QLineEdit(self.layoutWidget_2)
551 | self.tb_second_timer_2.setObjectName(u"tb_second_timer_2")
552 | self.tb_second_timer_2.setMinimumSize(QSize(70, 70))
553 | self.tb_second_timer_2.setMaximumSize(QSize(70, 70))
554 | self.tb_second_timer_2.setFont(font4)
555 | self.tb_second_timer_2.setAlignment(Qt.AlignCenter)
556 |
557 | self.gridLayout_14.addWidget(self.tb_second_timer_2, 0, 4, 1, 1)
558 |
559 | self.btn_stop_timer = QPushButton(self.tab_4)
560 | self.btn_stop_timer.setObjectName(u"btn_stop_timer")
561 | self.btn_stop_timer.setGeometry(QRect(30, 220, 241, 27))
562 | self.btn_start_timer = QPushButton(self.tab_4)
563 | self.btn_start_timer.setObjectName(u"btn_start_timer")
564 | self.btn_start_timer.setGeometry(QRect(300, 220, 210, 27))
565 | self.tabWidget.addTab(self.tab_4, "")
566 | self.tab_3 = QWidget()
567 | self.tab_3.setObjectName(u"tab_3")
568 | self.layoutWidget = QWidget(self.tab_3)
569 | self.layoutWidget.setObjectName(u"layoutWidget")
570 | self.layoutWidget.setGeometry(QRect(11, 0, 551, 201))
571 | self.gridLayout_13 = QGridLayout(self.layoutWidget)
572 | self.gridLayout_13.setObjectName(u"gridLayout_13")
573 | self.gridLayout_13.setContentsMargins(0, 0, 0, 0)
574 | self.start_sw = QPushButton(self.layoutWidget)
575 | self.start_sw.setObjectName(u"start_sw")
576 |
577 | self.gridLayout_13.addWidget(self.start_sw, 1, 1, 1, 1)
578 |
579 | self.reset_sw = QPushButton(self.layoutWidget)
580 | self.reset_sw.setObjectName(u"reset_sw")
581 |
582 | self.gridLayout_13.addWidget(self.reset_sw, 1, 2, 1, 1)
583 |
584 | self.stop_sw = QPushButton(self.layoutWidget)
585 | self.stop_sw.setObjectName(u"stop_sw")
586 |
587 | self.gridLayout_13.addWidget(self.stop_sw, 1, 0, 1, 1)
588 |
589 | self.stop_watch = QLabel(self.layoutWidget)
590 | self.stop_watch.setObjectName(u"stop_watch")
591 | self.stop_watch.setMinimumSize(QSize(0, 120))
592 | font5 = QFont()
593 | font5.setFamilies([u"Seven Segment"])
594 | font5.setPointSize(55)
595 | self.stop_watch.setFont(font5)
596 | self.stop_watch.setAlignment(Qt.AlignCenter)
597 |
598 | self.gridLayout_13.addWidget(self.stop_watch, 2, 1, 1, 1)
599 |
600 | self.tabWidget.addTab(self.tab_3, "")
601 | MainWindow.setCentralWidget(self.centralwidget)
602 | self.menubar = QMenuBar(MainWindow)
603 | self.menubar.setObjectName(u"menubar")
604 | self.menubar.setGeometry(QRect(0, 0, 549, 25))
605 | MainWindow.setMenuBar(self.menubar)
606 | self.statusbar = QStatusBar(MainWindow)
607 | self.statusbar.setObjectName(u"statusbar")
608 | MainWindow.setStatusBar(self.statusbar)
609 |
610 | self.retranslateUi(MainWindow)
611 |
612 | self.tabWidget.setCurrentIndex(1)
613 | self.tabWidget_2.setCurrentIndex(0)
614 |
615 |
616 | QMetaObject.connectSlotsByName(MainWindow)
617 | # setupUi
618 |
619 | def retranslateUi(self, MainWindow):
620 | MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
621 | self.lb_tehran.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
622 | self.lb_tehran_8.setText(QCoreApplication.translate("MainWindow", u"Tehran", None))
623 | self.lb_tehran_9.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
624 | self.lb_tehran_10.setText(QCoreApplication.translate("MainWindow", u"Tehran", None))
625 | self.lb_tehran_12.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
626 | self.lb_tehran_13.setText(QCoreApplication.translate("MainWindow", u"Tehran", None))
627 | self.lb_tehran_3.setText(QCoreApplication.translate("MainWindow", u"Iran", None))
628 | self.tehran.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
629 | self.lb_tehran_14.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
630 | self.lb_tehran_15.setText(QCoreApplication.translate("MainWindow", u"Tehran", None))
631 | self.lb_tehran_5.setText(QCoreApplication.translate("MainWindow", u"Germeny", None))
632 | self.berlin.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
633 | self.lb_tehran_16.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
634 | self.lb_tehran_17.setText(QCoreApplication.translate("MainWindow", u"Tehran", None))
635 | self.lb_tehran_6.setText(QCoreApplication.translate("MainWindow", u"USA", None))
636 | self.washington.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
637 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("MainWindow", u"Clock", None))
638 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_5), QCoreApplication.translate("MainWindow", u"Alarms", None))
639 | self.btn_addalarm.setText(QCoreApplication.translate("MainWindow", u"Add", None))
640 | self.timeEdit.setDisplayFormat(QCoreApplication.translate("MainWindow", u"hh:mm:ss", None))
641 | self.label_2.setText(QCoreApplication.translate("MainWindow", u"Timer", None))
642 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_6), QCoreApplication.translate("MainWindow", u"Add Alarm", None))
643 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("MainWindow", u"Alarm", None))
644 | self.lineEdit_6.setText(QCoreApplication.translate("MainWindow", u":", None))
645 | self.tb_hour_timer_2.setText(QCoreApplication.translate("MainWindow", u"15", None))
646 | self.tb_minute_timer_2.setText(QCoreApplication.translate("MainWindow", u"0", None))
647 | self.lineEdit_7.setText(QCoreApplication.translate("MainWindow", u":", None))
648 | self.tb_second_timer_2.setText(QCoreApplication.translate("MainWindow", u"0", None))
649 | self.btn_stop_timer.setText(QCoreApplication.translate("MainWindow", u"stop", None))
650 | self.btn_start_timer.setText(QCoreApplication.translate("MainWindow", u"Start", None))
651 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("MainWindow", u"Timer", None))
652 | self.start_sw.setText(QCoreApplication.translate("MainWindow", u"start", None))
653 | self.reset_sw.setText(QCoreApplication.translate("MainWindow", u"Rest", None))
654 | self.stop_sw.setText(QCoreApplication.translate("MainWindow", u"stop", None))
655 | self.stop_watch.setText(QCoreApplication.translate("MainWindow", u"0:0:0", None))
656 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("MainWindow", u"Stop Watch", None))
657 | # retranslateUi
658 |
659 |
--------------------------------------------------------------------------------
/Clock App/time_class.py:
--------------------------------------------------------------------------------
1 | class MyTime:
2 | def __init__(self, hour, minute, second):
3 | self.hour = hour
4 | self.minute = minute
5 | self.second = second
6 | self.fix()
7 |
8 | def add_second(self):
9 | self.second += 1
10 | self.fix()
11 |
12 |
13 | def sub_second(self):
14 | self.second -= 1
15 | self.fix()
16 |
17 | def show(self):
18 | print(self.hour, ':', self.minute, ':', self.second)
19 |
20 | def sum(self, other):
21 | s_new = self.second + other.second
22 | m_new = self.minute + other.minute
23 | h_new = self.hour + other.hour
24 | result = MyTime(h_new, m_new, s_new)
25 | return result
26 |
27 | def equal(self, other):
28 | s_new = self.second - other.second
29 | m_new = self.minute - other.minute
30 | h_new = self.hour - other.hour
31 | if s_new == 0 and m_new == 0 and h_new == 0:
32 | return True
33 | else:
34 | return False
35 |
36 | def toString(self):
37 | return f'{self.hour}:{self.minute}:{self.second}'
38 |
39 | def sub(self, other):
40 | s_new = self.second - other.second
41 | m_new = self.minute - other.minute
42 | h_new = self.hour - other.hour
43 | result = MyTime(h_new, m_new, s_new)
44 | return result
45 |
46 | @staticmethod
47 | def convert_second_to_time(second):
48 | x = MyTime(0, 0, second)
49 | return x
50 |
51 |
52 | def convert_time_to_second(self):
53 | second = (self.hour * 60 + self.minute) * 60 + self.second
54 | return second
55 |
56 | def convert_GMT_to_Tehran(self):
57 | Tehran = Time(3, 30, 0)
58 | x = Time.sum(self, Tehran)
59 | return x
60 |
61 | def fix(self):
62 | while self.second >= 60:
63 | self.second -= 60
64 | self.minute += 1
65 |
66 | while self.minute >= 60:
67 | self.minute -= 60
68 | self.hour += 1
69 |
70 | while self.hour >= 24:
71 | self.hour -= 24
72 |
73 | while self.second < 0:
74 | self.second += 60
75 | self.minute -= 1
76 |
77 | while self.minute < 0:
78 | self.minute += 60
79 | self.hour -= 1
80 |
81 | while self.hour < 0:
82 | self.hour += 24
83 |
84 | # t1 = Time(3, 15, 20)
85 | # t1.show()
86 |
87 | # t2 = Time(3, 15, 22)
88 | # t2.show()
89 |
90 | # t3 = t1.sub(t2)
91 | # t3.show()
92 |
93 | # t4 = Time(1, 1, 1)
94 | # # t4 = t4.convert_second_to_time(60*60*2 + 60*23 + 56)
95 | # # print(t4.convert_time_to_second())
96 | # t5 = t4.convert_GMT_to_Tehran()
97 | # t5.show()
98 |
99 | # t6 = Time.convert_second_to_time(60*60*2 + 60*23 + 56)
100 | # t6.show()
101 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Python_dataBase
3 | ## Assignment 25
4 | ### **Clock App**
5 | 
6 |
7 | 
8 |
9 | 
10 |
11 | 
12 |
13 | ## Assignment 22
14 | ### **ToDoList**
15 | 
16 |
17 |
18 |
--------------------------------------------------------------------------------
/seson 20/sql/2.py:
--------------------------------------------------------------------------------
1 | import random
2 |
3 | boys = ['mohammad', 'sobhan', 'abdollah', 'kiya', 'mahdi', 'sajjad', 'homan', 'arman']
4 | girls = ['mahtab', 'hane', 'harir', 'fateme', 'kiana', 'faezeh', 'minoo', 'mina', 'soghra']
5 |
6 | results = []
7 |
8 | for i in range(min(len(boys),len(girls))):
9 | boys = random.choice(boys)
10 | girls = random.choice(girls)
11 | result.append([boys,girls])
12 | boye.remove(boys)
13 | girle.remove(girls)
14 |
15 | print("result=", result)
16 |
--------------------------------------------------------------------------------
/seson 20/sql/delete.sql:
--------------------------------------------------------------------------------
1 | DELETE FROM Customers WHERE country<"iran"
--------------------------------------------------------------------------------
/seson 20/sql/digikala.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MohamadNematizadeh/Python_Database/5020c90048f161dd681c8ec43bb5ccb1c2ac578c/seson 20/sql/digikala.db
--------------------------------------------------------------------------------
/seson 20/sql/insert.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Products(id,name,price,count)
2 | VALUES(3,"cream",24000,200)
--------------------------------------------------------------------------------
/seson 20/sql/select.sql:
--------------------------------------------------------------------------------
1 | SELECT * FROM Products WHERE count="h"
--------------------------------------------------------------------------------
/seson 20/sql/updat.sql:
--------------------------------------------------------------------------------
1 | UPDATE Products SET price = price-(price/100*20)
2 |
--------------------------------------------------------------------------------