diff --git a/basic_scripts/dice.py b/basic-scripts/dice.py similarity index 100% rename from basic_scripts/dice.py rename to basic-scripts/dice.py diff --git a/basic_scripts/hangman.py b/basic-scripts/hangman.py similarity index 100% rename from basic_scripts/hangman.py rename to basic-scripts/hangman.py diff --git a/basic_scripts/python _stack_implementation.py b/basic-scripts/python _stack_implementation.py similarity index 100% rename from basic_scripts/python _stack_implementation.py rename to basic-scripts/python _stack_implementation.py diff --git a/basic_scripts/python1.py b/basic-scripts/python1.py similarity index 100% rename from basic_scripts/python1.py rename to basic-scripts/python1.py diff --git a/basic_scripts/python2.py b/basic-scripts/python2.py similarity index 100% rename from basic_scripts/python2.py rename to basic-scripts/python2.py diff --git a/basic_scripts/python_array.py b/basic-scripts/python_array.py similarity index 100% rename from basic_scripts/python_array.py rename to basic-scripts/python_array.py diff --git a/basic_scripts/python_break_continue.py b/basic-scripts/python_break_continue.py similarity index 100% rename from basic_scripts/python_break_continue.py rename to basic-scripts/python_break_continue.py diff --git a/basic_scripts/python_class.py b/basic-scripts/python_class.py similarity index 100% rename from basic_scripts/python_class.py rename to basic-scripts/python_class.py diff --git a/basic_scripts/python_class_basic_practice.py b/basic-scripts/python_class_basic_practice.py similarity index 100% rename from basic_scripts/python_class_basic_practice.py rename to basic-scripts/python_class_basic_practice.py diff --git a/basic_scripts/python_class_constructor.py b/basic-scripts/python_class_constructor.py similarity index 100% rename from basic_scripts/python_class_constructor.py rename to basic-scripts/python_class_constructor.py diff --git a/basic_scripts/python_class_extended.py b/basic-scripts/python_class_extended.py similarity index 100% rename from basic_scripts/python_class_extended.py rename to basic-scripts/python_class_extended.py diff --git a/basic_scripts/python_count_vowels.py b/basic-scripts/python_count_vowels.py similarity index 100% rename from basic_scripts/python_count_vowels.py rename to basic-scripts/python_count_vowels.py diff --git a/basic_scripts/python_dateandtime.py b/basic-scripts/python_dateandtime.py similarity index 100% rename from basic_scripts/python_dateandtime.py rename to basic-scripts/python_dateandtime.py diff --git a/basic_scripts/python_dialogboxes.py b/basic-scripts/python_dialogboxes.py similarity index 100% rename from basic_scripts/python_dialogboxes.py rename to basic-scripts/python_dialogboxes.py diff --git a/basic_scripts/python_file_handling.py b/basic-scripts/python_file_handling.py similarity index 100% rename from basic_scripts/python_file_handling.py rename to basic-scripts/python_file_handling.py diff --git a/basic_scripts/python_file_handling_and_json.py b/basic-scripts/python_file_handling_and_json.py similarity index 100% rename from basic_scripts/python_file_handling_and_json.py rename to basic-scripts/python_file_handling_and_json.py diff --git a/basic_scripts/python_functions.py b/basic-scripts/python_functions.py similarity index 100% rename from basic_scripts/python_functions.py rename to basic-scripts/python_functions.py diff --git a/basic_scripts/python_instances_of _class.py b/basic-scripts/python_instances_of _class.py similarity index 100% rename from basic_scripts/python_instances_of _class.py rename to basic-scripts/python_instances_of _class.py diff --git a/basic_scripts/python_list.py b/basic-scripts/python_list.py similarity index 100% rename from basic_scripts/python_list.py rename to basic-scripts/python_list.py diff --git a/basic_scripts/python_loop.py b/basic-scripts/python_loop.py similarity index 100% rename from basic_scripts/python_loop.py rename to basic-scripts/python_loop.py diff --git a/basic_scripts/python_mail.py b/basic-scripts/python_mail.py similarity index 100% rename from basic_scripts/python_mail.py rename to basic-scripts/python_mail.py diff --git a/basic_scripts/python_matplotlib.py b/basic-scripts/python_matplotlib.py similarity index 100% rename from basic_scripts/python_matplotlib.py rename to basic-scripts/python_matplotlib.py diff --git a/basic_scripts/python_matplotlib2.py b/basic-scripts/python_matplotlib2.py similarity index 100% rename from basic_scripts/python_matplotlib2.py rename to basic-scripts/python_matplotlib2.py diff --git a/basic_scripts/python_more_with_functions.py b/basic-scripts/python_more_with_functions.py similarity index 100% rename from basic_scripts/python_more_with_functions.py rename to basic-scripts/python_more_with_functions.py diff --git a/basic_scripts/python_number_of_words.py b/basic-scripts/python_number_of_words.py similarity index 100% rename from basic_scripts/python_number_of_words.py rename to basic-scripts/python_number_of_words.py diff --git a/basic_scripts/python_osmodule.py b/basic-scripts/python_osmodule.py similarity index 100% rename from basic_scripts/python_osmodule.py rename to basic-scripts/python_osmodule.py diff --git a/basic_scripts/python_queue.py b/basic-scripts/python_queue.py similarity index 100% rename from basic_scripts/python_queue.py rename to basic-scripts/python_queue.py diff --git a/basic_scripts/python_random_code.py b/basic-scripts/python_random_code.py similarity index 100% rename from basic_scripts/python_random_code.py rename to basic-scripts/python_random_code.py diff --git a/basic_scripts/python_rock_paper_scissors_game.py b/basic-scripts/python_rock_paper_scissors_game.py similarity index 100% rename from basic_scripts/python_rock_paper_scissors_game.py rename to basic-scripts/python_rock_paper_scissors_game.py diff --git a/basic_scripts/python_runcmd.py b/basic-scripts/python_runcmd.py similarity index 100% rename from basic_scripts/python_runcmd.py rename to basic-scripts/python_runcmd.py diff --git a/basic_scripts/python_simple_login_account.py b/basic-scripts/python_simple_login_account.py similarity index 100% rename from basic_scripts/python_simple_login_account.py rename to basic-scripts/python_simple_login_account.py diff --git a/basic_scripts/python_speech recognition.py b/basic-scripts/python_speech recognition.py similarity index 100% rename from basic_scripts/python_speech recognition.py rename to basic-scripts/python_speech recognition.py diff --git a/basic_scripts/python_stack.py b/basic-scripts/python_stack.py similarity index 100% rename from basic_scripts/python_stack.py rename to basic-scripts/python_stack.py diff --git a/basic_scripts/python_test_push.py b/basic-scripts/python_test_push.py similarity index 100% rename from basic_scripts/python_test_push.py rename to basic-scripts/python_test_push.py diff --git a/basic_scripts/python_try_except_use.py b/basic-scripts/python_try_except_use.py similarity index 100% rename from basic_scripts/python_try_except_use.py rename to basic-scripts/python_try_except_use.py diff --git a/basic_scripts/python_while_loop.py b/basic-scripts/python_while_loop.py similarity index 100% rename from basic_scripts/python_while_loop.py rename to basic-scripts/python_while_loop.py diff --git a/dumpsite/discord_bot/bot.py b/dumpsite/discord-bot/bot.py similarity index 100% rename from dumpsite/discord_bot/bot.py rename to dumpsite/discord-bot/bot.py diff --git a/dumpsite/discord_bot/requirements.txt b/dumpsite/discord-bot/requirements.txt similarity index 100% rename from dumpsite/discord_bot/requirements.txt rename to dumpsite/discord-bot/requirements.txt diff --git a/dumpsite/fastapiauth/.gitignore b/dumpsite/fastapi-auth/.gitignore similarity index 100% rename from dumpsite/fastapiauth/.gitignore rename to dumpsite/fastapi-auth/.gitignore diff --git a/dumpsite/fastapiauth/Pipfile b/dumpsite/fastapi-auth/Pipfile similarity index 100% rename from dumpsite/fastapiauth/Pipfile rename to dumpsite/fastapi-auth/Pipfile diff --git a/dumpsite/fastapiauth/README.md b/dumpsite/fastapi-auth/README.md similarity index 100% rename from dumpsite/fastapiauth/README.md rename to dumpsite/fastapi-auth/README.md diff --git a/dumpsite/fastapiauth/example.py b/dumpsite/fastapi-auth/example.py similarity index 100% rename from dumpsite/fastapiauth/example.py rename to dumpsite/fastapi-auth/example.py diff --git a/dumpsite/fastapiauth/main.py b/dumpsite/fastapi-auth/main.py similarity index 100% rename from dumpsite/fastapiauth/main.py rename to dumpsite/fastapi-auth/main.py diff --git a/dumpsite/todo_api/.gitignore b/dumpsite/todo-api/.gitignore similarity index 100% rename from dumpsite/todo_api/.gitignore rename to dumpsite/todo-api/.gitignore diff --git a/dumpsite/todo_api/Pipfile b/dumpsite/todo-api/Pipfile similarity index 100% rename from dumpsite/todo_api/Pipfile rename to dumpsite/todo-api/Pipfile diff --git a/dumpsite/todo_api/README.md b/dumpsite/todo-api/README.md similarity index 100% rename from dumpsite/todo_api/README.md rename to dumpsite/todo-api/README.md diff --git a/dumpsite/todo_api/api/__init__.py b/dumpsite/todo-api/api/__init__.py similarity index 100% rename from dumpsite/todo_api/api/__init__.py rename to dumpsite/todo-api/api/__init__.py diff --git a/dumpsite/todo_api/api/models.py b/dumpsite/todo-api/api/models.py similarity index 100% rename from dumpsite/todo_api/api/models.py rename to dumpsite/todo-api/api/models.py diff --git a/dumpsite/todo_api/api/mutations.py b/dumpsite/todo-api/api/mutations.py similarity index 100% rename from dumpsite/todo_api/api/mutations.py rename to dumpsite/todo-api/api/mutations.py diff --git a/dumpsite/todo_api/api/queries.py b/dumpsite/todo-api/api/queries.py similarity index 100% rename from dumpsite/todo_api/api/queries.py rename to dumpsite/todo-api/api/queries.py diff --git a/dumpsite/todo_api/main.py b/dumpsite/todo-api/main.py similarity index 100% rename from dumpsite/todo_api/main.py rename to dumpsite/todo-api/main.py diff --git a/dumpsite/todo_api/query_examples b/dumpsite/todo-api/query_examples similarity index 100% rename from dumpsite/todo_api/query_examples rename to dumpsite/todo-api/query_examples diff --git a/dumpsite/todo_api/schema.graphql b/dumpsite/todo-api/schema.graphql similarity index 100% rename from dumpsite/todo_api/schema.graphql rename to dumpsite/todo-api/schema.graphql diff --git a/mini-projects/env-editor/README.md b/mini-projects/env-editor/README.md new file mode 100644 index 0000000..9c21292 --- /dev/null +++ b/mini-projects/env-editor/README.md @@ -0,0 +1,3 @@ +# ENV Reader + +Reads and helps manage .env file. diff --git a/mini-projects/env-editor/editor.py b/mini-projects/env-editor/editor.py new file mode 100644 index 0000000..3b27394 --- /dev/null +++ b/mini-projects/env-editor/editor.py @@ -0,0 +1,124 @@ +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(800, 600) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + MainWindow.setSizePolicy(sizePolicy) + MainWindow.setLayoutDirection(QtCore.Qt.LeftToRight) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.Message = QtWidgets.QLabel(self.centralwidget) + self.Message.setGeometry(QtCore.QRect(130, 90, 511, 71)) + self.Message.setStyleSheet("color: red;\n" +"border: 1px solid red;\n" +"border-radius: 8px;\n" +"background-color: rgba(245, 72, 66, 0.5);") + self.Message.setAlignment(QtCore.Qt.AlignCenter) + self.Message.setObjectName("Message") + self.title = QtWidgets.QLabel(self.centralwidget) + self.title.setGeometry(QtCore.QRect(250, 10, 241, 71)) + font = QtGui.QFont() + font.setFamily("Montserrat ExtraLight") + font.setPointSize(28) + self.title.setFont(font) + self.title.setAlignment(QtCore.Qt.AlignCenter) + self.title.setObjectName("title") + self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget) + self.gridLayoutWidget.setGeometry(QtCore.QRect(130, 210, 521, 131)) + self.gridLayoutWidget.setObjectName("gridLayoutWidget") + self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget) + self.gridLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize) + self.gridLayout.setContentsMargins(0, 0, 0, 0) + self.gridLayout.setSpacing(0) + self.gridLayout.setObjectName("gridLayout") + self.lineEdit_3 = QtWidgets.QLineEdit(self.gridLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_3.sizePolicy().hasHeightForWidth()) + self.lineEdit_3.setSizePolicy(sizePolicy) + self.lineEdit_3.setObjectName("lineEdit_3") + self.gridLayout.addWidget(self.lineEdit_3, 2, 1, 1, 1) + self.lineEdit_5 = QtWidgets.QLineEdit(self.gridLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_5.sizePolicy().hasHeightForWidth()) + self.lineEdit_5.setSizePolicy(sizePolicy) + self.lineEdit_5.setStyleSheet("") + self.lineEdit_5.setObjectName("lineEdit_5") + self.gridLayout.addWidget(self.lineEdit_5, 1, 0, 1, 1) + self.lineEdit_2 = QtWidgets.QLineEdit(self.gridLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_2.sizePolicy().hasHeightForWidth()) + self.lineEdit_2.setSizePolicy(sizePolicy) + self.lineEdit_2.setSizeIncrement(QtCore.QSize(0, 0)) + self.lineEdit_2.setStyleSheet("") + self.lineEdit_2.setObjectName("lineEdit_2") + self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1) + self.lineEdit_4 = QtWidgets.QLineEdit(self.gridLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_4.sizePolicy().hasHeightForWidth()) + self.lineEdit_4.setSizePolicy(sizePolicy) + self.lineEdit_4.setStyleSheet("") + self.lineEdit_4.setObjectName("lineEdit_4") + self.gridLayout.addWidget(self.lineEdit_4, 2, 0, 1, 1) + self.label = QtWidgets.QLabel(self.gridLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("Montserrat Light") + font.setPointSize(10) + self.label.setFont(font) + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 1) + self.label_2 = QtWidgets.QLabel(self.gridLayoutWidget) + font = QtGui.QFont() + font.setFamily("Montserrat Light") + font.setPointSize(10) + self.label_2.setFont(font) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 0, 1, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 18)) + self.menubar.setObjectName("menubar") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) + self.Message.setText(_translate("MainWindow", "Could not parse .env file")) + self.title.setText(_translate("MainWindow", "ENV EDITOR")) + self.label.setText(_translate("MainWindow", "KEY")) + self.label_2.setText(_translate("MainWindow", "VALUE")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + MainWindow = QtWidgets.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec_()) diff --git a/mini-projects/env-editor/editor.ui b/mini-projects/env-editor/editor.ui new file mode 100644 index 0000000..b3aea36 --- /dev/null +++ b/mini-projects/env-editor/editor.ui @@ -0,0 +1,193 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + + 0 + 0 + + + + MainWindow + + + Qt::LeftToRight + + + + + + 130 + 90 + 511 + 71 + + + + color: red; +border: 1px solid red; +border-radius: 8px; +background-color: rgba(245, 72, 66, 0.5); + + + Could not parse .env file + + + Qt::AlignCenter + + + + + + 250 + 10 + 241 + 71 + + + + + Montserrat ExtraLight + 28 + + + + ENV EDITOR + + + Qt::AlignCenter + + + + + + 130 + 210 + 521 + 131 + + + + + QLayout::SetMinAndMaxSize + + + 0 + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + Montserrat Light + 10 + + + + KEY + + + Qt::AlignCenter + + + + + + + + Montserrat Light + 10 + + + + VALUE + + + + + + + + + + 0 + 0 + 800 + 18 + + + + + + + + diff --git a/mini_projects/image-to-sketch-cli/.gitignore b/mini-projects/image-to-sketch-cli/.gitignore similarity index 100% rename from mini_projects/image-to-sketch-cli/.gitignore rename to mini-projects/image-to-sketch-cli/.gitignore diff --git a/mini_projects/image-to-sketch-cli/README.md b/mini-projects/image-to-sketch-cli/README.md similarity index 100% rename from mini_projects/image-to-sketch-cli/README.md rename to mini-projects/image-to-sketch-cli/README.md diff --git a/mini_projects/image-to-sketch-cli/demo.gif b/mini-projects/image-to-sketch-cli/demo.gif similarity index 100% rename from mini_projects/image-to-sketch-cli/demo.gif rename to mini-projects/image-to-sketch-cli/demo.gif diff --git a/mini_projects/image-to-sketch-cli/main.py b/mini-projects/image-to-sketch-cli/main.py similarity index 100% rename from mini_projects/image-to-sketch-cli/main.py rename to mini-projects/image-to-sketch-cli/main.py diff --git a/mini_projects/image-to-sketch-cli/requirements.txt b/mini-projects/image-to-sketch-cli/requirements.txt similarity index 100% rename from mini_projects/image-to-sketch-cli/requirements.txt rename to mini-projects/image-to-sketch-cli/requirements.txt diff --git a/mini_projects/rock_paper_scissors/.gitignore b/mini-projects/rock-paper-scissors/.gitignore similarity index 100% rename from mini_projects/rock_paper_scissors/.gitignore rename to mini-projects/rock-paper-scissors/.gitignore diff --git a/mini-projects/rock-paper-scissors/README.md b/mini-projects/rock-paper-scissors/README.md new file mode 100644 index 0000000..e381095 --- /dev/null +++ b/mini-projects/rock-paper-scissors/README.md @@ -0,0 +1,19 @@ +# Rock Paper Scissors βœŠβœ‹βœŒοΈ + +It is a simple game played usually by kids for fun or as a tie-breaker. πŸ˜€ + +## Requirements and Dependencies + +Requirements are listed in [requirements.txt](./requirements.txt). + +```bash +python3 -m venv venv +source ./venv/bin/activate +pip3 install -r requirements.txt + +python3 rps.py +``` + +## Demo + +![Demo](./demo.gif) \ No newline at end of file diff --git a/mini_projects/rock_paper_scissors/computer.png b/mini-projects/rock-paper-scissors/assets/computer.png similarity index 100% rename from mini_projects/rock_paper_scissors/computer.png rename to mini-projects/rock-paper-scissors/assets/computer.png diff --git a/mini_projects/rock_paper_scissors/icon.png b/mini-projects/rock-paper-scissors/assets/icon.png similarity index 100% rename from mini_projects/rock_paper_scissors/icon.png rename to mini-projects/rock-paper-scissors/assets/icon.png diff --git a/mini_projects/rock_paper_scissors/paper.png b/mini-projects/rock-paper-scissors/assets/paper.png similarity index 100% rename from mini_projects/rock_paper_scissors/paper.png rename to mini-projects/rock-paper-scissors/assets/paper.png diff --git a/mini_projects/rock_paper_scissors/rock.png b/mini-projects/rock-paper-scissors/assets/rock.png similarity index 100% rename from mini_projects/rock_paper_scissors/rock.png rename to mini-projects/rock-paper-scissors/assets/rock.png diff --git a/mini_projects/rock_paper_scissors/scissors.png b/mini-projects/rock-paper-scissors/assets/scissors.png similarity index 100% rename from mini_projects/rock_paper_scissors/scissors.png rename to mini-projects/rock-paper-scissors/assets/scissors.png diff --git a/mini_projects/rock_paper_scissors/user.png b/mini-projects/rock-paper-scissors/assets/user.png similarity index 100% rename from mini_projects/rock_paper_scissors/user.png rename to mini-projects/rock-paper-scissors/assets/user.png diff --git a/mini-projects/rock-paper-scissors/demo.gif b/mini-projects/rock-paper-scissors/demo.gif new file mode 100644 index 0000000..48c80c8 Binary files /dev/null and b/mini-projects/rock-paper-scissors/demo.gif differ diff --git a/mini-projects/rock-paper-scissors/docs/about.txt b/mini-projects/rock-paper-scissors/docs/about.txt new file mode 100644 index 0000000..502e4b8 --- /dev/null +++ b/mini-projects/rock-paper-scissors/docs/about.txt @@ -0,0 +1,32 @@ + + +

This is a very entertaining game that provides instant entertainment to users.

+

This is a game that generates random output which is priority based.

+Here: + +v1.0.2 +
+Β© Shreyam Pokharel πŸ˜‚πŸ˜‚ \ No newline at end of file diff --git a/mini-projects/rock-paper-scissors/docs/help.txt b/mini-projects/rock-paper-scissors/docs/help.txt new file mode 100644 index 0000000..3f21cab --- /dev/null +++ b/mini-projects/rock-paper-scissors/docs/help.txt @@ -0,0 +1,11 @@ +

This game does not require any mental skill! It is just random play!

+Some shortcuts: + +

Use the three buttons for choosing rock, paper or scissors and +play with the computer!

+

Best Of Luck! πŸ‘

\ No newline at end of file diff --git a/mini_projects/rock_paper_scissors/rps_engine.py b/mini-projects/rock-paper-scissors/engine.py similarity index 100% rename from mini_projects/rock_paper_scissors/rps_engine.py rename to mini-projects/rock-paper-scissors/engine.py diff --git a/mini_projects/rock_paper_scissors/requirements.txt b/mini-projects/rock-paper-scissors/requirements.txt similarity index 100% rename from mini_projects/rock_paper_scissors/requirements.txt rename to mini-projects/rock-paper-scissors/requirements.txt diff --git a/mini_projects/rock_paper_scissors/rps_ui.py b/mini-projects/rock-paper-scissors/rps.py similarity index 66% rename from mini_projects/rock_paper_scissors/rps_ui.py rename to mini-projects/rock-paper-scissors/rps.py index 8ebc189..e627b2a 100644 --- a/mini_projects/rock_paper_scissors/rps_ui.py +++ b/mini-projects/rock-paper-scissors/rps.py @@ -5,8 +5,11 @@ from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * -from rps_engine import play +from engine import play +import random +ASSETS_FOLDER = "assets" +HOLD_SLOGAN = ["Let's Get Going!", "Let's Play!", "Let's Start Now!"] def suppress_qt_warnings(): """ @@ -17,14 +20,14 @@ def suppress_qt_warnings(): environ["QT_SCREEN_SCALE_FACTORS"] = "1" environ["QT_SCALE_FACTOR"] = "1" - + class Ui_MainWindow(object): def set_user_computer(self, choice, user): - rock = QPixmap('rock.png') - paper = QPixmap('paper.png') - scissors = QPixmap('scissors.png') - self.label_user.setStyleSheet("background:blue;\n""border-radius:30px;") - self.label_computer.setStyleSheet("background:blue;\n""border-radius:30px;") + rock = QPixmap(f'{ASSETS_FOLDER}/rock.png') + paper = QPixmap(f'{ASSETS_FOLDER}/paper.png') + scissors = QPixmap(f'{ASSETS_FOLDER}/scissors.png') + self.label_user.setStyleSheet("background:rgb(50, 173, 81);\n""border-radius:10px;") + self.label_computer.setStyleSheet("background:rgb(95, 66, 212);\n""border-radius:10px;") # for computer if choice == "paper": @@ -47,107 +50,80 @@ def view_help(self): Pop up a help dialog box. """ msg = QMessageBox() - msg.setWindowOpacity(0.97) msg.setIcon(QMessageBox.Information) - msg.setStyleSheet("background-image: url('bg.jpg');\n") - msg.setText("

Help for Rock Paper Scissors

") - msg.setInformativeText(""" -

This game does not require any mental skill! It is just random play!

-

Some shortcuts:

- -

Use the three buttons for choosing rock, paper or scissors and - play with the computer!

-

Best Of Luck!

- """) + msg.setText("

Help for Rock Paper Scissors

") + with open("docs/help.txt", "r") as file: + text = file.read() + msg.setInformativeText(text) msg.setWindowTitle("Help - Rock Paper Scissors") - msg.setStandardButtons(QMessageBox.Ok) + msg.setStandardButtons(QMessageBox.Ok) retval = msg.exec_() - def about(self): + def view_about(self): """ Implement about functionalities using this function Pop up an about dialog box. """ msg = QMessageBox() - msg.setWindowOpacity(0.97) msg.setIcon(QMessageBox.Information) - msg.setStyleSheet("background-image: url('bg.jpg');\n") - msg.setText("

Welcome to Rock Paper Scissors!

") - msg.setInformativeText(""" -

This is a very entertaining game that aims in provinding instant entertainment to users.\n - This is a game that generates random output which is priority based.

-
-

Here;

- -

- v1.0.2 - Β© Shreyam PokharelπŸ˜‚πŸ˜‚ - """) - msg.setWindowTitle("About Rock Paper Scissors") - msg.setStandardButtons(QMessageBox.Ok) + msg.setText("

Welcome to Rock Paper Scissors!

") + with open("docs/about.txt", "r") as file: + text = file.read() + msg.setInformativeText(text) + msg.setWindowTitle("About - Rock Paper Scissors") + msg.setStandardButtons(QMessageBox.Ok) retval = msg.exec_() def reset(self): self.label.setText("") - computer = QPixmap('computer.png') - user = QPixmap('user.png') + computer = QPixmap(f"{ASSETS_FOLDER}/computer.png") + user = QPixmap(f"{ASSETS_FOLDER}/user.png") self.label.move(30,60) - self.label.setText("Let's Play!!!") - self.label_user.setStyleSheet("background:blue;\n""border-radius:30px;") + self.label.setText(f"{random.choice(HOLD_SLOGAN)}") + self.label_user.setStyleSheet("background:rgb(50, 173, 81);\n""border-radius:10px;") self.label_user.setPixmap(user) - self.label_computer.setStyleSheet("background:blue;\n""border-radius:30px;") + self.label_computer.setStyleSheet("background:rgb(95, 66, 212);\n""border-radius:10px;") self.label_computer.setPixmap(computer) user = "" - self.statusbar.showMessage("Reseting...", 1000) + self.statusbar.showMessage("Reseting...", 200) - def userRock(self): + def user_rock(self): self.statusbar.showMessage("Playing...") user = "rock" result, choice = play(user) self.label.move(90, 250) self.label.setText(result) self.set_user_computer(choice, user) - self.statusbar.showMessage("Computer chose: "+choice+" "+"You chose: "+user) + self.statusbar.showMessage(f"Computer chose: {choice} \t\t You chose: {user}") user = "" - def userPaper(self): + def user_paper(self): self.statusbar.showMessage("Playing...") user = "paper" result, choice = play(user) self.label.move(90, 250) self.label.setText(result) self.set_user_computer(choice, user) - self.statusbar.showMessage("Computer chose: "+choice+" "+"You chose: "+user) + self.statusbar.showMessage(f"Computer chose: {choice} \t\t You chose: {user}") user = "" - def userScissors(self): + def user_scissors(self): self.statusbar.showMessage("Playing...") user = "scissors" result,choice = play(user) self.label.move(90, 250) self.label.setText(result) self.set_user_computer(choice, user) - self.statusbar.showMessage("Computer chose: "+choice+" "+"You chose: "+user) + self.statusbar.showMessage(f"Computer chose: {choice} \t\t You chose: {user}") user = "" def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.setFixedSize(800, 600) - MainWindow.setWindowOpacity(0.96) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap("icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap(f"{ASSETS_FOLDER}/icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) - MainWindow.setStyleSheet("background-image: url('bg.jpg');\n") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") @@ -159,25 +135,25 @@ def setupUi(self, MainWindow): self.rock_pushButton.setFont(font) self.rock_pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.rock_pushButton.setObjectName("rock_pushButton") - self.rock_pushButton.setStyleSheet("border-radius:25px;\n""background:'blue';\n""color:'white';\n") - self.rock_pushButton.setIcon(QIcon('rock.png')) + self.rock_pushButton.setStyleSheet("border-radius:8px;\n""background:rgb(184, 68, 110);\n""color:'white';\n") + self.rock_pushButton.setIcon(QIcon(f"{ASSETS_FOLDER}/rock.png")) self.rock_pushButton.setIconSize(QSize(191,51)) - self.rock_pushButton.clicked.connect(self.userRock) + self.rock_pushButton.clicked.connect(self.user_rock) self.rock_pushButton.setAutoDefault(True) self.scissors_pushButton = QtWidgets.QPushButton(self.centralwidget) - self.scissors_pushButton.setGeometry(QtCore.QRect(290, 480, 191, 51)) + self.scissors_pushButton.setGeometry(QtCore.QRect(290, 480, 191, 51)) font = QtGui.QFont() font.setFamily("Consolas") font.setPointSize(16) self.scissors_pushButton.setFont(font) self.scissors_pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.scissors_pushButton.setObjectName("scissors_pushButton") - self.scissors_pushButton.setStyleSheet("border-radius:25px;\n""background:'blue';\n""color:'white';\n") - self.scissors_pushButton.setIcon(QIcon('scissors.png')) + self.scissors_pushButton.setStyleSheet("border-radius:8px;\n""background:rgb(112, 189, 53);\n""color:'white';\n") + self.scissors_pushButton.setIcon(QIcon(f"{ASSETS_FOLDER}/scissors.png")) self.scissors_pushButton.setIconSize(QSize(191,51)) - self.scissors_pushButton.clicked.connect(self.userScissors) + self.scissors_pushButton.clicked.connect(self.user_scissors) self.scissors_pushButton.setAutoDefault(True) @@ -189,10 +165,10 @@ def setupUi(self, MainWindow): self.paper_pushButton.setFont(font) self.paper_pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.paper_pushButton.setObjectName("paper_pushButton") - self.paper_pushButton.setStyleSheet("border-radius:25px;\n""background:'blue';\n""color:'white';\n") - self.paper_pushButton.setIcon(QIcon('paper.png')) + self.paper_pushButton.setStyleSheet("border-radius:8px;\n""background:rgb(217, 48, 67);\n""color:'white';\n") + self.paper_pushButton.setIcon(QIcon(f"{ASSETS_FOLDER}/paper.png")) self.paper_pushButton.setIconSize(QSize(191,51)) - self.paper_pushButton.clicked.connect(self.userPaper) + self.paper_pushButton.clicked.connect(self.user_paper) self.paper_pushButton.setAutoDefault(True) @@ -202,19 +178,19 @@ def setupUi(self, MainWindow): font.setFamily("Consolas") font.setPointSize(18) self.info_label.setFont(font) - self.info_label.setStyleSheet("background: rgb(7, 11, 255);\n") + self.info_label.setStyleSheet("background: rgb(76, 122, 161);\n") self.info_label.setObjectName("info_label") self.info_label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) self.label = QtWidgets.QLabel(self.centralwidget) - self.label.setGeometry(QtCore.QRect(30, 60, 211, 91)) + self.label.setGeometry(QtCore.QRect(30, 60, 300, 100)) font = QtGui.QFont() font.setFamily("Consolas") font.setPointSize(18) self.label.setFont(font) self.label.setStyleSheet("color: black;\nbackground: None;\n") self.label.setObjectName("label") - self.label.setText("Let's Play!!!") + self.label.setText(f"{random.choice(HOLD_SLOGAN)}") self.userlabel = QtWidgets.QLabel(self.centralwidget) self.userlabel.setGeometry(QtCore.QRect(300, 90, 200, 30)) @@ -238,12 +214,12 @@ def setupUi(self, MainWindow): self.computerlabel.setObjectName("computerlabel") self.computerlabel.setText("Computer") - computer = QPixmap('computer.png') - user = QPixmap('user.png') + computer = QPixmap(f"{ASSETS_FOLDER}/computer.png") + user = QPixmap(f"{ASSETS_FOLDER}/user.png") self.label_user = QtWidgets.QLabel(self.centralwidget) self.label_user.setGeometry(QtCore.QRect(300, 130, 200, 200)) - self.label_user.setStyleSheet("background:blue;\n""border-radius:30px;") + self.label_user.setStyleSheet("background:rgb(50, 173, 81);\n""border-radius:10px;") self.label_user.setPixmap(user) self.label_user.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) font = QtGui.QFont() @@ -251,11 +227,10 @@ def setupUi(self, MainWindow): font.setPointSize(18) self.label_user.setFont(font) self.label_user.setObjectName("label_user") - #self.label_user.setText("User") - + self.label_computer = QtWidgets.QLabel(self.centralwidget) self.label_computer.setGeometry(QtCore.QRect(530, 130, 200, 200)) - self.label_computer.setStyleSheet("background:blue;\n""border-radius:30px;") + self.label_computer.setStyleSheet("background:rgb(95, 66, 212);\n""border-radius:10px;") self.label_computer.setPixmap(computer) self.label_computer.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) font = QtGui.QFont() @@ -263,7 +238,6 @@ def setupUi(self, MainWindow): font.setPointSize(18) self.label_computer.setFont(font) self.label_computer.setObjectName("label_computer") - #self.label_computer.setText("Computer") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) @@ -278,7 +252,7 @@ def setupUi(self, MainWindow): self.actionReset = QtWidgets.QAction(MainWindow) self.actionReset.setObjectName("actionReset") self.actionReset.setShortcut("Ctrl+R") - self.actionReset.triggered.connect(self.reset) + self.actionReset.triggered.connect(self.reset) self.actionExit = QtWidgets.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionExit.setShortcut("Ctrl+Q") @@ -297,14 +271,14 @@ def setupUi(self, MainWindow): self.actionAbout = QtWidgets.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.actionAbout.setShortcut("Ctrl+A") - self.actionAbout.triggered.connect(self.about) + self.actionAbout.triggered.connect(self.view_about) - self.menuHelp=QtWidgets.QMenu(self.menubar) - self.menuHelp.setObjectName("menuHelp") - self.menuHelp.addAction(self.actionViewHelp) - self.menuHelp.addSeparator() - self.menuHelp.addAction(self.actionAbout) - self.menubar.addAction(self.menuHelp.menuAction()) + self.menuMisc=QtWidgets.QMenu(self.menubar) + self.menuMisc.setObjectName("menuMisc") + self.menuMisc.addAction(self.actionViewHelp) + self.menuMisc.addSeparator() + self.menuMisc.addAction(self.actionAbout) + self.menubar.addAction(self.menuMisc.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -315,13 +289,13 @@ def retranslateUi(self, MainWindow): self.rock_pushButton.setText(_translate("MainWindow", "Rock")) self.paper_pushButton.setText(_translate("MainWindow", "Paper")) self.scissors_pushButton.setText(_translate("MainWindow", "Scissors")) - self.info_label.setText(_translate("MainWindow", "Let us play Rock/ Paper/ Scissors:")) - self.menuOptions.setTitle(_translate("MainWindow", "Game")) - self.menuHelp.setTitle(_translate("MainWindow", "Help")) - self.actionReset.setText(_translate("MainWindow", "Reset")) - self.actionExit.setText(_translate("MainWindow", "Exit")) - self.actionViewHelp.setText(_translate("MainWindow", "View Help")) - self.actionAbout.setText(_translate("MainWindow", "About Rock Paper Scissors")) + self.info_label.setText(_translate("MainWindow", "Let us play Rock/Paper/Scissors:")) + self.menuOptions.setTitle(_translate("MainWindow", "&Game")) + self.menuMisc.setTitle(_translate("MainWindow", "&...")) + self.actionReset.setText(_translate("MainWindow", "&Reset")) + self.actionExit.setText(_translate("MainWindow", "&Exit")) + self.actionViewHelp.setText(_translate("MainWindow", "&Help")) + self.actionAbout.setText(_translate("MainWindow", "&About")) if __name__ == "__main__": diff --git a/mini_projects/sketch-with-pygame/README.md b/mini-projects/sketch-with-pygame/README.md similarity index 100% rename from mini_projects/sketch-with-pygame/README.md rename to mini-projects/sketch-with-pygame/README.md diff --git a/mini_projects/sketch-with-pygame/main.py b/mini-projects/sketch-with-pygame/main.py similarity index 100% rename from mini_projects/sketch-with-pygame/main.py rename to mini-projects/sketch-with-pygame/main.py diff --git a/mini_projects/sketch-with-pygame/requirements.txt b/mini-projects/sketch-with-pygame/requirements.txt similarity index 100% rename from mini_projects/sketch-with-pygame/requirements.txt rename to mini-projects/sketch-with-pygame/requirements.txt diff --git a/mini_projects/sketch-with-pygame/sneak-peek.gif b/mini-projects/sketch-with-pygame/sneak-peek.gif similarity index 100% rename from mini_projects/sketch-with-pygame/sneak-peek.gif rename to mini-projects/sketch-with-pygame/sneak-peek.gif diff --git a/mini_projects/text_editor/editor.py b/mini-projects/text-editor/editor.py similarity index 84% rename from mini_projects/text_editor/editor.py rename to mini-projects/text-editor/editor.py index a0fd40c..c2b88ac 100644 --- a/mini_projects/text_editor/editor.py +++ b/mini-projects/text-editor/editor.py @@ -4,38 +4,46 @@ from PyQt5.QtCore import * from PyQt5.QtGui import * + +EDITOR_NAME = "TEXT EDITOR" + + class Ui_MainWindow(QWidget): + filename = None def clear(self): self.textEdit.setText("") def createnewfile(self): - MainWindow.setWindowTitle("Text Editor -*New File") - - def openfile(self,name): - path=sys.path[0] - name=QFileDialog.getOpenFileName(self,"Open File",path,"*.txt")[0] - file=open(name,'r') - text=file.read() - self.textEdit.setText(text) - MainWindow.setWindowTitle("Text Editor -"+name) + MainWindow.setWindowTitle(f"{EDITOR_NAME} -*New File") + self.clear() + + def openfile(self): + name = QFileDialog.getOpenFileName(self, "Open File", sys.path[0], "*.txt")[0] + try: + with open(name, 'r') as file: + text = file.read() + self.textEdit.setText(text) + except Exception as e: + print(e) + else: + self.filename = name + MainWindow.setWindowTitle(f"{EDITOR_NAME} - {name}") - def savefile(self,name): - name='file.txt' - file=open(name,'w') - text=self.textEdit.toPlainText() - file.write(text) - file.close() + def savefile(self): + if self.filename: + with open(self.filename, 'w') as file: + text = self.textEdit.toPlainText() + file.write(text) def saveasfile(self): - name = QFileDialog.getSaveFileName(self,'Save File')[0] - file=open(name,'w') - text=self.textEdit.toPlainText() - file.write(text) - file.close() - MainWindow.setWindowTitle("Text Editor -"+name) + name = QFileDialog.getSaveFileName(self, "Save File")[0] + with open(name, 'w') as file: + text = self.textEdit.toPlainText() + file.write(text) + MainWindow.setWindowTitle(f"{EDITOR_NAME} - {name}") - def setupUi(self, MainWindow): + def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1350, 690) self.centralwidget = QtWidgets.QWidget(MainWindow) @@ -96,7 +104,6 @@ def setupUi(self, MainWindow): self.actionRedo.setObjectName("actionRedo") self.actionRedo.setShortcut("Ctrl+Shift+Z") - self.actionExit = QtWidgets.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionView_Help = QtWidgets.QAction(MainWindow) diff --git a/mini_projects/text_editor/editor.ui b/mini-projects/text-editor/editor.ui similarity index 100% rename from mini_projects/text_editor/editor.ui rename to mini-projects/text-editor/editor.ui diff --git a/mini_projects/text_editor/requirements.txt b/mini-projects/text-editor/requirements.txt similarity index 100% rename from mini_projects/text_editor/requirements.txt rename to mini-projects/text-editor/requirements.txt diff --git a/mini_projects/video_player/icon.png b/mini-projects/video-player/icon.png similarity index 100% rename from mini_projects/video_player/icon.png rename to mini-projects/video-player/icon.png diff --git a/mini_projects/video_player/pause.png b/mini-projects/video-player/pause.png similarity index 100% rename from mini_projects/video_player/pause.png rename to mini-projects/video-player/pause.png diff --git a/mini_projects/video_player/play.png b/mini-projects/video-player/play.png similarity index 100% rename from mini_projects/video_player/play.png rename to mini-projects/video-player/play.png diff --git a/mini_projects/video_player/requirements.txt b/mini-projects/video-player/requirements.txt similarity index 100% rename from mini_projects/video_player/requirements.txt rename to mini-projects/video-player/requirements.txt diff --git a/mini_projects/video_player/video_player.py b/mini-projects/video-player/video_player.py similarity index 100% rename from mini_projects/video_player/video_player.py rename to mini-projects/video-player/video_player.py diff --git a/mini_projects/rock_paper_scissors/README.md b/mini_projects/rock_paper_scissors/README.md deleted file mode 100644 index 49fb00e..0000000 --- a/mini_projects/rock_paper_scissors/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Rock Paper Scissors - -It is a simple game played usually by kids as a way of entertainment or as a tie-breaking tool in certain casesπŸ˜€. \ No newline at end of file diff --git a/mini_projects/rock_paper_scissors/bg.jpg b/mini_projects/rock_paper_scissors/bg.jpg deleted file mode 100644 index 3e6a133..0000000 Binary files a/mini_projects/rock_paper_scissors/bg.jpg and /dev/null differ diff --git a/mini_projects/rock_paper_scissors/rps_console.py b/mini_projects/rock_paper_scissors/rps_console.py deleted file mode 100644 index 43da859..0000000 --- a/mini_projects/rock_paper_scissors/rps_console.py +++ /dev/null @@ -1,51 +0,0 @@ -import random - -computer=['rock', 'paper', 'scissors'] - -def play(user, computer): - # a = random.randint(0,2) - choice = random.choice(computer) - - print("Computer: ", choice)##we could also use #computer[a] - - if user == "rock": - if choice == "scissors": - print("User won.") - elif choice == "paper": - print("User lost.") - else: - print("It is a tie.") - - elif user == "paper": - if choice == "scissors": - print("User lost.") - elif choice == "rock": - print("User won.") - else: - print("It is a tie.") - - elif user == "scissors": - if choice == "rock": - print("User lost.") - elif choice == "paper": - print("User won.") - else: - print("It is a tie.") - -user = None - -while user not in computer: - user = str(input("Enter:\n1.Rock\n2.Paper\n3.Scissors\n")) - - print("-" * 20) - - if user in computer: - print("User: ", user) - play(user, computer) - break - else: - print("Not a valid one. Try again...\n") - - - - diff --git a/notebook_files/first.ipynb b/notebooks/first.ipynb similarity index 100% rename from notebook_files/first.ipynb rename to notebooks/first.ipynb diff --git a/notebook_files/jacobi.ipynb b/notebooks/jacobi.ipynb similarity index 100% rename from notebook_files/jacobi.ipynb rename to notebooks/jacobi.ipynb diff --git a/notebook_files/matplotlib.ipynb b/notebooks/matplotlib.ipynb similarity index 100% rename from notebook_files/matplotlib.ipynb rename to notebooks/matplotlib.ipynb diff --git a/notebook_files/second.ipynb b/notebooks/second.ipynb similarity index 100% rename from notebook_files/second.ipynb rename to notebooks/second.ipynb