diff --git a/Data Structures and Algorithms/queues.py b/Data Structures and Algorithms/queues.py new file mode 100644 index 00000000..95f67510 --- /dev/null +++ b/Data Structures and Algorithms/queues.py @@ -0,0 +1,27 @@ +class Queue: + def __init__(self): + self.queue = [] + + def enqueue(self, item): + self.queue.append(item) + + def dequeue(self): + if not self.is_empty(): + return self.queue.pop(0) + return "Queue is empty" + + def is_empty(self): + return len(self.queue) == 0 + + def peek(self): + return self.queue[0] if not self.is_empty() else None + + def size(self): + return len(self.queue) + +# Example Usage +q = Queue() +q.enqueue(10) +q.enqueue(20) +print(q.dequeue()) # Output: 10 +print(q.peek()) # Output: 20 diff --git a/FLASK PROJECTS/Anniversary time/README.md b/FLASK PROJECTS/Anniversary time/README.md new file mode 100644 index 00000000..5a415f7a --- /dev/null +++ b/FLASK PROJECTS/Anniversary time/README.md @@ -0,0 +1,3 @@ +# Anniversary Timing + +Simple timing page implemented using flask diff --git a/FLASK PROJECTS/Anniversary time/app.py b/FLASK PROJECTS/Anniversary time/app.py new file mode 100644 index 00000000..434405a0 --- /dev/null +++ b/FLASK PROJECTS/Anniversary time/app.py @@ -0,0 +1,17 @@ +from flask import Flask, render_template +from datetime import datetime + +app = Flask(__name__) + +# 在此定义纪念日日期 +anniversary_date = datetime(2024, 6, 16) + +@app.route('/') +def index(): + current_date = datetime.now() + delta = current_date - anniversary_date + days_passed = delta.days + return render_template('index.html', days_passed=days_passed, anniversary_date=anniversary_date.strftime("%Y-%m-%d %H:%M:%S")) + +if __name__ == '__main__': + app.run(debug=False) diff --git a/FLASK PROJECTS/Anniversary time/static/background.jpg b/FLASK PROJECTS/Anniversary time/static/background.jpg new file mode 100644 index 00000000..a6c19a97 Binary files /dev/null and b/FLASK PROJECTS/Anniversary time/static/background.jpg differ diff --git a/FLASK PROJECTS/Anniversary time/static/style.css b/FLASK PROJECTS/Anniversary time/static/style.css new file mode 100644 index 00000000..16fae375 --- /dev/null +++ b/FLASK PROJECTS/Anniversary time/static/style.css @@ -0,0 +1,32 @@ +body { + margin: 0; + padding: 0; + font-family: Arial, sans-serif; + background: url('background.jpg') no-repeat center center fixed; + background-size: cover; + color: white; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + text-align: center; + background-color: rgba(0, 0, 0, 0.5); + padding: 20px; + border-radius: 10px; +} + +h1 { + font-size: 3em; +} + +.time { + font-size: 2em; + margin-top: 20px; +} + +.time span { + font-weight: bold; +} diff --git a/FLASK PROJECTS/Anniversary time/templates/index.html b/FLASK PROJECTS/Anniversary time/templates/index.html new file mode 100644 index 00000000..0afa920f --- /dev/null +++ b/FLASK PROJECTS/Anniversary time/templates/index.html @@ -0,0 +1,39 @@ + + + + + + Anniversary + + + + +
+

It has passed the xx anniversary

+
+ 0 天 + 0 小时 + 0 分钟 + 0 秒 +
+
+ + diff --git a/README.md b/README.md index 8505b537..5caaa0c8 100644 --- a/README.md +++ b/README.md @@ -113,15 +113,16 @@ guide [HERE](https://github.com/larymak/Python-project-Scripts/blob/main/CONTRIB | 64 | [Umbrella Reminder](https://github.com/larymak/Python-project-Scripts/tree/main/TIME%20SCRIPTS/Umbrella%20Reminder) | [Edula Vinay Kumar Reddy](https://github.com/vinayedula) | | 65 | [Image to PDF](https://github.com/larymak/Python-project-Scripts/tree/main/IMAGES%20%26%20PHOTO%20SCRIPTS/Image%20to%20PDF) | [Vedant Chainani](https://github.com/Envoy-VC) | | 66 | [KeyLogger](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/KeyLogger) | [Akhil](https://github.com/akhil-chagarlamudi) | -| 67 | [PDF Text Extractor](https://github.com/SamAddy/Python-project-Scripts/tree/main/PYTHON%20APPS/PDF-Text-Extractor) | [Samuel Addison](https://github.com/SamAddy) -| 68 | [Analyze docx file](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/analyzing%20and%20writing%20.docx%20file) | [Kashaan Mahmood](https://github.com/Kashaan-M) -| 69 | [Bitcoin Price](https://github.com/larymak/Python-project-Scripts/tree/main/WEB%20SCRAPING/Bitcoin%20Price) | [Olu-Olagbuji Delight](https://github.com/Dheelyte) -| 70 | [Password Generator](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Password%20Generator) | [LpCodes](https://github.com/LpCodes) -| 71 | [HTML to Excel](https://github.com/larymak/Python-project-Scripts/tree/main/CONVERSION%20SCRIPTS/HTML%20to%20Excel) | [LpCodes](https://github.com/LpCodes) +| 67 | [PDF Text Extractor](https://github.com/SamAddy/Python-project-Scripts/tree/main/PYTHON%20APPS/PDF-Text-Extractor) | [Samuel Addison](https://github.com/SamAddy)| +| 68 | [Analyze docx file](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/analyzing%20and%20writing%20.docx%20file) | [Kashaan Mahmood](https://github.com/Kashaan-M)| +| 69 | [Bitcoin Price](https://github.com/larymak/Python-project-Scripts/tree/main/WEB%20SCRAPING/Bitcoin%20Price) | [Olu-Olagbuji Delight](https://github.com/Dheelyte) | +| 70 | [Password Generator](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Password%20Generator) | [LpCodes](https://github.com/LpCodes) | +| 71 | [HTML to Excel](https://github.com/larymak/Python-project-Scripts/tree/main/CONVERSION%20SCRIPTS/HTML%20to%20Excel) | [LpCodes](https://github.com/LpCodes) | | 72 | [Star pattern](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/Star%20pattern) | [LpCodes](https://github.com/LpCodes) | | 73 | [Logging Helper](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/add-multiprocessing-logger) | [Jerry W.](https://github.com/Jerry0420) | | 74 | [Notepad](https://github.com/larymak/Python-project-Scripts/tree/main/PYTHON%20APPS/Notepad) | [Annarhysa Albert](https://github.com/Annarhysa) | | 75 | [Quadratic Equation Solver](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Quadratic-Equation-Solver) | [Akinfenwa Ezekiel](https://github.com/Ezek-iel) | | 76 | [Internet Connectivity Monitor](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/InternetConnectivityMonitor) | [Prince Khunt](https://github.com/princekhunt) | -| 76 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) | +| 77 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) | +| 78 | [Anniversary time](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/Anniversary%20time) | [gyyzzz](https://github.com/gyyzzz) |