├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json └── settings.json ├── 100_movies_list ├── .idea │ ├── .gitignore │ ├── 100_movies_list.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── main.py └── movies.txt ├── ArtSlate ├── .idea │ ├── .gitignore │ ├── ArtSlate.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── Auto Job Application submit on linkedin └── main.py ├── Automate-Birthday-Wisher ├── .idea │ ├── .gitignore │ ├── Automate-Birthday-Wisher.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── main.py └── qoutes.txt ├── BookTrackerApp ├── .idea │ ├── .gitignore │ ├── BookTrackerApp.iml │ ├── dataSources.xml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── __pycache__ │ └── app.cpython-38.pyc ├── app.py ├── books-collection.db └── templates │ ├── add.html │ ├── edit.html │ └── index.html ├── CoffeeMachine ├── .gitignore └── main.py ├── CoffeeMachineOPP ├── .idea │ ├── .gitignore │ ├── CoffeeMachineOPP.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── __pycache__ │ ├── coffee_maker.cpython-38.pyc │ ├── menu.cpython-38.pyc │ └── money_machine.cpython-38.pyc ├── coffee_maker.py ├── main.py ├── menu.py └── money_machine.py ├── Coffeefi ├── .idea │ ├── .gitignore │ ├── Coffeefi.iml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── Demos │ ├── Screenshot_2021-01-05 Add Cafes.png │ ├── Screenshot_2021-01-05 All Cafes.png │ └── Screenshot_2021-01-05 Coffee Wi-fi.png ├── README.md ├── __pycache__ │ └── app.cpython-38.pyc ├── app.py ├── cafe-data.csv ├── requirements.txt ├── static │ └── css │ │ └── style.css └── templates │ ├── add.html │ ├── cafes.html │ └── index.html ├── FlasKBlog ├── .gitignore ├── Demo │ ├── Screenshot_2021-01-03 Flask Blog(1).png │ └── Screenshot_2021-01-03 Flask Blog.png ├── README.md ├── app.py ├── static │ ├── css │ │ ├── clean-blog.css │ │ └── clean-blog.min.css │ ├── img │ │ ├── about-bg.jpg │ │ ├── contact-bg.jpg │ │ ├── home-bg.jpg │ │ ├── post-bg.jpg │ │ └── post-sample-image.jpg │ ├── js │ │ ├── clean-blog.js │ │ ├── clean-blog.min.js │ │ ├── contact_me.js │ │ └── jqBootstrapValidation.js │ └── vendor │ │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── fontawesome-free │ │ ├── css │ │ │ ├── all.css │ │ │ ├── all.min.css │ │ │ ├── brands.css │ │ │ ├── brands.min.css │ │ │ ├── fontawesome.css │ │ │ ├── fontawesome.min.css │ │ │ ├── regular.css │ │ │ ├── regular.min.css │ │ │ ├── solid.css │ │ │ ├── solid.min.css │ │ │ ├── svg-with-js.css │ │ │ ├── svg-with-js.min.css │ │ │ ├── v4-shims.css │ │ │ └── v4-shims.min.css │ │ └── webfonts │ │ │ ├── fa-brands-400.eot │ │ │ ├── fa-brands-400.svg │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-brands-400.woff │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.eot │ │ │ ├── fa-regular-400.svg │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-regular-400.woff │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-solid-900.eot │ │ │ ├── fa-solid-900.svg │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-solid-900.woff │ │ │ └── fa-solid-900.woff2 │ │ └── jquery │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ ├── jquery.slim.js │ │ ├── jquery.slim.min.js │ │ └── jquery.slim.min.map └── templates │ ├── about.html │ ├── contact.html │ ├── footer.html │ ├── header.html │ ├── index.html │ └── post.html ├── HabitTracker ├── .idea │ ├── .gitignore │ ├── HabitTracker.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── ISS-Tracker ├── .idea │ ├── .gitignore │ ├── ISS-Tracker.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── InternetSpeedMeter ├── .idea │ ├── .gitignore │ ├── InternetSpeedMeter.iml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── ism.gif └── main.py ├── Kanye-Quotes ├── .idea │ ├── .gitignore │ ├── Kanye-Quotes.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── background.png ├── kanye.png └── main.py ├── LICENSE ├── Mile_to_KM_Converter_GUI ├── .idea │ ├── .gitignore │ ├── Mile_to_KM_Converter_GUI.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── Personal_Flight_Club ├── .gitignore ├── .idea │ ├── .gitignore │ ├── Personal_Flight_Club.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── LICENSE.md ├── README.md ├── data_manager.py ├── flight_data.py ├── flight_search.py ├── main.py └── notification_manager.py ├── Pomodoro ├── .idea │ ├── .gitignore │ ├── Pomodoro.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── favicon.ico ├── main.py └── tomato.png ├── PongGame ├── .idea │ ├── .gitignore │ ├── PongGame.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── __pycache__ │ ├── ball.cpython-38.pyc │ ├── paddle.cpython-38.pyc │ └── scoreboard.cpython-38.pyc ├── ball.py ├── main.py ├── paddle.py └── scoreboard.py ├── QuizGame ├── .idea │ ├── .gitignore │ ├── QuizGame.iml │ ├── codeStyles │ │ └── codeStyleConfig.xml │ ├── copyright │ │ ├── K_M_H_Mubin.xml │ │ └── profiles_settings.xml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── __pycache__ │ ├── data.cpython-38.pyc │ ├── question_model.cpython-38.pyc │ └── quiz_brain.cpython-38.pyc ├── data.py ├── main.py ├── question_model.py └── quiz_brain.py ├── QuizerApp ├── .idea │ ├── .gitignore │ ├── QuizerApp.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── __pycache__ │ ├── data.cpython-38.pyc │ ├── question_model.cpython-38.pyc │ ├── quiz_brain.cpython-38.pyc │ └── ui.cpython-38.pyc ├── data.py ├── images │ ├── cross.png │ └── tick.png ├── main.py ├── question_model.py ├── quiz_brain.py └── ui.py ├── README.md ├── RainAlert ├── .idea │ ├── .gitignore │ ├── RainAlert.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── SnakeGame ├── .idea │ ├── .gitignore │ ├── SnakeGame.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── __pycache__ │ ├── food.cpython-38.pyc │ ├── scoreboard.cpython-38.pyc │ └── snake.cpython-38.pyc ├── data.txt ├── food.py ├── main.py ├── scoreboard.py └── snake.py ├── StockNewsAleart ├── .idea │ ├── .gitignore │ ├── StockNewsAleart.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── TopMovieList ├── .idea │ ├── .gitignore │ ├── TopMovieList.iml │ ├── dataSources.xml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── __pycache__ │ └── app.cpython-38.pyc ├── app.py ├── demo.png ├── frontend │ ├── index.html │ └── styles.css ├── movies.db ├── static │ └── css │ │ └── styles.css └── templates │ ├── add.html │ ├── edit.html │ ├── index.html │ └── select.html ├── Tresure_Island.py ├── TurtleCrossingGame ├── .idea │ ├── .gitignore │ ├── TurtleCrossingGame.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── __pycache__ │ ├── car_manager.cpython-38.pyc │ ├── player.cpython-38.pyc │ └── scoreboard.cpython-38.pyc ├── car_manager.py ├── main.py ├── player.py └── scoreboard.py ├── TurtleDotArt ├── .idea │ ├── .gitignore │ ├── TurtleDotArt.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── image.jpg └── main.py ├── TurtleRace ├── .idea │ ├── .gitignore │ ├── TurtleRace.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── US_States_Quiz_Game ├── .idea │ ├── .gitignore │ ├── US_States_Quiz_Game.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── 50_states.csv ├── States to learn.csv ├── blank_states_img.gif └── main.py ├── WorkoutTracking ├── .idea │ ├── .gitignore │ ├── WorkoutTracking.iml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml └── main.py ├── average_height_using_for_loop.py ├── black_jack.py ├── blind_auction.py ├── bmi.py ├── caesar_cipher.py ├── calculator_app.py ├── fizzbuzz.py ├── flaskWTForm ├── .idea │ ├── .gitignore │ ├── flaskWTForm.iml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── __pycache__ │ └── app.cpython-38.pyc ├── app.py └── templates │ ├── base.html │ ├── denied.html │ ├── index.html │ ├── login.html │ └── success.html ├── guess_the_number.py ├── hangman ├── __pycache__ │ ├── hangman_art.cpython-38.pyc │ └── hangman_words.cpython-38.pyc ├── hangman.py ├── hangman_art.py └── hangman_words.py ├── hello.py ├── higher_or_lower_game ├── art.py ├── game_data.py └── higher_lower.py ├── leapyear.py ├── life_in_weeks.py ├── love_calculator.py ├── password_generator.py ├── rock_paper_scissor.py ├── tipcal.py ├── tresure_map.py └── whos_paying.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | GuessNumberWebApp/ 3 | 4 | InstaFollowerBot/ 5 | 6 | GuessAge_Gender/ 7 | 8 | GamingBot/ 9 | 10 | InternetSpeedTwitteBot/ 11 | 12 | NameCard/ 13 | 14 | SanFranciscoRentingAutomation/ 15 | 16 | TinderBot/ 17 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Python: Current File", 9 | "type": "python", 10 | "request": "launch", 11 | "program": "${file}", 12 | "console": "integratedTerminal" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/home/devbox/anaconda3/envs/practice/bin/python", 3 | "python.testing.promptToConfigure": false, 4 | "python.testing.pytestEnabled": false, 5 | "python.testing.unittestEnabled": false, 6 | "python.testing.nosetestsEnabled": false 7 | } -------------------------------------------------------------------------------- /100_movies_list/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\100_movies_list\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /100_movies_list/.idea/100_movies_list.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /100_movies_list/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /100_movies_list/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /100_movies_list/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /100_movies_list/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /100_movies_list/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | 4 | # assign the target url 5 | URL = "https://www.empireonline.com/movies/features/best-movies-2/" 6 | 7 | # requesting the url 8 | response = requests.get(URL) 9 | 10 | # get the raw html 11 | website_html = response.text 12 | 13 | # crawling the html 14 | soup = BeautifulSoup(website_html, "html.parser") 15 | 16 | # printing the whole website html 17 | # print(soup.prettify()) 18 | 19 | # finding the h3 tags and grab the movies titles 20 | all_movies = soup.findAll(name="h3", class_="title") 21 | # print all movies 22 | # print(all_movies) 23 | 24 | # creating a movie list using list comprehension 25 | movie_titles = [movie.getText() for movie in all_movies] 26 | # print all movies 27 | # print(movie_titles) 28 | 29 | # reversing the list using splice operator 30 | movies = movie_titles[::-1] 31 | 32 | # creating a new file to store the list 33 | with open("movies.txt", mode="w", encoding="utf-8") as file: 34 | for movie in movies: 35 | file.write(f"{movie}\n") 36 | -------------------------------------------------------------------------------- /100_movies_list/movies.txt: -------------------------------------------------------------------------------- 1 | 1)The Godfather 2 | 2) The Empire Strikes Back 3 | 3) The Dark Knight 4 | 4) The Shawshank Redemption 5 | 5) Pulp Fiction 6 | 6) Goodfellas 7 | 7) Raiders Of The Lost Ark 8 | 8) Jaws 9 | 9) Star Wars 10 | 10) The Lord Of The Rings: The Fellowship Of The Ring 11 | 11) Back To The Future 12 | 12: The Godfather Part II 13 | 13) Blade Runner 14 | 14) Alien 15 | 15) Aliens 16 | 16) The Lord Of The Rings: The Return Of The King 17 | 17) Fight Club 18 | 18) Inception 19 | 19) Jurassic Park 20 | 20) Die Hard 21 | 21) 2001: A Space Odyssey 22 | 22) Apocalypse Now 23 | 23) The Lord Of The Rings: The Two Towers 24 | 24) The Matrix 25 | 25) Terminator 2: Judgment Day 26 | 26) Heat 27 | 27) The Good, The Bad And The Ugly 28 | 28) Casablanca 29 | 29) The Big Lebowski 30 | 30) Seven 31 | 31) Taxi Driver 32 | 32) The Usual Suspects 33 | 33) Schindler's List 34 | 34) Guardians Of The Galaxy 35 | 35) The Shining 36 | 36) The Departed 37 | 37) The Thing 38 | 38) Mad Max: Fury Road 39 | 39) Saving Private Ryan 40 | 40) 12 Angry Men 41 | 41) Eternal Sunshine Of The Spotless Mind 42 | 42) There Will Be Blood 43 | 43) One Flew Over The Cuckoo's Nest 44 | 44) Gladiator 45 | 45) Drive 46 | 46) Citizen Kane 47 | 47) Interstellar 48 | 48) The Silence Of The Lambs 49 | Trainspotting 50 | 50) Lawrence Of Arabia 51 | 51) It's A Wonderful Life 52 | 52) Once Upon A Time In The West 53 | 53) Psycho 54 | 54) Vertigo 55 | 55) Pan's Labyrinth 56 | 56) Reservoir Dogs 57 | 57) Whiplash 58 | 58) Inglourious Basterds 59 | 59) E.T. – The Extra Terrestrial 60 | 60) American Beauty 61 | 61) Forrest Gump 62 | 62) La La Land 63 | 63) Donnie Darko 64 | 64) L.A. Confidential 65 | 65) Avengers Assemble 66 | 66) Return Of The Jedi 67 | 67) Memento 68 | 68) Ghostbusters 69 | 69) Singin' In The Rain 70 | 70) The Lion King 71 | 71) Hot Fuzz 72 | 72) Rear Window 73 | 73) Seven Samurai 74 | 74) Mulholland Dr. 75 | 75) Fargo 76 | 76) A Clockwork Orange 77 | 77) Toy Story 78 | 78) Oldboy 79 | 79) Captain America: Civil War 80 | 15) Spirited Away 81 | 81) The Social Network 82 | 82) Some Like It Hot 83 | 83) True Romance 84 | 84) Rocky 85 | 85) Léon 86 | 86) Indiana Jones And The Last Crusade 87 | 87) Predator 88 | 88) The Exorcist 89 | 89) Shaun Of The Dead 90 | 90) No Country For Old Men 91 | 91) The Prestige 92 | 92) The Terminator 93 | 2) The Princess Bride 94 | 94) Lost In Translation 95 | 95) Arrival 96 | 96) Good Will Hunting 97 | 97) Titanic 98 | 98) Amelie 99 | 99) Raging Bull 100 | 100) Stand By Me 101 | -------------------------------------------------------------------------------- /ArtSlate/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../../../../:\Users\kmhmu\Documents\GitHub\Python-Projects\ArtSlate\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /ArtSlate/.idea/ArtSlate.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ArtSlate/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /ArtSlate/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ArtSlate/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ArtSlate/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ArtSlate/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | # creating objects 4 | tim = Turtle() 5 | screen = Screen() 6 | 7 | 8 | def move_forward(): 9 | tim.forward(10) 10 | 11 | 12 | def move_backward(): 13 | tim.backward(10) 14 | 15 | 16 | def turn_left(): 17 | new_heading = tim.heading() + 10 18 | tim.setheading(new_heading) 19 | 20 | 21 | def turn_right(): 22 | new_heading = tim.heading() - 10 23 | tim.setheading(new_heading) 24 | 25 | 26 | def clear(): 27 | # only clean the turtle drawing 28 | tim.clear() 29 | # after clear pen up 30 | tim.penup() 31 | # after clear go back to center of the screen 32 | tim.home() 33 | # after reach home then pen down 34 | tim.pendown() 35 | 36 | 37 | # add event listener 38 | screen.listen() 39 | # when space key pressed then tim forward 50 40 | screen.onkey(key="w", fun=move_forward) 41 | screen.onkey(key="s", fun=move_backward) 42 | screen.onkey(key="a", fun=turn_left) 43 | screen.onkey(key="d", fun=turn_right) 44 | screen.onkey(key="c", fun=clear) 45 | # exit if clicked 46 | screen.exitonclick() 47 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../../../../:\Users\kmhmu\Documents\GitHub\Python-Projects\Automate-Birthday-Wisher\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/.idea/Automate-Birthday-Wisher.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/main.py: -------------------------------------------------------------------------------- 1 | import smtplib 2 | import datetime as dt 3 | import random 4 | 5 | MY_EMAIL = "example@example.com" 6 | MY_PASSWORD = "aslkdjflsjdlajk" 7 | 8 | # current day 9 | now = dt.datetime.now() 10 | # current weekday 11 | weekday = now.weekday() 12 | 13 | if weekday == 1: 14 | with open("qoutes.txt") as quote_file: 15 | all_quotes = quote_file.readlines() 16 | quote = random.choice(all_quotes) 17 | 18 | print(quote) 19 | with smtplib.SMTP("smtp.gmail.com") as connection: 20 | connection.starttls() 21 | connection.login(MY_EMAIL, MY_PASSWORD) 22 | connection.sendmail(from_addr=MY_EMAIL, to_addrs=MY_EMAIL, msg=f"Subject: Monday Motivation \n\n {quote}") 23 | -------------------------------------------------------------------------------- /Automate-Birthday-Wisher/qoutes.txt: -------------------------------------------------------------------------------- 1 | “The pleasure which we most rarely experience gives us greatest delight.” 2 | “It's been my experience that you can nearly always enjoy things if you make up your mind firmly that you will.” 3 | “Happiness is acceptance.” 4 | “The secret of happiness is not in doing what one likes, but in liking what one does.” 5 | “We begin from the recognition that all beings cherish happiness and do not want suffering. It then becomes both morally wrong and pragmatically unwise to pursue only one’s own happiness oblivious to the feelings and aspirations of all others who surround us as members of the same human family. The wiser course is to think of others when pursuing our own happiness.” 6 | “Most people would rather be certain they’re miserable, than risk being happy.” 7 | “The unhappy derive comfort from the misfortunes of others.” 8 | “For many men, the acquisition of wealth does not end their troubles, it only changes them.” 9 | “A table, a chair, a bowl of fruit and a violin; what else does a man need to be happy?” -------------------------------------------------------------------------------- /BookTrackerApp/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\BookTrackerApp\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/BookTrackerApp.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sqlite.xerial 6 | true 7 | org.sqlite.JDBC 8 | jdbc:sqlite:E:\GitHub\Python-Projects\BookTrackerApp\new-books-collection.db 9 | $ProjectFileDir$ 10 | 11 | 12 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BookTrackerApp/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BookTrackerApp/README.md: -------------------------------------------------------------------------------- 1 | # Book Tracker App in Flask 2 | 3 | A simple book tracker app powered by flask. 4 | 5 | ## Technologies 6 | 7 | - Flask 8 | - Flask SQLAlchemy 9 | - SQLite3 10 | -------------------------------------------------------------------------------- /BookTrackerApp/__pycache__/app.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/BookTrackerApp/__pycache__/app.cpython-38.pyc -------------------------------------------------------------------------------- /BookTrackerApp/books-collection.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/BookTrackerApp/books-collection.db -------------------------------------------------------------------------------- /BookTrackerApp/templates/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book Add 6 | 7 | 8 |
9 | Book Name 10 | 11 | Author Name 12 | 13 | Rating 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /BookTrackerApp/templates/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Edit Books 6 | 7 | 8 |
9 |

Book Name: {{ book.title }}

10 |

Current Rating: {{ book.rating }}

11 | 12 | 13 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /BookTrackerApp/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book Tracker 6 | 7 | 8 |

My Library

9 | 10 | {#if there is no book then show empty message#} 11 | 12 | {% if books ==[]: %} 13 |

Library is empty

14 | {% endif %} 15 | 16 | 27 | 28 | Add New book 29 | 30 | -------------------------------------------------------------------------------- /CoffeeMachine/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/* 2 | .pytest_cache -------------------------------------------------------------------------------- /CoffeeMachineOPP/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../../../../:\Users\kmhmu\Documents\GitHub\Python-Projects\CoffeeMachineOPP\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/.idea/CoffeeMachineOPP.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/__pycache__/coffee_maker.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/CoffeeMachineOPP/__pycache__/coffee_maker.cpython-38.pyc -------------------------------------------------------------------------------- /CoffeeMachineOPP/__pycache__/menu.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/CoffeeMachineOPP/__pycache__/menu.cpython-38.pyc -------------------------------------------------------------------------------- /CoffeeMachineOPP/__pycache__/money_machine.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/CoffeeMachineOPP/__pycache__/money_machine.cpython-38.pyc -------------------------------------------------------------------------------- /CoffeeMachineOPP/coffee_maker.py: -------------------------------------------------------------------------------- 1 | # Coffee maker class 2 | 3 | class CoffeeMaker: 4 | """Models the machine that makes the coffeee""" 5 | 6 | def __init__(self): 7 | self.resources = { 8 | "water": 300, 9 | "milk": 200, 10 | "coffee": 100 11 | } 12 | 13 | def report(self): 14 | """Prints a report of all resources""" 15 | print(f"Water: {self.resources['water']} ml") 16 | print(f"Milk: {self.resources['milk']} ml") 17 | print(f"Coffee: {self.resources['coffee']} g") 18 | 19 | def is_resource_sufficient(self, drink): 20 | """Returns True when order can be made, False if ingredients are insufficient.""" 21 | can_make = True 22 | for item in drink.ingredients: 23 | if drink.ingredients[item] > self.resources[item]: 24 | print(f"Sorry there is not enough {item}.") 25 | can_make = False 26 | return can_make 27 | 28 | def make_coffee(self, order): 29 | """Deducts the required ingredients from the resources""" 30 | for item in order.ingredients: 31 | self.resources[item] -= order.ingredients[item] 32 | print(f"Here is your {order.name} ☕. Enjoy. ") 33 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/main.py: -------------------------------------------------------------------------------- 1 | # Import from classes 2 | 3 | from menu import Menu, MenuItem 4 | from coffee_maker import CoffeeMaker 5 | from money_machine import MoneyMachine 6 | 7 | # creating object 8 | money_machine = MoneyMachine() 9 | coffee_maker = CoffeeMaker() 10 | menu = Menu() 11 | 12 | # is machine on. default true 13 | is_on = True 14 | 15 | while is_on: 16 | options = menu.get_items() 17 | choice = input(f" What would you like? ({options}) \n=> ") 18 | if choice == "off": 19 | is_on = False 20 | elif choice == "report": 21 | coffee_maker.report() 22 | money_machine.report() 23 | else: 24 | drink = menu.find_drink(choice) 25 | is_enough_ingredients = coffee_maker.is_resource_sufficient(drink) 26 | is_payment_successful = money_machine.make_payment(drink.cost) 27 | if is_enough_ingredients and is_payment_successful: 28 | coffee_maker.make_coffee(drink) 29 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/menu.py: -------------------------------------------------------------------------------- 1 | # Coffee Machine Menu option class 2 | 3 | class MenuItem: 4 | """Models each Menu Item""" 5 | 6 | def __init__(self, name, water, milk, coffee, cost): 7 | self.name = name 8 | self.cost = cost 9 | self.ingredients = { 10 | "water": water, 11 | "milk": milk, 12 | "coffee": coffee 13 | } 14 | 15 | 16 | class Menu: 17 | """ Models the menu with drinks""" 18 | 19 | def __init__(self): 20 | self.menu = [ 21 | MenuItem(name="latte", water=200, milk=150, coffee=24, cost=2.5), 22 | MenuItem(name="espresso", water=50, milk=0, coffee=18, cost=1.5), 23 | MenuItem(name="cappuccino", water=250, milk=50, coffee=24, cost=3) 24 | ] 25 | 26 | def get_items(self): 27 | """Returns all the names of the available menu items""" 28 | options = "" 29 | for item in self.menu: 30 | options += f"{item.name} / " 31 | return options 32 | 33 | def find_drink(self, order_name): 34 | """Searches the menu for a particular drink by name. Returns that item if it exits, otherwise returns 35 | None""" 36 | for item in self.menu: 37 | if item.name == order_name: 38 | return item 39 | print("Sorry that item is not available") 40 | -------------------------------------------------------------------------------- /CoffeeMachineOPP/money_machine.py: -------------------------------------------------------------------------------- 1 | class MoneyMachine: 2 | CURRENCY = "$" 3 | 4 | COIN_VALUES = { 5 | "quarters": 0.25, 6 | "dimes": 0.10, 7 | "nickles": 0.05, 8 | "pennies": 0.01 9 | } 10 | 11 | def __init__(self): 12 | self.profit = 0 13 | self.money_received = 0 14 | 15 | def report(self): 16 | """Prints the current profit""" 17 | print(f"Money: {self.CURRENCY} {self.profit}") 18 | 19 | def process_coins(self): 20 | """Returns the total calculated from coins inserted.""" 21 | print("Please insert coins.") 22 | for coin in self.COIN_VALUES: 23 | self.money_received += int(input(f"How many {coin}? \n=> ")) * self.COIN_VALUES[coin] 24 | return self.money_received 25 | 26 | def make_payment(self, cost): 27 | """Returns True when payment is accepted, or False if insufficient.""" 28 | self.process_coins() 29 | if self.money_received >= cost: 30 | change = round(self.money_received - cost, 2) 31 | print(f"Here is {self.CURRENCY}{change} in change.") 32 | self.profit += cost 33 | self.money_received = 0 34 | return True 35 | else: 36 | print("Sorry that's not enough money. Money refunded.") 37 | self.money_received = 0 38 | return False 39 | -------------------------------------------------------------------------------- /Coffeefi/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\Coffeefi\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Coffeefi/.idea/Coffeefi.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /Coffeefi/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /Coffeefi/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Coffeefi/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Coffeefi/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Coffeefi/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Coffeefi/Demos/Screenshot_2021-01-05 Add Cafes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Coffeefi/Demos/Screenshot_2021-01-05 Add Cafes.png -------------------------------------------------------------------------------- /Coffeefi/Demos/Screenshot_2021-01-05 All Cafes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Coffeefi/Demos/Screenshot_2021-01-05 All Cafes.png -------------------------------------------------------------------------------- /Coffeefi/Demos/Screenshot_2021-01-05 Coffee Wi-fi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Coffeefi/Demos/Screenshot_2021-01-05 Coffee Wi-fi.png -------------------------------------------------------------------------------- /Coffeefi/README.md: -------------------------------------------------------------------------------- 1 | # Coffee fi 2 | 3 | A simple Cafe list bootstrap website. 4 | 5 | ## Technologies 6 | 7 | * Flask 8 | * Flask Bootstrap 9 | * Flask WTForm 10 | * CSV 11 | 12 | ## Installation 13 | 14 | 1. First clone or download the project file 15 | 2. Create a python environment then install all the packages from requirements file. 16 | 3. Run the project 17 | 18 | > note: I'm using conda environment, but you can use virtualenv. 19 | 20 | ## Demo 21 | 22 | #### Homepage 23 | 24 | ![Homepage](https://github.com/kmhmubin/Python-Projects/blob/master/Coffeefi/Demos/Screenshot_2021-01-05%20Coffee%20Wi-fi.png) 25 | 26 | #### Cafe lists 27 | 28 | ![Cafe list](https://github.com/kmhmubin/Python-Projects/blob/master/Coffeefi/Demos/Screenshot_2021-01-05%20All%20Cafes.png) 29 | 30 | #### Add Cafes 31 | 32 | ![Add Cafes](https://github.com/kmhmubin/Python-Projects/blob/master/Coffeefi/Demos/Screenshot_2021-01-05%20Add%20Cafes.png) -------------------------------------------------------------------------------- /Coffeefi/__pycache__/app.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Coffeefi/__pycache__/app.cpython-38.pyc -------------------------------------------------------------------------------- /Coffeefi/cafe-data.csv: -------------------------------------------------------------------------------- 1 | Cafe Name ,Location ,Open,Close,Coffee,Wifi ,Power 2 | Beans & Aroma Coffees ,https://goo.gl/maps/J26EAaWwnALWk1XCA,8AM ,12AM ,☕☕☕☕ ,💪💪💪💪 ,🔌🔌🔌🔌 3 | Butlers Chocolate Cafe Gulshan ,https://goo.gl/maps/wZZZk84T1DJtT6qAA,8AM ,12AM ,☕☕☕☕☕ ,💪💪💪💪💪,🔌🔌🔌🔌🔌 4 | Art Cafe ,https://goo.gl/maps/pvxCyvWWTAdKFycc7,10AM,11PM ,☕☕☕☕ ,💪💪💪💪 ,🔌🔌🔌🔌🔌 5 | Coffee World Uttara ,https://goo.gl/maps/FG83Xip9ApcQnfvC7,9AM ,12AM ,☕☕☕ ,💪💪💪 ,🔌🔌🔌🔌 6 | The White Canary Cafe And Marble Slab Creamery,https://goo.gl/maps/LjVLjud1iVUPG1u97,7AM ,1AM ,☕☕☕☕ ,💪💪💪💪 ,🔌🔌🔌🔌 7 | North End Coffee Roasters ,https://goo.gl/maps/CDdLCqje9tx56FwQA,8AM ,9PM ,☕☕☕☕☕ ,💪💪💪💪💪,🔌🔌🔌🔌🔌 -------------------------------------------------------------------------------- /Coffeefi/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2020.12.5 2 | click==7.1.2 3 | dominate==2.6.0 4 | Flask==1.1.2 5 | Flask-Bootstrap==3.3.7.1 6 | Flask-WTF==0.14.3 7 | itsdangerous==1.1.0 8 | Jinja2==2.11.2 9 | MarkupSafe==1.1.1 10 | visitor==0.1.3 11 | Werkzeug==1.0.1 12 | wincertstore==0.2 13 | WTForms==2.3.3 14 | -------------------------------------------------------------------------------- /Coffeefi/static/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #333; 3 | color: white; 4 | } 5 | 6 | a { 7 | color: #ffc107; 8 | } 9 | 10 | .jumbotron { 11 | display: flex; 12 | align-items: center; 13 | margin: 0; 14 | height: 100vh; 15 | color: white; 16 | background-color: #333; 17 | } 18 | 19 | .space-above { 20 | margin-top: 20px; 21 | padding-top: 20px; 22 | } -------------------------------------------------------------------------------- /Coffeefi/templates/add.html: -------------------------------------------------------------------------------- 1 | {# import flask bootstrap style#} 2 | {% extends 'bootstrap/base.html' %} 3 | 4 | {# import wtform #} 5 | {% import "bootstrap/wtf.html" as wtf %} 6 | 7 | 8 | {# adding custom styles #} 9 | {% block styles %} 10 | {# import everything from bootstrap #} 11 | {{ super() }} 12 | {#custom style link#} 13 | 14 | {% endblock %} 15 | 16 | 17 | {# Daynamically change the title of the website #} 18 | 19 | {% block title %}Add Cafes{% endblock %} 20 | 21 | {#website body content#} 22 | 23 | {% block content %} 24 | 25 |
26 |
27 |
28 | 29 |

Add a new cafe into the database

30 | 31 | {# Generatating wtform automatically #} 32 | 33 | {{ wtf.quick_form(form, novalidate=True) }} 34 | 35 |

36 | See All Cafes 37 |

38 |
39 |
40 |
41 | 42 | {% endblock %} -------------------------------------------------------------------------------- /Coffeefi/templates/cafes.html: -------------------------------------------------------------------------------- 1 | {# import flask bootstrap style#} 2 | {% extends 'bootstrap/base.html' %} 3 | 4 | {# adding custom styles #} 5 | {% block styles %} 6 | {# import everything from bootstrap #} 7 | {{ super() }} 8 | {#custom style link#} 9 | 10 | {% endblock %} 11 | 12 | 13 | {# Daynamically change the title of the website #} 14 | 15 | {% block title %}All Cafes{% endblock %} 16 | 17 | {#website body content#} 18 | 19 | {% block content %} 20 | 21 |
22 |
23 |
24 | All Cafes 25 | 26 | 27 | 28 | {% for row in cafes %} 29 | 30 | 31 | {% for item in row %} 32 | {% if item[0:4] == "http" %} 33 | 34 | {% else %} 35 | 36 | {% endif %} 37 | 38 | {% endfor %} 39 | 40 | 41 | {% endfor %} 42 |
Maps Link{{ item }}
43 |

Return to Home Page

44 |
45 |
46 |
47 | 48 | {% endblock %} -------------------------------------------------------------------------------- /Coffeefi/templates/index.html: -------------------------------------------------------------------------------- 1 | {# import flask bootstrap style#} 2 | {% extends 'bootstrap/base.html' %} 3 | 4 | {# adding custom styles #} 5 | {% block styles %} 6 | {# import everything from bootstrap #} 7 | {{ super() }} 8 | {#custom style link#} 9 | 10 | {% endblock %} 11 | 12 | 13 | {# Daynamically change the title of the website #} 14 | 15 | {% block title %}Coffee & Wi-fi{% endblock %} 16 | 17 | {#website body content#} 18 | 19 | {% block content %} 20 | 21 |
22 |
23 |

Coffee & Wi-fi

24 |

Want to work in a cafe but need wifi?

25 |
26 |

You've found the right place! Checkout my collection of cafes with data on power socket availability, 27 | wi-fi 28 | speed and coffee quality.

29 | Show Me 30 |
31 |
32 | 33 | {% endblock %} -------------------------------------------------------------------------------- /FlasKBlog/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | __pycache__ -------------------------------------------------------------------------------- /FlasKBlog/Demo/Screenshot_2021-01-03 Flask Blog(1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/Demo/Screenshot_2021-01-03 Flask Blog(1).png -------------------------------------------------------------------------------- /FlasKBlog/Demo/Screenshot_2021-01-03 Flask Blog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/Demo/Screenshot_2021-01-03 Flask Blog.png -------------------------------------------------------------------------------- /FlasKBlog/README.md: -------------------------------------------------------------------------------- 1 | # A Bootstrap Theme Blog Powered By Flask 2 | 3 | A simple and full responsive Bootstrap blog powered by Flask. 4 | 5 | ## Technologies 6 | 7 | ### Frontend 8 | * HTML 5 9 | * CSS 3 10 | * JavaScript 11 | * Bootstrap 12 | 13 | ### Backend 14 | * Flask 15 | 16 | 17 | ## Installation 18 | 19 | 1. First clone or download the files. 20 | 2. Install Flask framework 21 | ```bash 22 | pip install Flask 23 | ``` 24 | 3. Install requests module 25 | ```bash 26 | pip install requests 27 | ``` 28 | 4. Run the app using 29 | ```bash 30 | flask run 31 | ``` 32 | 33 | 34 | ## Demo 35 | 36 | ### Desktop 37 | 38 | ![Desktop](https://github.com/kmhmubin/Python-Projects/blob/master/FlasKBlog/Demo/Screenshot_2021-01-03%20Flask%20Blog.png) 39 | 40 | 41 | ### Mobile 42 | 43 | ![Mobile](https://github.com/kmhmubin/Python-Projects/blob/master/FlasKBlog/Demo/Screenshot_2021-01-03%20Flask%20Blog(1).png) -------------------------------------------------------------------------------- /FlasKBlog/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, request 2 | import requests 3 | import smtplib 4 | 5 | # fake post from apis 6 | posts = requests.get("https://api.npoint.io/493622f5077bee2314fa").json() 7 | 8 | # constant 9 | OWN_EMAIL = "Your Email Address" 10 | OWN_PASSWORD = "Your Password" 11 | 12 | app = Flask(__name__) 13 | 14 | 15 | @app.route('/') 16 | def home(): 17 | return render_template("index.html", all_post=posts) 18 | 19 | 20 | @app.route('/post/') 21 | def show_post(index): 22 | requested_post = None 23 | for blog_post in posts: 24 | if blog_post["id"] == index: 25 | requested_post = blog_post 26 | return render_template("post.html", post=requested_post) 27 | 28 | 29 | @app.route('/about') 30 | def about(): 31 | return render_template("about.html") 32 | 33 | 34 | # grab all the data from contact form 35 | @app.route("/contact", methods=["GET", "POST"]) 36 | def contact(): 37 | if request.method == "POST": 38 | data = request.form 39 | data = request.form 40 | send_email(data["name"], data["email"], data["phone"], data["message"]) 41 | return render_template("contact.html", msg_sent=True) 42 | return render_template("contact.html", msg_sent=False) 43 | 44 | 45 | # sent mail automatically with the given data 46 | def send_email(name, email, phone, message): 47 | email_message = f"Subject:New Message\n\nName: {name}\nEmail: {email}\nPhone: {phone}\nMessage:{message}" 48 | with smtplib.SMTP("smtp.gmail.com") as connection: 49 | connection.starttls() 50 | connection.login(OWN_EMAIL, OWN_PASSWORD) 51 | connection.sendmail(OWN_EMAIL, OWN_EMAIL, email_message) 52 | 53 | 54 | if __name__ == '__main__': 55 | app.run() 56 | -------------------------------------------------------------------------------- /FlasKBlog/static/img/about-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/static/img/about-bg.jpg -------------------------------------------------------------------------------- /FlasKBlog/static/img/contact-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/static/img/contact-bg.jpg -------------------------------------------------------------------------------- /FlasKBlog/static/img/home-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/static/img/home-bg.jpg -------------------------------------------------------------------------------- /FlasKBlog/static/img/post-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/static/img/post-bg.jpg -------------------------------------------------------------------------------- /FlasKBlog/static/img/post-sample-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/FlasKBlog/static/img/post-sample-image.jpg -------------------------------------------------------------------------------- /FlasKBlog/static/js/clean-blog.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | "use strict"; // Start of use strict 3 | 4 | // Floating label headings for the contact form 5 | $("body").on("input propertychange", ".floating-label-form-group", function(e) { 6 | $(this).toggleClass("floating-label-form-group-with-value", !!$(e.target).val()); 7 | }).on("focus", ".floating-label-form-group", function() { 8 | $(this).addClass("floating-label-form-group-with-focus"); 9 | }).on("blur", ".floating-label-form-group", function() { 10 | $(this).removeClass("floating-label-form-group-with-focus"); 11 | }); 12 | 13 | // Show the navbar when the page is scrolled up 14 | var MQL = 992; 15 | 16 | //primary navigation slide-in effect 17 | if ($(window).width() > MQL) { 18 | var headerHeight = $('#mainNav').height(); 19 | $(window).on('scroll', { 20 | previousTop: 0 21 | }, 22 | function() { 23 | var currentTop = $(window).scrollTop(); 24 | //check if user is scrolling up 25 | if (currentTop < this.previousTop) { 26 | //if scrolling up... 27 | if (currentTop > 0 && $('#mainNav').hasClass('is-fixed')) { 28 | $('#mainNav').addClass('is-visible'); 29 | } else { 30 | $('#mainNav').removeClass('is-visible is-fixed'); 31 | } 32 | } else if (currentTop > this.previousTop) { 33 | //if scrolling down... 34 | $('#mainNav').removeClass('is-visible'); 35 | if (currentTop > headerHeight && !$('#mainNav').hasClass('is-fixed')) $('#mainNav').addClass('is-fixed'); 36 | } 37 | this.previousTop = currentTop; 38 | }); 39 | } 40 | 41 | })(jQuery); // End of use strict 42 | -------------------------------------------------------------------------------- /FlasKBlog/static/js/clean-blog.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - Clean Blog v5.0.10 (https://startbootstrap.com/theme/clean-blog) 3 | * Copyright 2013-2020 Start Bootstrap 4 | * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-clean-blog/blob/master/LICENSE) 5 | */ 6 | 7 | !function(o){"use strict";o("body").on("input propertychange",".floating-label-form-group",function(i){o(this).toggleClass("floating-label-form-group-with-value",!!o(i.target).val())}).on("focus",".floating-label-form-group",function(){o(this).addClass("floating-label-form-group-with-focus")}).on("blur",".floating-label-form-group",function(){o(this).removeClass("floating-label-form-group-with-focus")});if(992this.previousTop&&(o("#mainNav").removeClass("is-visible"),s 4 |
8 |
9 |
10 |
11 |
12 |
13 |

About Me

14 | This is what I do. 15 |
16 |
17 |
18 |
19 |
20 | 21 | 22 |
23 |
24 |
25 |

26 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe 27 | nostrum ullam eveniet pariatur voluptates odit, fuga atque ea nobis 28 | sit soluta odio, adipisci quas excepturi maxime quae totam ducimus 29 | consectetur? 30 |

31 |

32 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eius 33 | praesentium recusandae illo eaque architecto error, repellendus 34 | iusto reprehenderit, doloribus, minus sunt. Numquam at quae 35 | voluptatum in officia voluptas voluptatibus, minus! 36 |

37 |

38 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut 39 | consequuntur magnam, excepturi aliquid ex itaque esse est vero natus 40 | quae optio aperiam soluta voluptatibus corporis atque iste neque sit 41 | tempora! 42 |

43 |
44 |
45 |
46 | 47 |
48 | 49 | 50 | {% include "footer.html" %} -------------------------------------------------------------------------------- /FlasKBlog/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /FlasKBlog/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | Flask Blog 13 | 14 | 15 | 16 | 17 | 18 | 20 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 61 | -------------------------------------------------------------------------------- /FlasKBlog/templates/index.html: -------------------------------------------------------------------------------- 1 | {% include "header.html" %} 2 | 3 | 4 |
8 |
9 |
10 |
11 |
12 |
13 |

Flask Blog

14 | A Bootstrap Blog Powered By Flask 15 |
16 |
17 |
18 |
19 |
20 | 21 | 22 |
23 |
24 |
25 | 26 | 27 | 28 | {% for post in all_post %} 29 |
30 | 31 |

32 | {{ post.title }} 33 |

34 |

35 | {{ post.subtitle }} 36 |

37 |
38 | 43 |
44 |
45 | 46 | 47 | {% endfor %} 48 | 49 | 50 | 51 |
52 | Older Posts → 55 |
56 |
57 |
58 |
59 | 60 |
61 | 62 | {% include "footer.html" %} -------------------------------------------------------------------------------- /FlasKBlog/templates/post.html: -------------------------------------------------------------------------------- 1 | {% include "header.html" %} 2 | 3 |
7 |
8 |
9 |
10 |
11 |
12 |

{{ post.title }}

13 |

14 | {{ post.subtitle }} 15 |

16 | Posted by 18 | {{ post.author }} 19 | on {{ post.date }} 21 |
22 |
23 |
24 |
25 |
26 | 27 | 28 |
29 |
30 |
31 |
32 |

33 | {{ post.body }} 34 |

35 |
36 |
37 |
38 |
39 | 40 |
41 | 42 | {% include "footer.html" %} -------------------------------------------------------------------------------- /HabitTracker/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\HabitTracker\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /HabitTracker/.idea/HabitTracker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HabitTracker/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /HabitTracker/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /HabitTracker/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HabitTracker/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HabitTracker/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from datetime import datetime 3 | 4 | # PIXELA API CONSTANTS 5 | 6 | USERNAME = "kmhmubin" 7 | TOKEN = "alsdljsldjlasjdjkjls" 8 | GRAPH_ID = "code-graph" 9 | 10 | PIXELA_ENDPOINT = "https://pixe.la/v1/users" 11 | 12 | GRAPH_ENDPOINT = f"{PIXELA_ENDPOINT}/{USERNAME}/graphs" 13 | 14 | CREATE_PIXEL_ENDPOINT = f"{PIXELA_ENDPOINT}/{USERNAME}/graphs/{GRAPH_ID}" 15 | 16 | # Create a user account on Pixela 17 | # user parameters 18 | user_parameters = { 19 | "token": TOKEN, 20 | "username": USERNAME, 21 | "agreeTermsOfService": "yes", 22 | "notMinor": "yes", 23 | "thanksCode": "ThisIsThanksCode", 24 | } 25 | 26 | # sent the request to the server for create an user account 27 | # response = requests.post(url=PIXELA_ENDPOINT, json=user_parameters) 28 | # print(response.text) 29 | # account created -> https://pixe.la/@kmhmubin 30 | 31 | 32 | # create the graph 33 | graph_config = { 34 | "id": GRAPH_ID, 35 | "name": "Coding Graph", 36 | "unit": "Hrs", 37 | "type": "float", 38 | "color": "ichou", 39 | "timezone": "Asia/Dhaka", 40 | 41 | } 42 | 43 | headers = { 44 | "X-USER-TOKEN": TOKEN 45 | } 46 | 47 | # sent the post request and create graph 48 | # graph_response = requests.put(url=GRAPH_ENDPOINT, json=graph_config, headers=headers) 49 | # print(graph_response.text) 50 | 51 | # Create pixel data 52 | 53 | # get today date 54 | today = datetime(year=2020, month=12, day=23) 55 | 56 | pixel_data = { 57 | "date": today.strftime("%Y%m%d"), 58 | "quantity": "7.2", 59 | } 60 | 61 | # # sent request and create pixel 62 | pixel_response = requests.post(url=PIXELA_ENDPOINT, json=pixel_data, headers=headers) 63 | print(pixel_response.text) 64 | -------------------------------------------------------------------------------- /ISS-Tracker/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\ISS-Tracker\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /ISS-Tracker/.idea/ISS-Tracker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ISS-Tracker/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /ISS-Tracker/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ISS-Tracker/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ISS-Tracker/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ISS-Tracker/main.py: -------------------------------------------------------------------------------- 1 | # international Space Station Tracker 2 | import requests 3 | from datetime import datetime 4 | import smtplib 5 | import time 6 | 7 | # Constant values of my latitudes and Longitude 8 | MY_LAT = 23.870013 9 | MY_LONG = 90.408708 10 | EMAIL = "example@example.com" 11 | PASS = "123456789" 12 | 13 | 14 | def is_iss_overhead(): 15 | # fetching the response from api 16 | response = requests.get(url="http://api.open-notify.org/iss-now.json") 17 | # rise error if failed 18 | response.raise_for_status() 19 | # fetching data from api requests 20 | data = response.json() 21 | 22 | # catching iss latitude 23 | iss_latitude = float(data["iss_position"]["latitude"]) 24 | iss_longitude = float(data["iss_position"]["longitude"]) 25 | 26 | # my position is within +5 or -5 degrees of the iss position 27 | if MY_LAT - 5 <= iss_latitude <= MY_LAT + 5 and MY_LONG - 5 <= iss_longitude <= MY_LONG + 5: 28 | return True 29 | 30 | 31 | def is_night(): 32 | parameters = { 33 | "lat": MY_LAT, 34 | "long": MY_LONG, 35 | "formatted": 0, 36 | } 37 | 38 | # fetching data from sunrise and sunset api 39 | response = requests.get("https://api.sunrise-sunset.org/json", params=parameters) 40 | response.raise_for_status() 41 | sun_data = response.json() 42 | sunrise = int(sun_data["results"]["sunrise"].split("T")[1].split(":")[0]) 43 | sunset = int(sun_data["results"]["sunset"].split("T")[1].split(":")[0]) 44 | # current time in hour 45 | time_now = datetime.now().hour 46 | # check the time 47 | if time_now >= sunset or time_now <= sunrise: 48 | return True 49 | 50 | 51 | while True: 52 | # wait 60 s 53 | time.sleep(60) 54 | # if it's night time and iss in my position then sent a notification mail 55 | if is_iss_overhead() and is_night(): 56 | # connecting the gmail server 57 | connection = smtplib.SMTP("smtp.gmail.com") 58 | connection.starttls() 59 | connection.login(EMAIL, PASS) 60 | # send the mail 61 | connection.sendmail( 62 | from_addr=EMAIL, 63 | to_addrs=EMAIL, 64 | msg="Subject: Look Up \n\n The ISS is above you in the sky." 65 | ) 66 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\InternetSpeedMeter\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/InternetSpeedMeter.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InternetSpeedMeter/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /InternetSpeedMeter/README.md: -------------------------------------------------------------------------------- 1 | # Internet Speed Meter in Tkinter 2 | 3 | A simple internet speed usages meter in tkinter 4 | 5 | **Features** 6 | - Download speed 7 | - Upload speed 8 | - Data usages 9 | - CPU usages 10 | - Computer Info 11 | 12 | ## App Demo 13 | 14 | ![ISM Demo](https://github.com/kmhmubin/Python-Projects-with-source-code/blob/master/InternetSpeedMeter/ism.gif) -------------------------------------------------------------------------------- /InternetSpeedMeter/ism.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/InternetSpeedMeter/ism.gif -------------------------------------------------------------------------------- /Kanye-Quotes/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\Kanye-Quotes\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Kanye-Quotes/.idea/Kanye-Quotes.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Kanye-Quotes/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Kanye-Quotes/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Kanye-Quotes/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Kanye-Quotes/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Kanye-Quotes/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Kanye-Quotes/background.png -------------------------------------------------------------------------------- /Kanye-Quotes/kanye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Kanye-Quotes/kanye.png -------------------------------------------------------------------------------- /Kanye-Quotes/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | import requests 3 | 4 | 5 | # --------------------- GET QUOTES -------------------------- # 6 | 7 | def get_quote(): 8 | # request a response to the api 9 | response = requests.get("https://api.kanye.rest") 10 | # check the status code 11 | response.raise_for_status() 12 | # getting data from response 13 | data = response.json() 14 | # selecting specific data 15 | quote = data["quote"] 16 | # change the text in canvas 17 | canvas.itemconfig(quote_text, text=quote) 18 | 19 | 20 | # --------------------- UI SETUP ----------------------------- # 21 | 22 | # creating window object 23 | window = Tk() 24 | # Window title 25 | window.title("Kanye Says ..") 26 | # add padding to window 27 | window.config(padx=50, pady=50) 28 | 29 | # creating a canvas 30 | canvas = Canvas(width=300, height=414) 31 | # add background image in a variable 32 | background_image = PhotoImage(file="background.png") 33 | # adding photos in a canvas 34 | canvas.create_image(150, 207, image=background_image) 35 | # quote text in the canvas 36 | quote_text = canvas.create_text(150, 207, text="Kanye Quote Goes HERE", width=250, font=("Arial", 30, "bold"), 37 | fill="white") 38 | # canvas grid 39 | canvas.grid(row=0, column=0) 40 | 41 | # kanye image button 42 | kanye_image = PhotoImage(file="kanye.png") 43 | kanye_button = Button(image=kanye_image, highlightthickness=0, border=0, command=get_quote) 44 | kanye_button.grid(row=1, column=0) 45 | 46 | # window running 47 | window.mainloop() 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 K.M.H.Mubin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\Mile_to_KM_Converter_GUI\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/.idea/Mile_to_KM_Converter_GUI.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Mile_to_KM_Converter_GUI/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | # creating window object 4 | window = Tk() 5 | # Program title 6 | window.title("Miles to Kilometer Converter") 7 | 8 | # adding padding to window 9 | window.config(padx=20, pady=20) 10 | 11 | # taking user input 12 | miles_input = Entry(width=7) 13 | # grid placement 14 | miles_input.grid(column=2, row=0) 15 | # showing input label 16 | miles_label = Label(text="Miles: ") 17 | # grid placement 18 | miles_label.grid(column=1, row=0) 19 | # another text label 20 | is_equal_label = Label(text="Equal to") 21 | # grid placement 22 | is_equal_label.grid(column=2, row=1) 23 | # kilometer result label, default 0 24 | kilometer_result_label = Label(text="0") 25 | # grid placement 26 | kilometer_result_label.grid(column=2, row=2) 27 | # showing result label 28 | kilometer_label = Label(text="KM:") 29 | # grid placement 30 | kilometer_label.grid(column=1, row=2) 31 | 32 | 33 | # mile to km calculation 34 | def miles_to_km(): 35 | miles = float(miles_input.get()) 36 | km = round(miles * 1.609) 37 | kilometer_result_label.config(text=f"{km}") 38 | 39 | 40 | # calculator button 41 | calculate_button = Button(text="Calculate", command=miles_to_km) 42 | # button placement 43 | calculate_button.grid(column=2, row=3) 44 | 45 | # continue run the window object 46 | window.mainloop() 47 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | db.sqlite3-journal 62 | 63 | # Flask stuff: 64 | instance/ 65 | .webassets-cache 66 | 67 | # Scrapy stuff: 68 | .scrapy 69 | 70 | # Sphinx documentation 71 | docs/_build/ 72 | 73 | # PyBuilder 74 | target/ 75 | 76 | # Jupyter Notebook 77 | .ipynb_checkpoints 78 | 79 | # IPython 80 | profile_default/ 81 | ipython_config.py 82 | 83 | # pyenv 84 | .python-version 85 | 86 | # pipenv 87 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 88 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 89 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 90 | # install all needed dependencies. 91 | #Pipfile.lock 92 | 93 | # celery beat schedule file 94 | celerybeat-schedule 95 | 96 | # SageMath parsed files 97 | *.sage.py 98 | 99 | # Environments 100 | .env 101 | .venv 102 | env/ 103 | venv/ 104 | ENV/ 105 | env.bak/ 106 | venv.bak/ 107 | 108 | # Spyder project settings 109 | .spyderproject 110 | .spyproject 111 | 112 | # Rope project settings 113 | .ropeproject 114 | 115 | # mkdocs documentation 116 | /site 117 | 118 | # mypy 119 | .mypy_cache/ 120 | .dmypy.json 121 | dmypy.json 122 | 123 | # Pyre type checker 124 | .pyre/ 125 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\GitHub\Personal_Flight_Club\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.idea/Personal_Flight_Club.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Personal_Flight_Club/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Personal_Flight_Club/LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2020 K M H Mubin 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /Personal_Flight_Club/README.md: -------------------------------------------------------------------------------- 1 | Personal Flight Club 2 | -------------------------------------------------------------------------------- /Personal_Flight_Club/data_manager.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | SHEETY_PRICES_ENDPOINT = "your sheety project link" 4 | 5 | 6 | class DataManager: 7 | 8 | def __init__(self): 9 | self.destination_data = {} 10 | 11 | def get_destination_data(self): 12 | response = requests.get(url=SHEETY_PRICES_ENDPOINT) 13 | data = response.json() 14 | self.destination_data = data["prices"] 15 | return self.destination_data 16 | 17 | def update_destination_codes(self): 18 | for city in self.destination_data: 19 | new_data = { 20 | "price": { 21 | "iataCode": city["iataCode"] 22 | } 23 | } 24 | response = requests.put( 25 | url=f"{SHEETY_PRICES_ENDPOINT}/{city['id']}", 26 | json=new_data 27 | ) 28 | print(response.text) 29 | -------------------------------------------------------------------------------- /Personal_Flight_Club/flight_data.py: -------------------------------------------------------------------------------- 1 | class FlightData: 2 | 3 | def __init__(self, price, origin_city, origin_airport, destination_city, destination_airport, out_date, 4 | return_date): 5 | self.price = price 6 | self.origin_city = origin_city 7 | self.origin_airport = origin_airport 8 | self.destination_city = destination_city 9 | self.destination_airport = destination_airport 10 | self.out_date = out_date 11 | self.return_date = return_date 12 | -------------------------------------------------------------------------------- /Personal_Flight_Club/flight_search.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from flight_data import FlightData 3 | 4 | TEQUILA_ENDPOINT = "https://tequila-api.kiwi.com" 5 | TEQUILA_API_KEY = "Your api key" 6 | 7 | 8 | class FlightSearch: 9 | 10 | def get_destination_code(self, city_name): 11 | location_endpoint = f"{TEQUILA_ENDPOINT}/locations/query" 12 | headers = {"apikey": TEQUILA_API_KEY} 13 | query = {"term": city_name, "location_types": "city"} 14 | response = requests.get(url=location_endpoint, headers=headers, params=query) 15 | results = response.json()["locations"] 16 | code = results[0]["code"] 17 | return code 18 | 19 | def check_flights(self, origin_city_code, destination_city_code, from_time, to_time): 20 | headers = {"apikey": TEQUILA_API_KEY} 21 | query = { 22 | "fly_from": origin_city_code, 23 | "fly_to": destination_city_code, 24 | "date_from": from_time.strftime("%d/%m/%Y"), 25 | "date_to": to_time.strftime("%d/%m/%Y"), 26 | "nights_in_dst_from": 7, 27 | "nights_in_dst_to": 28, 28 | "flight_type": "round", 29 | "one_for_city": 1, 30 | "max_stopovers": 0, 31 | "curr": "GBP" 32 | } 33 | 34 | response = requests.get( 35 | url=f"{TEQUILA_ENDPOINT}/v2/search", 36 | headers=headers, 37 | params=query, 38 | ) 39 | 40 | data = response.json()["data"][0] 41 | # pprint(data) 42 | 43 | flight_data = FlightData( 44 | price=data["price"], 45 | origin_city=data["route"][0]["cityFrom"], 46 | origin_airport=data["route"][0]["flyFrom"], 47 | destination_city=data["route"][0]["cityTo"], 48 | destination_airport=data["route"][0]["flyTo"], 49 | out_date=data["route"][0]["local_departure"].split("T")[0], 50 | return_date=data["route"][1]["local_departure"].split("T")[0] 51 | ) 52 | print(f"{flight_data.destination_city}: £{flight_data.price}") 53 | return flight_data 54 | -------------------------------------------------------------------------------- /Personal_Flight_Club/main.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime, timedelta 2 | from data_manager import DataManager 3 | from flight_search import FlightSearch 4 | from notification_manager import NotificationManager 5 | 6 | data_manager = DataManager() 7 | sheet_data = data_manager.get_destination_data() 8 | flight_search = FlightSearch() 9 | notification_manager = NotificationManager() 10 | 11 | ORIGIN_CITY_IATA = "LON" 12 | 13 | if sheet_data[0]["iataCode"] == "": 14 | for row in sheet_data: 15 | row["iataCode"] = flight_search.get_destination_code(row["city"]) 16 | data_manager.destination_data = sheet_data 17 | data_manager.update_destination_codes() 18 | 19 | tomorrow = datetime.now() + timedelta(days=1) 20 | six_month_from_today = datetime.now() + timedelta(days=(6 * 30)) 21 | 22 | for destination in sheet_data: 23 | flight = flight_search.check_flights( 24 | ORIGIN_CITY_IATA, 25 | destination["iataCode"], 26 | from_time=tomorrow, 27 | to_time=six_month_from_today 28 | ) 29 | if flight.price < destination["lowestPrice"]: 30 | notification_manager.send_sms( 31 | message=f"Low price alert! Only £{flight.price} to fly from {flight.origin_city}-{flight.origin_airport} to {flight.destination_city}-{flight.destination_airport}, from {flight.out_date} to {flight.return_date}." 32 | ) 33 | -------------------------------------------------------------------------------- /Personal_Flight_Club/notification_manager.py: -------------------------------------------------------------------------------- 1 | from twilio.rest import Client 2 | 3 | TWILIO_SID = "YOUR TWILIO ACCOUNT SID" 4 | TWILIO_AUTH_TOKEN = "YOUR TWILIO AUTH TOKEN" 5 | TWILIO_VIRTUAL_NUMBER = "YOUR TWILIO VIRTUAL NUMBER" 6 | TWILIO_VERIFIED_NUMBER = "YOUR TWILIO VERIFIED NUMBER" 7 | 8 | 9 | class NotificationManager: 10 | 11 | def __init__(self): 12 | self.client = Client(TWILIO_SID, TWILIO_AUTH_TOKEN) 13 | 14 | def send_sms(self, message): 15 | message = self.client.messages.create( 16 | body=message, 17 | from_=TWILIO_VIRTUAL_NUMBER, 18 | to=TWILIO_VERIFIED_NUMBER, 19 | ) 20 | # Prints if successfully sent. 21 | print(message.sid) 22 | -------------------------------------------------------------------------------- /Pomodoro/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\Pomodoro\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Pomodoro/.idea/Pomodoro.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pomodoro/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Pomodoro/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Pomodoro/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pomodoro/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Pomodoro/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Pomodoro/favicon.ico -------------------------------------------------------------------------------- /Pomodoro/tomato.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/Pomodoro/tomato.png -------------------------------------------------------------------------------- /PongGame/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\PongGame\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /PongGame/.idea/PongGame.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PongGame/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /PongGame/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /PongGame/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PongGame/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PongGame/__pycache__/ball.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/PongGame/__pycache__/ball.cpython-38.pyc -------------------------------------------------------------------------------- /PongGame/__pycache__/paddle.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/PongGame/__pycache__/paddle.cpython-38.pyc -------------------------------------------------------------------------------- /PongGame/__pycache__/scoreboard.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/PongGame/__pycache__/scoreboard.cpython-38.pyc -------------------------------------------------------------------------------- /PongGame/ball.py: -------------------------------------------------------------------------------- 1 | # ball class 2 | # TODO: crate ball and make it move 3 | 4 | from turtle import Turtle 5 | 6 | 7 | class Ball(Turtle): 8 | 9 | def __init__(self): 10 | super().__init__() 11 | self.color("white") 12 | self.shape("circle") 13 | self.penup() 14 | self.x_move = 10 15 | self.y_move = 10 16 | self.move_speed = 0.1 17 | 18 | def move(self): 19 | """ball move with x and y coordinate """ 20 | new_x = self.xcor() + self.x_move 21 | new_y = self.ycor() + self.y_move 22 | self.goto(new_x, new_y) 23 | 24 | def bounce_y(self): 25 | """Ball bounce back from up""" 26 | self.y_move *= -1 27 | 28 | def bounce_x(self): 29 | """Ball bounce from down """ 30 | self.x_move *= -1 31 | self.move_speed *= 0.9 32 | 33 | def reset_position(self): 34 | """Reset the ball position and speed""" 35 | self.goto(0, 0) 36 | # move speed set to default 37 | self.move_speed = 0.1 38 | # reverse bounce 39 | self.bounce_x() 40 | -------------------------------------------------------------------------------- /PongGame/main.py: -------------------------------------------------------------------------------- 1 | # Pong Game 2 | """TODO: 3 | 1. create the screen 4 | 2. create and move a paddle 5 | 3. create another paddle 6 | 4. create the ball and make it move 7 | 5. detect collision with wall and bounce 8 | 6. detect collision with paddle 9 | 7. detect when paddle misses 10 | 8. keep score 11 | """ 12 | 13 | from turtle import Screen, Turtle 14 | from paddle import Paddle 15 | from ball import Ball 16 | from scoreboard import Scoreboard 17 | import time 18 | 19 | # TODO: Create the screen 20 | # create screen object 21 | screen = Screen() 22 | # make background black 23 | screen.bgcolor("black") 24 | # screen width and height 25 | screen.setup(width=800, height=600) 26 | # screen title 27 | screen.title("Pong Game") 28 | # turn off the turtle animation 29 | screen.tracer(0) 30 | 31 | # TODO: Create and move a paddle 32 | 33 | right_paddle = Paddle((350, 0)) 34 | left_paddle = Paddle((-350, 0)) 35 | 36 | # TODO: crate ball and make it move 37 | # create ball object 38 | ball = Ball() 39 | 40 | # creating scoreboard object 41 | scoreboard = Scoreboard() 42 | 43 | # creating a paddle object 44 | paddle = Turtle() 45 | 46 | # event listener for keypress 47 | screen.listen() 48 | # right side player 49 | screen.onkey(right_paddle.go_up, "Up") 50 | screen.onkey(right_paddle.go_down, "Down") 51 | # left side player 52 | screen.onkey(left_paddle.go_up, "w") 53 | screen.onkey(left_paddle.go_down, "s") 54 | 55 | # game is on 56 | game_is_on = True 57 | 58 | while game_is_on: 59 | time.sleep(ball.move_speed) 60 | screen.update() 61 | ball.move() 62 | 63 | # TODO: Detect collision with wall 64 | if ball.ycor() > 280 or ball.ycor() < -280: 65 | ball.bounce_y() 66 | 67 | # TODO: Detect collision with the paddle 68 | if ball.distance(right_paddle) < 50 and ball.xcor() > 320 or ball.distance(left_paddle) < 50 and ball.xcor() < -320: 69 | ball.bounce_x() 70 | 71 | # Detect Right paddle misses 72 | if ball.xcor() > 380: 73 | ball.reset_position() 74 | scoreboard.left_point() 75 | 76 | # Detect Left paddle misses 77 | if ball.xcor() < -380: 78 | ball.reset_position() 79 | scoreboard.right_point() 80 | 81 | # screen exit 82 | screen.exitonclick() 83 | -------------------------------------------------------------------------------- /PongGame/paddle.py: -------------------------------------------------------------------------------- 1 | # TODO: Create and move a paddle 2 | # Paddle class 3 | from turtle import Turtle 4 | 5 | 6 | class Paddle(Turtle): 7 | def __init__(self, position): 8 | super().__init__() 9 | # add paddle shape 10 | self.shape("square") 11 | # add paddle color 12 | self.color("white") 13 | # change the paddle shape size 14 | self.shapesize(stretch_wid=5, stretch_len=1) 15 | self.penup() 16 | # set up the default position 17 | self.goto(position) 18 | 19 | # move the paddle up and down methods 20 | def go_up(self): 21 | new_y = self.ycor() + 20 22 | self.goto(self.xcor(), new_y) 23 | 24 | def go_down(self): 25 | new_y = self.ycor() - 20 26 | self.goto(self.xcor(), new_y) 27 | -------------------------------------------------------------------------------- /PongGame/scoreboard.py: -------------------------------------------------------------------------------- 1 | # TODO: Create score board 2 | from turtle import Turtle 3 | 4 | # constant 5 | ALIGNMENT = "center" 6 | FONT = ("Courier", 80, "normal") 7 | 8 | 9 | class Scoreboard(Turtle): 10 | 11 | def __init__(self): 12 | super().__init__() 13 | self.color("white") 14 | self.penup() 15 | self.hideturtle() 16 | self.left_score = 0 17 | self.right_score = 0 18 | 19 | def update_scoreboard(self): 20 | """Return update score values """ 21 | # clearing the overlapping numbers 22 | self.clear() 23 | # left side score 24 | self.goto(-100, 200) 25 | self.write(self.left_score, align=ALIGNMENT, font=FONT) 26 | # right side score 27 | self.goto(100, 200) 28 | self.write(self.right_score, align=ALIGNMENT, font=FONT) 29 | 30 | def left_point(self): 31 | """Return left score by plus 1""" 32 | self.left_score += 1 33 | self.update_scoreboard() 34 | 35 | def right_point(self): 36 | """Return right score by plus 1""" 37 | self.right_score += 1 38 | self.update_scoreboard() 39 | -------------------------------------------------------------------------------- /QuizGame/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\QuizGame\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /QuizGame/.idea/QuizGame.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QuizGame/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /QuizGame/.idea/copyright/K_M_H_Mubin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /QuizGame/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /QuizGame/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /QuizGame/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /QuizGame/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QuizGame/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /QuizGame/__pycache__/data.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizGame/__pycache__/data.cpython-38.pyc -------------------------------------------------------------------------------- /QuizGame/__pycache__/question_model.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizGame/__pycache__/question_model.cpython-38.pyc -------------------------------------------------------------------------------- /QuizGame/__pycache__/quiz_brain.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizGame/__pycache__/quiz_brain.cpython-38.pyc -------------------------------------------------------------------------------- /QuizGame/main.py: -------------------------------------------------------------------------------- 1 | # import classes 2 | from question_model import Question 3 | from data import question_data 4 | from quiz_brain import QuizBrain 5 | 6 | # empty question bank list 7 | question_bank = [] 8 | for question in question_data: 9 | question_text = question["question"] 10 | question_answer = question["correct_answer"] 11 | new_question = Question(question_text, question_answer) 12 | question_bank.append(new_question) 13 | 14 | quiz = QuizBrain(question_bank) 15 | 16 | while quiz.still_has_question(): 17 | quiz.next_question() 18 | 19 | print("You've completed the question.") 20 | print(f"Your final score is: {quiz.score}/ {quiz.question_number}") 21 | -------------------------------------------------------------------------------- /QuizGame/question_model.py: -------------------------------------------------------------------------------- 1 | class Question: 2 | 3 | def __init__(self, ques_text, ques_answer): 4 | self.text = ques_text 5 | self.answer = ques_answer 6 | -------------------------------------------------------------------------------- /QuizGame/quiz_brain.py: -------------------------------------------------------------------------------- 1 | class QuizBrain: 2 | 3 | def __init__(self, ques_list): 4 | self.question_number = 0 5 | self.score = 0 6 | self.question_list = ques_list 7 | 8 | def still_has_question(self): 9 | """Return question comparing with total number of question on the list""" 10 | return self.question_number < len(self.question_list) 11 | 12 | def next_question(self): 13 | """Return the next question and check the answer""" 14 | current_question = self.question_list[self.question_number] 15 | self.question_number += 1 16 | user_answer = input(f"Q. {self.question_number} : {current_question.text} (True / False): ") 17 | self.check_answer(user_answer, current_question.answer) 18 | 19 | def check_answer(self, user_answer, correct_answer): 20 | """Check the correct answer with user answer.""" 21 | if user_answer.lower() == correct_answer.lower(): 22 | self.score += 1 23 | print("You got it right !") 24 | else: 25 | print("That's wrong.") 26 | print(f"The correct answer was: {correct_answer}.") 27 | print(f"Your current score is: {self.score}/{self.question_number}.") 28 | print("\n") 29 | -------------------------------------------------------------------------------- /QuizerApp/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\QuizerApp\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /QuizerApp/.idea/QuizerApp.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QuizerApp/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /QuizerApp/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /QuizerApp/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QuizerApp/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /QuizerApp/README.md: -------------------------------------------------------------------------------- 1 | # QUIZER APP 2 | 3 | An interactive Quiz app. All the question generate from the Open Trivia Database api. 4 | 5 | -------------------------------------------------------------------------------- /QuizerApp/__pycache__/data.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizerApp/__pycache__/data.cpython-38.pyc -------------------------------------------------------------------------------- /QuizerApp/__pycache__/question_model.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizerApp/__pycache__/question_model.cpython-38.pyc -------------------------------------------------------------------------------- /QuizerApp/__pycache__/quiz_brain.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizerApp/__pycache__/quiz_brain.cpython-38.pyc -------------------------------------------------------------------------------- /QuizerApp/__pycache__/ui.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizerApp/__pycache__/ui.cpython-38.pyc -------------------------------------------------------------------------------- /QuizerApp/data.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | parameters = { 4 | "amount": 10, 5 | "type": "boolean", 6 | } 7 | 8 | # send request to open trivia api 9 | response = requests.get("https://opentdb.com/api.php", params=parameters) 10 | # if errors then raise error 11 | response.raise_for_status() 12 | # grab the data from api 13 | data = response.json() 14 | 15 | # print the data 16 | # print(data["results"]) 17 | 18 | # assign data to a variable 19 | question_data = data["results"] 20 | -------------------------------------------------------------------------------- /QuizerApp/images/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizerApp/images/cross.png -------------------------------------------------------------------------------- /QuizerApp/images/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/QuizerApp/images/tick.png -------------------------------------------------------------------------------- /QuizerApp/main.py: -------------------------------------------------------------------------------- 1 | # QUIZ GUI APP USING TRIVIA API 2 | 3 | from question_model import Question 4 | from data import question_data 5 | from quiz_brain import QuizBrain 6 | from ui import QuizInterface 7 | 8 | # assign empty list for question 9 | question_bank = [] 10 | for question in question_data: 11 | question_text = question["question"] 12 | question_answer = question["correct_answer"] 13 | new_question = Question(question_text, question_answer) 14 | question_bank.append(new_question) 15 | 16 | # getting question 17 | quiz = QuizBrain(question_bank) 18 | 19 | # initilize the UI 20 | quiz_ui = QuizInterface(quiz) 21 | 22 | # is quiz running 23 | while quiz.still_has_question(): 24 | quiz.next_question() 25 | 26 | print("You've completed the quiz") 27 | print(f"Your final score was: {quiz.score}/{quiz.question_number}") 28 | -------------------------------------------------------------------------------- /QuizerApp/question_model.py: -------------------------------------------------------------------------------- 1 | class Question: 2 | 3 | def __init__(self, question_text, question_answer): 4 | self.text = question_text 5 | self.answer = question_answer 6 | -------------------------------------------------------------------------------- /QuizerApp/quiz_brain.py: -------------------------------------------------------------------------------- 1 | import html 2 | 3 | 4 | class QuizBrain: 5 | 6 | def __init__(self, question_list): 7 | self.question_number = 0 8 | self.score = 0 9 | self.question_list = question_list 10 | self.current_question = None 11 | 12 | def still_has_question(self): 13 | return self.question_number < len(self.question_list) 14 | 15 | def next_question(self): 16 | self.current_question = self.question_list[self.question_number] 17 | self.question_number += 1 18 | # re-format html text 19 | question_text = html.unescape(self.current_question.text) 20 | return f"Q.{self.question_number}: {question_text}" 21 | # user_answer = input(f"Q.{self.question_number}: {question_text} (True/ False): ") 22 | # self.check_answer(user_answer) 23 | 24 | def check_answer(self, user_answer): 25 | correct_answer = self.current_question.answer 26 | if user_answer.lower() == correct_answer.lower(): 27 | self.score += 1 28 | return True 29 | else: 30 | return False 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python3 Projects With Source Code 2 | 3 | ## Tools 4 | 5 | 1. Pycharm 6 | 2. Visual Studio Code 7 | 3. Anaconda/ Mini conda 8 | 9 | ## Installation 10 | 11 | 1. First Download or Fork the project. 12 | 2. Create a python environment virtualenv, conda (recommanded). 13 | 3. Download all imported packages if needed. 14 | 4. Run the project. 15 | 16 | --- 17 | 18 | ## Projects List 19 | 20 | - 100_movies_list 21 | - Art Slate 22 | - Auto Job Application submit on LinkedIn 23 | - Automate-Birthday-Wisher 24 | - average_height_using_for_loop 25 | - black_jack 26 | - blind_auction 27 | - bmi 28 | - Book Tracker 29 | - caesar_cipher 30 | - calculator_app 31 | - Coffeefi 32 | - Coffee Machine 33 | - Coffee Machine OPP 34 | - fizzbuzz 35 | - FlasK Blog 36 | - flaskWTForm 37 | - Gaming Bot 38 | - guess_the_number 39 | - Guess Age_Gender 40 | - Guess Number Web App 41 | - Habit Tracker 42 | - hangman 43 | - hello 44 | - higher_or_lower_game 45 | - Insta Follower Bot 46 | - Internet Speed Twitte Bot 47 | - Internet Speed Meter in Tkinter 48 | - ISS-Tracker 49 | - Kanye-Quotes 50 | - leapyear 51 | - life_in_weeks 52 | - love_calculator 53 | - Mile_to_KM_Converter_GUI 54 | - Name Card 55 | - password_generator 56 | - Personal_Flight_Club 57 | - Pomodoro 58 | - Pong Game 59 | - Quizer App 60 | - Quiz Game 61 | - Rain Alert 62 | - rock_paper_scissor 63 | - San-Francisco Renting Automation 64 | - Snake Game 65 | - Stock News Aleart 66 | - Tinder Bot 67 | - tipcal 68 | - Tresure_Island 69 | - tresure_map 70 | - Turtle Crossing Game 71 | - Turtle Dot Art 72 | - Turtle Race 73 | - US_States_Quiz_Game 74 | - whos_paying 75 | - Workout Tracking 76 | 77 | ## Contributors 78 | 79 | Contributors are welcome. You can add your projects. 80 | 81 | 1. First Fork this repo 82 | 2. Add your project name in the list 83 | 3. Add pull request 84 | 85 | 86 | 87 | #### 📢 If you like those project then please give a star and share with your friends. 💗 -------------------------------------------------------------------------------- /RainAlert/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\RainAlert\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /RainAlert/.idea/RainAlert.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RainAlert/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /RainAlert/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /RainAlert/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RainAlert/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RainAlert/main.py: -------------------------------------------------------------------------------- 1 | # Rain Alert Using twilio 2 | import os 3 | import requests 4 | from twilio.rest import Client 5 | 6 | API_ENDPOINT = "https://api.openweathermap.org/data/2.5/onecall" 7 | # get the api key from environment variable 8 | API_KEY = os.getenv("OWM_API_KEY") 9 | 10 | PHONE_NUMBER = "+12516640218" 11 | 12 | # Your Account SID from twilio.com/console 13 | account_sid = os.getenv("ACCOUNT_SID") 14 | # Your Auth Token from twilio.com/console 15 | auth_token = os.getenv("AUTH_TOKEN") 16 | 17 | weather_parameters = { 18 | "lat": 23.808277, 19 | "lon": 90.413209, 20 | "appid": API_KEY, 21 | "exclude": "current,minutely,daily", 22 | } 23 | 24 | response = requests.get(API_ENDPOINT, params=weather_parameters) 25 | response.raise_for_status() 26 | weather_data = response.json() 27 | # slice the weather data 28 | weather_slice = weather_data["hourly"][:12] 29 | 30 | # will it rain 31 | will_rain = False 32 | 33 | # check the weather condition 34 | for hour_data in weather_slice: 35 | condition_code = hour_data["weather"][0]["id"] 36 | if int(condition_code) < 700: 37 | will_rain = True 38 | 39 | if will_rain: 40 | client = Client(account_sid, auth_token) 41 | message = client.messages \ 42 | .create( 43 | body="It's Going to rain today. Remember to bring an Umbrella ", 44 | from_=PHONE_NUMBER, 45 | to='+8801713343232' 46 | ) 47 | print(message.status) 48 | -------------------------------------------------------------------------------- /SnakeGame/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\SnakeGame\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /SnakeGame/.idea/SnakeGame.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SnakeGame/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /SnakeGame/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /SnakeGame/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SnakeGame/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SnakeGame/__pycache__/food.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/SnakeGame/__pycache__/food.cpython-38.pyc -------------------------------------------------------------------------------- /SnakeGame/__pycache__/scoreboard.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/SnakeGame/__pycache__/scoreboard.cpython-38.pyc -------------------------------------------------------------------------------- /SnakeGame/__pycache__/snake.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/SnakeGame/__pycache__/snake.cpython-38.pyc -------------------------------------------------------------------------------- /SnakeGame/data.txt: -------------------------------------------------------------------------------- 1 | 21 -------------------------------------------------------------------------------- /SnakeGame/food.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | import random 3 | 4 | 5 | # TODO: Create snake food 6 | 7 | class Food(Turtle): 8 | 9 | def __init__(self): 10 | super().__init__() 11 | self.shape("circle") 12 | self.penup() 13 | self.shapesize(stretch_len=0.5, stretch_wid=0.5) 14 | self.color("blue") 15 | self.speed("fastest") 16 | self.refresh() 17 | 18 | def refresh(self): 19 | random_x = random.randint(-280, 280) 20 | random_y = random.randint(-280, 280) 21 | self.goto(random_x, random_y) 22 | -------------------------------------------------------------------------------- /SnakeGame/main.py: -------------------------------------------------------------------------------- 1 | """TODO: Snake Game 2 | 1. create a screen with 600x600 size 3 | 2. create a snake body 4 | 3. move the snake 5 | 4. create snake food 6 | 5. detect collision with food 7 | 6. create a scoreboard 8 | 7. detect collision with wall 9 | 8. detect collision with tail 10 | """ 11 | 12 | from turtle import Screen 13 | from snake import Snake 14 | from food import Food 15 | from scoreboard import Scoreboard 16 | import time 17 | 18 | # creating a object 19 | screen = Screen() 20 | 21 | # TODO: create a screen 22 | # setup the screen 23 | screen.setup(width=600, height=600) 24 | 25 | # set background color to black 26 | screen.bgcolor("black") 27 | 28 | # add title of the screen 29 | screen.title("Snake Game") 30 | 31 | # turn off the turtle animation 32 | screen.tracer(0) 33 | 34 | # create snake object 35 | snake = Snake() 36 | 37 | # create food object 38 | food = Food() 39 | 40 | # create scoreboard object 41 | scoreboard = Scoreboard() 42 | 43 | # TODO: control the snake with keypress 44 | # start listen the keypress 45 | screen.listen() 46 | 47 | # add arrow keys 48 | screen.onkey(snake.up, "Up") 49 | screen.onkey(snake.down, "Down") 50 | screen.onkey(snake.left, "Left") 51 | screen.onkey(snake.right, "Right") 52 | 53 | game_is_on = True 54 | while game_is_on: 55 | screen.update() 56 | time.sleep(0.1) 57 | # move the snake 58 | snake.move() 59 | 60 | # Detect collision with food 61 | if snake.head.distance(food) < 15: 62 | food.refresh() 63 | snake.extend() 64 | scoreboard.increase_score() 65 | 66 | # TODO: Detect collision with wall 67 | if snake.head.xcor() > 280 or snake.head.xcor() < -280 or snake.head.ycor() > 280 or snake.head.ycor() < -280: 68 | scoreboard.reset_game() 69 | snake.reset_snake() 70 | 71 | # TODO: Detect collision with tail 72 | # if head collides with any segment in the tail then trigger game over 73 | for segment in snake.segments[1:]: 74 | if snake.head.distance(segment) < 10: 75 | scoreboard.reset_game() 76 | snake.reset_snake() 77 | 78 | # exit on click 79 | screen.exitonclick() 80 | -------------------------------------------------------------------------------- /SnakeGame/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | # constant 4 | ALIGNMENT = "center" 5 | FONT = ("Courier", 24, "normal") 6 | 7 | 8 | # TODO: Create score board 9 | 10 | 11 | class Scoreboard(Turtle): 12 | 13 | def __init__(self): 14 | super().__init__() 15 | self.score = 0 16 | with open("data.txt") as data: 17 | self.high_score = int(data.read()) 18 | self.color("white") 19 | self.penup() 20 | self.goto(0, 270) 21 | self.hideturtle() 22 | self.update_scoreboard() 23 | 24 | def update_scoreboard(self): 25 | """Return updated score""" 26 | self.clear() 27 | self.write(f" Score: {self.score} | High Score: {self.high_score}", align=ALIGNMENT, font=FONT) 28 | 29 | def reset_game(self): 30 | """if collision then game over.""" 31 | if self.score > self.high_score: 32 | self.high_score = self.score 33 | # store high score in the data.txt file 34 | with open("data.txt", mode="w") as data: 35 | data.write(f"{self.high_score}") 36 | # it will reset to zero for new game 37 | self.score = 0 38 | self.update_scoreboard() 39 | 40 | def increase_score(self): 41 | """Return score""" 42 | self.score += 1 43 | self.update_scoreboard() 44 | -------------------------------------------------------------------------------- /SnakeGame/snake.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | # creating snake block 4 | # Constant starting position, distance and keypress direction 5 | STARTING_POSITION = [(0, 0), (-20, 0), (-40, 0)] 6 | MOVE_DISTANCE = 20 7 | UP = 90 8 | DOWN = 270 9 | LEFT = 180 10 | RIGHT = 0 11 | 12 | 13 | # creating snake class 14 | 15 | class Snake: 16 | 17 | def __init__(self): 18 | # empty segment 19 | self.segments = [] 20 | self.create_snake() 21 | self.head = self.segments[0] 22 | 23 | # TODO: creating a snake body 24 | def create_snake(self): 25 | for position in STARTING_POSITION: 26 | self.add_segment(position) 27 | 28 | def add_segment(self, position): 29 | new_segment = Turtle(shape="square") 30 | new_segment.color("Green") 31 | new_segment.penup() 32 | new_segment.goto(position) 33 | self.segments.append(new_segment) 34 | 35 | def reset_snake(self): 36 | for seg in self.segments: 37 | self.goto(1000,1000) 38 | self.segments.clear() 39 | self.create_snake() 40 | self.head = self.segments[0] 41 | 42 | def extend(self): 43 | # add new segment to the snake after eat food 44 | self.add_segment(self.segments[-1].position()) 45 | 46 | # TODO: Move the snake body 47 | def move(self): 48 | # range for segment are start at 2, stop at 0 and take step back -1 49 | for seg_num in range(len(self.segments) - 1, 0, -1): 50 | new_x = self.segments[seg_num - 1].xcor() 51 | new_y = self.segments[seg_num - 1].ycor() 52 | self.segments[seg_num].goto(new_x, new_y) 53 | self.head.forward(MOVE_DISTANCE) 54 | 55 | # TODO: control the snake with keypress functions 56 | def up(self): 57 | if self.head.heading() != DOWN: 58 | self.head.setheading(UP) 59 | 60 | def down(self): 61 | if self.head.heading() != UP: 62 | self.head.setheading(DOWN) 63 | 64 | def left(self): 65 | if self.head.heading() != RIGHT: 66 | self.head.setheading(LEFT) 67 | 68 | def right(self): 69 | if self.head.heading() != LEFT: 70 | self.head.setheading(RIGHT) 71 | -------------------------------------------------------------------------------- /StockNewsAleart/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\StockNewsAleart\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /StockNewsAleart/.idea/StockNewsAleart.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StockNewsAleart/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /StockNewsAleart/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /StockNewsAleart/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StockNewsAleart/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TopMovieList/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\TopMovieList\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /TopMovieList/.idea/TopMovieList.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /TopMovieList/.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sqlite.xerial 6 | true 7 | org.sqlite.JDBC 8 | jdbc:sqlite:E:\GitHub\Python-Projects\TopMovieList\movies.db 9 | $ProjectFileDir$ 10 | 11 | 12 | -------------------------------------------------------------------------------- /TopMovieList/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /TopMovieList/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /TopMovieList/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TopMovieList/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TopMovieList/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TopMovieList/README.md: -------------------------------------------------------------------------------- 1 | # Top Movie List 2 | 3 | A simple personalize top movie list in flask. 4 | 5 | ## Technologies 6 | 7 | - Flask 8 | - Flask Bootstrap 9 | - Flask WTForm 10 | - Flask SQLAlchemy 11 | - requests 12 | - The Movie Database API 13 | 14 | ## Demo 15 | 16 | ![DEMO](https://github.com/kmhmubin/Python-Projects-with-source-code/blob/master/TopMovieList/demo.png) -------------------------------------------------------------------------------- /TopMovieList/__pycache__/app.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TopMovieList/__pycache__/app.cpython-38.pyc -------------------------------------------------------------------------------- /TopMovieList/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TopMovieList/demo.png -------------------------------------------------------------------------------- /TopMovieList/movies.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TopMovieList/movies.db -------------------------------------------------------------------------------- /TopMovieList/templates/add.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import 'bootstrap/wtf.html' as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | 8 | 9 | 13 | 17 | 21 | 22 | 23 | 29 | 30 | 31 | 35 | {% endblock %} 36 | 37 | {% block title %} Add Movies {% endblock %} 38 | 39 | {% block content %} 40 |
41 | 42 |
43 |

Add A Movie

44 | 45 | {{ wtf.quick_form(form, novalidate=True) }} 46 |
47 | 48 |
49 | {% endblock %} -------------------------------------------------------------------------------- /TopMovieList/templates/edit.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import 'bootstrap/wtf.html' as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | 8 | 9 | 13 | 17 | 21 | 22 | 23 | 29 | 30 | 31 | 35 | {% endblock %} 36 | 37 | {% block title %} Edit Rating & Reviews {% endblock %} 38 | 39 | {% block content %} 40 |
41 | 42 |
43 |

{{ movie.title }}

44 |

Edit Movie Rating & Reviews

45 | 46 | {{ wtf.quick_form(form, novalidate=True) }} 47 |
48 | 49 |
50 | {% endblock %} -------------------------------------------------------------------------------- /TopMovieList/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | 3 | {% block styles %} 4 | {{ super() }} 5 | 6 | 7 | 8 | 11 | 12 | {% endblock %} 13 | 14 | {% block title %}My Top 10 Movies{% endblock %} 15 | 16 | {% block content %} 17 |
18 |

My Top 10 Movies

19 |

These are my all time favourite movies.

20 |
21 | Add Movie 22 |
23 | {% for movie in movies %} 24 |
25 |
26 |

{{ movie.ranking }}

27 |
28 |
29 |
30 |
{{ movie.title }} ({{ movie.year }})
31 |
32 | 33 | 34 |
35 |

"{{ movie.review }}"

36 |

{{ movie.description }}

37 | 38 | Update 39 | Delete 40 | 41 |
42 |
43 |
44 | {% endfor %} 45 |
46 | 47 | 48 | {% endblock %} -------------------------------------------------------------------------------- /TopMovieList/templates/select.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | 8 | 9 | {% endblock %} 10 | 11 | {% block title %}Select Movie{% endblock %} 12 | 13 | {% block content %} 14 |
15 |

Select Movie

16 | {% for movie in options: %} 17 |

18 | {{ movie.title }} - {{ movie.release_date }} 19 |

20 | {% endfor %} 21 | 22 |
23 | {% endblock %} -------------------------------------------------------------------------------- /TurtleCrossingGame/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../../../../:\Users\kmhmu\Documents\GitHub\Python-Projects\TurtleCrossingGame\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /TurtleCrossingGame/.idea/TurtleCrossingGame.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TurtleCrossingGame/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /TurtleCrossingGame/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TurtleCrossingGame/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TurtleCrossingGame/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TurtleCrossingGame/__pycache__/car_manager.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TurtleCrossingGame/__pycache__/car_manager.cpython-38.pyc -------------------------------------------------------------------------------- /TurtleCrossingGame/__pycache__/player.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TurtleCrossingGame/__pycache__/player.cpython-38.pyc -------------------------------------------------------------------------------- /TurtleCrossingGame/__pycache__/scoreboard.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TurtleCrossingGame/__pycache__/scoreboard.cpython-38.pyc -------------------------------------------------------------------------------- /TurtleCrossingGame/car_manager.py: -------------------------------------------------------------------------------- 1 | # TODO: Create cars and move it 2 | import random 3 | from turtle import Turtle 4 | 5 | # constant for cars 6 | COLORS = ["red", "orange", "yellow", "green", "blue", "purple"] 7 | STARTING_MOVE_DISTANCE = 5 8 | MOVE_INCREMENT = 10 9 | 10 | 11 | # car class 12 | class CarManager: 13 | def __init__(self): 14 | self.all_cars = [] 15 | self.car_speed = STARTING_MOVE_DISTANCE 16 | 17 | def create_car(self): 18 | """Properties of a car""" 19 | random_chance = random.randint(1, 6) 20 | if random_chance == 1: 21 | new_car = Turtle(shape="square") 22 | new_car.shapesize(stretch_wid=1, stretch_len=2) 23 | new_car.penup() 24 | new_car.color(random.choice(COLORS)) 25 | random_y = random.randint(-250, 250) 26 | new_car.goto(300, random_y) 27 | self.all_cars.append(new_car) 28 | 29 | def move_car(self): 30 | """Move cars""" 31 | for car in self.all_cars: 32 | car.backward(self.car_speed) 33 | 34 | def level_up(self): 35 | """Increase car speed when level up""" 36 | self.car_speed += MOVE_INCREMENT 37 | -------------------------------------------------------------------------------- /TurtleCrossingGame/main.py: -------------------------------------------------------------------------------- 1 | """TODO: 2 | 1. Create screen 3 | 2. Create and move cars 4 | 3. Create player 5 | 4. Move the turtle with keypress 6 | 5. Detect collision with car 7 | 6. Detect when turtle reaches the other side 8 | 7. Create a scoreboard 9 | 10 | """ 11 | 12 | import time 13 | from turtle import Screen 14 | from player import Player 15 | from car_manager import CarManager 16 | from scoreboard import Scoreboard 17 | 18 | # TODO: Create the game screen 19 | # creating screen object 20 | screen = Screen() 21 | # setup screen size 22 | screen.setup(width=600, height=600) 23 | # turn off turtle animation 24 | screen.tracer(0) 25 | 26 | # TODO: Create player 27 | # creating player object 28 | player = Player() 29 | 30 | # TODO: Create Cars 31 | # creating car objects 32 | car_manager = CarManager() 33 | 34 | # TODO: Create scoreboard 35 | # creating scoreboard object 36 | scoreboard = Scoreboard() 37 | 38 | # TODO: Listen the keypress 39 | screen.listen() 40 | screen.onkey(player.go_up, "Up") 41 | 42 | # game on or not 43 | is_game_on = True 44 | 45 | while is_game_on: 46 | time.sleep(0.1) 47 | # update the screen 48 | screen.update() 49 | 50 | # creating cars and move it 51 | car_manager.create_car() 52 | car_manager.move_car() 53 | 54 | # TODO: Detect collision with car 55 | for car in car_manager.all_cars: 56 | if car.distance(player) < 20: 57 | is_game_on = False 58 | scoreboard.game_over() 59 | 60 | # TODO: Detect successful crossing 61 | if player.is_at_finish_line(): 62 | player.go_to_start() 63 | car_manager.level_up() 64 | scoreboard.increase_level() 65 | 66 | # exit on click on the screen 67 | screen.exitonclick() 68 | -------------------------------------------------------------------------------- /TurtleCrossingGame/player.py: -------------------------------------------------------------------------------- 1 | # TODO: Create player and Move the turtle with keypress 2 | from turtle import Turtle 3 | 4 | # constant for players 5 | STARTING_POSITION = (0, -280) 6 | MOVE_DISTANCE = 10 7 | FINISH_LINE_Y = 280 8 | 9 | 10 | # player class 11 | class Player(Turtle): 12 | 13 | def __init__(self): 14 | super().__init__() 15 | self.shape("turtle") 16 | self.penup() 17 | self.go_to_start() 18 | self.setheading(90) 19 | 20 | def go_up(self): 21 | """Move the turtle forward """ 22 | self.forward(MOVE_DISTANCE) 23 | 24 | def go_to_start(self): 25 | """Set starting position for turtle""" 26 | self.goto(STARTING_POSITION) 27 | 28 | def is_at_finish_line(self): 29 | """Return boolean if turtle reach the finish line""" 30 | if self.ycor() > FINISH_LINE_Y: 31 | return True 32 | else: 33 | return False 34 | -------------------------------------------------------------------------------- /TurtleCrossingGame/scoreboard.py: -------------------------------------------------------------------------------- 1 | # TODO: Create a scoreboard 2 | 3 | from turtle import Turtle 4 | 5 | # Constant for scoreboard 6 | FONT = ("Courier", 24, "normal") 7 | 8 | 9 | # scoreboard class which inherit turtle classes 10 | class Scoreboard(Turtle): 11 | 12 | def __init__(self): 13 | super(Scoreboard, self).__init__() 14 | self.level = 1 15 | self.hideturtle() 16 | self.penup() 17 | self.goto(-200, 250) 18 | self.update_scoreboard() 19 | 20 | def update_scoreboard(self): 21 | """Clear the screen and update the scoreboard""" 22 | self.clear() 23 | self.write(f" Level: {self.level}", align="left", font=FONT) 24 | 25 | def increase_level(self): 26 | """ Increase the level """ 27 | self.level += 1 28 | self.update_scoreboard() 29 | 30 | def game_over(self): 31 | """Show message when game over""" 32 | self.goto(0, 0) 33 | self.write(f" GAME OVER 😞 ", align="center", font=FONT) 34 | -------------------------------------------------------------------------------- /TurtleDotArt/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\TurtleDotArt\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /TurtleDotArt/.idea/TurtleDotArt.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TurtleDotArt/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /TurtleDotArt/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TurtleDotArt/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TurtleDotArt/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TurtleDotArt/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/TurtleDotArt/image.jpg -------------------------------------------------------------------------------- /TurtleDotArt/main.py: -------------------------------------------------------------------------------- 1 | # extract color from image 2 | # import colorgram 3 | # 4 | # rgb_colors = [] 5 | # colors = colorgram.extract('image.jpg', 30) 6 | # for color in colors: 7 | # r = color.rgb.r 8 | # g = color.rgb.g 9 | # b = color.rgb.b 10 | # new_color = (r, g, b) 11 | # rgb_colors.append(new_color) 12 | # 13 | # print(rgb_colors) 14 | 15 | # spot drawing 16 | 17 | import turtle as turtle_module 18 | import random 19 | 20 | # select rgb color 21 | turtle_module.colormode(255) 22 | tim = turtle_module.Turtle() 23 | tim.speed("fastest") # turtle speed 24 | tim.penup() # hide the pen line 25 | tim.hideturtle() # hide the turtle 26 | 27 | color_list = [(248, 247, 246), (235, 243, 248), (249, 241, 246), (243, 250, 246), (21, 114, 173), (142, 163, 184), 28 | (204, 137, 166), (190, 173, 17), (145, 17, 32), (238, 213, 62), (67, 24, 31), (17, 138, 59), 29 | (219, 161, 88), (122, 71, 100), (49, 29, 26), (197, 65, 28), (7, 107, 64), (227, 169, 197), (240, 78, 29), 30 | (29, 177, 84), (21, 172, 188), (243, 214, 4), (110, 192, 140), (182, 94, 115), (35, 37, 46), 31 | (188, 182, 213), (157, 206, 215), (240, 168, 154), (147, 215, 171), (127, 32, 26)] 32 | 33 | tim.setheading(225) 34 | tim.forward(300) 35 | tim.setheading(0) 36 | number_of_dots = 100 37 | 38 | for dot_count in range(1, number_of_dots): 39 | tim.dot(20, random.choice(color_list)) 40 | tim.forward(50) 41 | 42 | if dot_count % 10 == 0: 43 | tim.setheading(90) 44 | tim.forward(50) 45 | tim.setheading(180) 46 | tim.forward(500) 47 | tim.setheading(0) 48 | 49 | screen = turtle_module.Screen() 50 | screen.exitonclick() # exit on click 51 | -------------------------------------------------------------------------------- /TurtleRace/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../../../../:\Users\kmhmu\Documents\GitHub\Python-Projects\TurtleRace\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /TurtleRace/.idea/TurtleRace.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TurtleRace/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /TurtleRace/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TurtleRace/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TurtleRace/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TurtleRace/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | import random 3 | 4 | # is game start 5 | is_race_on = False 6 | 7 | # creating objects 8 | new_turtle = Turtle() 9 | screen = Screen() 10 | 11 | # specifying screen size 12 | screen.setup(width=500, height=400) 13 | 14 | # user bet 15 | user_bet = screen.textinput(title="Make Your Bet", prompt="Which turtle win the race? Enter a color: ") 16 | 17 | # turtle colors 18 | colors = ["red", "yellow", "orange", "green", "blue", "purple"] 19 | 20 | # turtle y position for add gap with each other 21 | y_position = [-70, -40, -10, 20, 50, 80] 22 | 23 | # empty list for all turtle 24 | all_turtle = [] 25 | 26 | for turtle_index in range(0, 6): 27 | # turtle shape 28 | new_turtle = Turtle(shape="turtle") 29 | # stop pen writing 30 | new_turtle.penup() 31 | # add colors to turtle 32 | new_turtle.color(colors[turtle_index]) 33 | # start from left edge of screen 34 | new_turtle.goto(x=-230, y=y_position[turtle_index]) 35 | # add all turtle on the list 36 | all_turtle.append(new_turtle) 37 | 38 | # checking user bet 39 | if user_bet: 40 | is_race_on = True 41 | 42 | # Start the game 43 | while is_race_on: 44 | 45 | for turtle in all_turtle: 46 | # checking if the x coordinate value is grater than 230 47 | if turtle.xcor() > 230: 48 | is_race_on = False 49 | # checking wining color 50 | winning_color = turtle.pencolor() 51 | if winning_color == user_bet: 52 | print(f"You've won! The {winning_color} turtle is the winner!") 53 | else: 54 | print(f"You've lost! The {winning_color} turtle is the winner!") 55 | 56 | rand_distance = random.randint(0, 10) 57 | turtle.forward(rand_distance) 58 | 59 | # exit the program on click 60 | screen.exitonclick() 61 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\US_States_Quiz_Game\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/.idea/US_States_Quiz_Game.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/50_states.csv: -------------------------------------------------------------------------------- 1 | state,x,y 2 | Alabama,139,-77 3 | Alaska,-204,-170 4 | Arizona,-203,-40 5 | Arkansas,57,-53 6 | California,-297,13 7 | Colorado,-112,20 8 | Connecticut,297,96 9 | Delaware,275,42 10 | Florida,220,-145 11 | Georgia,182,-75 12 | Hawaii,-317,-143 13 | Idaho,-216,122 14 | Illinois,95,37 15 | Indiana,133,39 16 | Iowa,38,65 17 | Kansas,-17,5 18 | Kentucky,149,1 19 | Louisiana,59,-114 20 | Maine,319,164 21 | Maryland,288,27 22 | Massachusetts,312,112 23 | Michigan,148,101 24 | Minnesota,23,135 25 | Mississippi,94,-78 26 | Missouri,49,6 27 | Montana,-141,60 28 | Nebraska,-61,66 29 | Nevada,-257,56 30 | New Hampshire,302,127 31 | New Jersey,282,65 32 | New Mexico,-128,-43 33 | New York,236,104 34 | North Carolina,239,-22 35 | North Dakota,-44,158 36 | Ohio,176,52 37 | Oklahoma,-8,-41 38 | Oregon,-278,138 39 | Pennsylvania,238,72 40 | Rhode Island,318,94 41 | South Carolina,218,-51 42 | South Dakota,-44,109 43 | Tennessee,131,-34 44 | Texas,-38,-106 45 | Utah,-189,34 46 | Vermont,282,154 47 | Virginia,234,12 48 | Washington,-257,193 49 | West Virginia,200,20 50 | Wisconsin,83,113 51 | Wyoming,-134,90 -------------------------------------------------------------------------------- /US_States_Quiz_Game/States to learn.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,Delaware 3 | 1,Florida 4 | 2,Georgia 5 | 3,Hawaii 6 | 4,Idaho 7 | 5,Illinois 8 | 6,Indiana 9 | 7,Iowa 10 | 8,Kansas 11 | 9,Kentucky 12 | 10,Louisiana 13 | 11,Maine 14 | 12,Maryland 15 | 13,Massachusetts 16 | 14,Michigan 17 | 15,Minnesota 18 | 16,Mississippi 19 | 17,Missouri 20 | 18,Montana 21 | 19,Nebraska 22 | 20,Nevada 23 | 21,New Hampshire 24 | 22,New Jersey 25 | 23,New Mexico 26 | 24,New York 27 | 25,North Carolina 28 | 26,North Dakota 29 | 27,Ohio 30 | 28,Oklahoma 31 | 29,Oregon 32 | 30,Pennsylvania 33 | 31,Rhode Island 34 | 32,South Carolina 35 | 33,South Dakota 36 | 34,Tennessee 37 | 35,Texas 38 | 36,Utah 39 | 37,Vermont 40 | 38,Virginia 41 | 39,Washington 42 | 40,West Virginia 43 | 41,Wisconsin 44 | 42,Wyoming 45 | -------------------------------------------------------------------------------- /US_States_Quiz_Game/blank_states_img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/US_States_Quiz_Game/blank_states_img.gif -------------------------------------------------------------------------------- /WorkoutTracking/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\WorkoutTracking\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /WorkoutTracking/.idea/WorkoutTracking.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WorkoutTracking/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /WorkoutTracking/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /WorkoutTracking/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WorkoutTracking/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WorkoutTracking/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import requests 3 | from datetime import datetime 4 | 5 | # Constant for apis 6 | 7 | APP_ID = "0a2b2c85" 8 | API_KEY = "02462c197f879c28a08f5c389fc83d87" 9 | 10 | NUTRITIONIX_ENDPOINT = "https://trackapi.nutritionix.com/v2/natural/exercise" 11 | 12 | # Sheety api endpoint 13 | SHEETY_ENDPOINT = "https://api.sheety.co/7bdab4900d8f11059efacc57af848a27/myWorkouts/workouts" 14 | 15 | # sheet authentication 16 | USERNAME = "coderuseless" 17 | PASSWORD = "CUCl*8ry0CB&7P*elas$" 18 | 19 | # constant for user 20 | GENDER = "male" 21 | WEIGHT_KG = 78.1 22 | HEIGHT_CM = 176.53 23 | AGE = 23 24 | 25 | # exercise input 26 | exercise_input = input("Tell me which exercise you did: ") 27 | 28 | # exercise api header 29 | headers = { 30 | "x-app-id": APP_ID, 31 | "x-app-key": API_KEY, 32 | } 33 | 34 | exercise_parameters = { 35 | "query": exercise_input, 36 | "gender": GENDER, 37 | "weight_kg": WEIGHT_KG, 38 | "height_cm": HEIGHT_CM, 39 | "age": AGE, 40 | } 41 | 42 | # exercise response 43 | response = requests.post(url=NUTRITIONIX_ENDPOINT, json=exercise_parameters, headers=headers) 44 | result = response.json() 45 | # print(result) 46 | 47 | # ----------- Excel sheet ----------- # 48 | # today date and current time 49 | today_date = datetime.now().strftime("%d/%m/%Y") 50 | now_time = datetime.now().strftime("%X") 51 | 52 | # add those values into the excel sheet 53 | for exercise in result["exercises"]: 54 | sheet_inputs = { 55 | "workout": { 56 | "date": today_date, 57 | "time": now_time, 58 | "exercise": exercise["name"].title(), 59 | "duration": exercise["duration_min"], 60 | "calories": exercise["nf_calories"] 61 | } 62 | } 63 | 64 | sheet_response = requests.post(url=SHEETY_ENDPOINT, json=sheet_inputs, auth=(USERNAME, PASSWORD)) 65 | 66 | print(sheet_response.text) 67 | -------------------------------------------------------------------------------- /average_height_using_for_loop.py: -------------------------------------------------------------------------------- 1 | # Finding average height using for loop. 2 | 3 | # takeing students height and sperated 4 | student_heights = input( 5 | "Input a list of students heights. Seperated by commas.\n => ").split() 6 | 7 | # checking the input in list 8 | for n in range(0, len(student_heights)): 9 | student_heights[n] = int(student_heights[n]) 10 | 11 | # printing the students height list 12 | print(f"Student Height List: {student_heights}") 13 | 14 | # total sum of heigth using for loop 15 | total_height = 0 16 | for height in student_heights: 17 | total_height += height 18 | 19 | print(f"Total height: {total_height}") 20 | 21 | # Total length of students 22 | number_of_students = 0 23 | for student in student_heights: 24 | number_of_students += 1 25 | print(f"Total Number of Students: {number_of_students}") 26 | 27 | # Average Height of students 28 | average_height = round(total_height / number_of_students) 29 | 30 | print(f"Average Height of Studens: {average_height}") 31 | -------------------------------------------------------------------------------- /blind_auction.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | logo = ''' 4 | ___________ 5 | \ / 6 | )_______( 7 | |"""""""|_.-._,.---------.,_.-._ 8 | | | | | | | ''-. 9 | | |_| |_ _| |_..-' 10 | |_______| '-' `'---------'` '-' 11 | )"""""""( 12 | /_________\\ 13 | .-------------. 14 | /_______________\\ 15 | ''' 16 | print(logo) 17 | 18 | # creating empty dict 19 | bids = {} 20 | # is bidding finished 21 | bidding_finished = False 22 | 23 | # find the highest bidder function 24 | 25 | 26 | def find_highest_bidder(bidding_record): 27 | highest_bid = 0 28 | winner = "" 29 | for bidder in bidding_record: 30 | bid_amount = bidding_record[bidder] 31 | if bid_amount > highest_bid: 32 | highest_bid = bid_amount 33 | winner = bidder 34 | print(f"The winner is {winner} with a bid of ${highest_bid} .") 35 | 36 | 37 | # run until bidding finished 38 | while not bidding_finished: 39 | name = input("What is your name? \n => ") 40 | price = int(input("What is your bid? \n => ")) 41 | bids[name] = price 42 | should_continue = input( 43 | "Are there any other bidders? Type 'yes' or 'no' \n => ") 44 | if should_continue == "no": 45 | bidding_finished = True 46 | find_highest_bidder(bids) 47 | elif should_continue == "yes": 48 | os.system('cls' if os.name == 'nt' else 'clear') 49 | else: 50 | print("Invalid Inputs!") 51 | -------------------------------------------------------------------------------- /bmi.py: -------------------------------------------------------------------------------- 1 | # BMI calculator 2 | # Instructions 3 | # Write a program that interprets the Body Mass Index (BMI) based on a user's weight and height. 4 | 5 | # It should tell them the interpretation of their BMI based on the BMI value. 6 | 7 | # Under 18.5 they are underweight 8 | # Over 18.5 but below 25 they have a normal weight 9 | # Over 25 but below 30 they are slightly overweight 10 | # Over 30 but below 35 they are obese 11 | # Above 35 they are clinically obese. 12 | 13 | # Solution 14 | 15 | # Taking user input for height 16 | height = float(input("Enter you height in m: ")) 17 | weight = float(input("Enter your wight in kg: ")) 18 | 19 | 20 | # calculate the bmi value 21 | bmi = round(weight / height ** 2) 22 | 23 | # Checking the condition for BMI Value 24 | if bmi < 18.5: 25 | print(f"Your BMI {bmi}, you are underweight") 26 | elif bmi < 25: 27 | print(f"Your BMI {bmi}, you are normal weight") 28 | elif bmi < 30: 29 | print(f"Your BMI {bmi}, You are slightly overweight") 30 | elif bmi < 35: 31 | print(f"Your BMI {bmi}, You are obese") 32 | else: 33 | print(f"Your BMI {bmi}, You are clinically obese") 34 | 35 | 36 | -------------------------------------------------------------------------------- /calculator_app.py: -------------------------------------------------------------------------------- 1 | # Calculator option 2 | 3 | # add option 4 | def add(n1, n2): 5 | return n1 + n2 6 | 7 | # subtract option 8 | 9 | 10 | def subtract(n1, n2): 11 | return n1 - n2 12 | 13 | # multiple option 14 | 15 | 16 | def multiply(n1, n2): 17 | return n1 * n2 18 | 19 | # divide option 20 | 21 | 22 | def divide(n1, n2): 23 | return n1 / n2 24 | 25 | 26 | # all operation symbloes 27 | operations = { 28 | "+": add, 29 | "-": subtract, 30 | "*": multiply, 31 | "/": divide 32 | } 33 | 34 | # calculator function 35 | 36 | 37 | def calculator(): 38 | num1 = float(input("What's the first number? \n=> ")) 39 | for symbol in operations: 40 | print(symbol) 41 | should_continue = True 42 | 43 | while should_continue: 44 | operation_symbol = input("Pick an operation: ") 45 | num2 = float(input("What's the next number? \n=> ")) 46 | calculation_function = operations[operation_symbol] 47 | answer = calculation_function(num1, num2) 48 | 49 | print(f"{num1} {operation_symbol} {num2} = {answer} ") 50 | 51 | if input(f"Type 'y' to continue calculating with {answer}, or type 'n' to start a new calculation: ") == "y": 52 | num1 = answer 53 | else: 54 | should_continue = False 55 | calculator() 56 | -------------------------------------------------------------------------------- /fizzbuzz.py: -------------------------------------------------------------------------------- 1 | """ 2 | FizzBuzz 3 | Instructions 4 | You are going to write a program that automatically prints the solution to the FizzBuzz game. 5 | 6 | Your program should print each number from 1 to 100 in turn. 7 | 8 | When the number is divisible by 3 then instead of printing the number it should print "Fizz". 9 | 10 | `When the number is divisible by 5, then instead of printing the number it should print "Buzz".` 11 | `When the number is divisible by 5, then instead of printing the number it should print "Buzz".` 12 | `And if the number is divisible by both 3 and 5 e.g. 15 then instead of the number it should print "FizzBuzz"` 13 | `And if the number is divisible by both 3 and 5 e.g. 15 then instead of the number it should print "FizzBuzz"` 14 | e.g. it might start off like this: 15 | 16 | `1 17 | 2 18 | Fizz 19 | 4 20 | Buzz 21 | Fizz 22 | 7 23 | 8 24 | Fizz 25 | Buzz 26 | 11 27 | Fizz 28 | 13 29 | 14 30 | FizzBuzz` 31 | `1 32 | 2 33 | Fizz 34 | 4 35 | Buzz 36 | Fizz 37 | 7 38 | 8 39 | Fizz 40 | Buzz 41 | 11 42 | Fizz 43 | 13 44 | 14 45 | FizzBuzz` 46 | .... etc. 47 | 48 | Hint 49 | Remember your answer should start from 1 and go up to and including 100. 50 | 51 | Each number/text should be printed on a separate line. 52 | """ 53 | 54 | for number in range(1, 101): 55 | if number % 3 == 0 and number % 5 == 0: 56 | print("FizzBuzz") 57 | elif number % 3 == 0: 58 | print("Fizz") 59 | elif number % 5 == 0: 60 | print("Buzz") 61 | else: 62 | print(number) 63 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../:\GitHub\Python-Projects\flaskWTForm\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/flaskWTForm.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flaskWTForm/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /flaskWTForm/README.md: -------------------------------------------------------------------------------- 1 |

Flask WTForm with Bootstrap

2 | 3 |

A very simple bootstrap form generated by flask wtform with validation.

4 | 5 |

Resources

6 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /flaskWTForm/__pycache__/app.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/flaskWTForm/__pycache__/app.cpython-38.pyc -------------------------------------------------------------------------------- /flaskWTForm/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | from flask_wtf import FlaskForm 3 | from wtforms import StringField, PasswordField, SubmitField 4 | from wtforms.validators import DataRequired 5 | from flask_bootstrap import Bootstrap 6 | 7 | 8 | # creating a form 9 | 10 | class LoginForm(FlaskForm): 11 | email = StringField(label='Email', validators=[DataRequired()]) 12 | password = PasswordField(label='Password', validators=[DataRequired()]) 13 | submit = SubmitField(label="Login") 14 | 15 | 16 | app = Flask(__name__) 17 | # app secret key 18 | app.secret_key = b'1\xadL~]\x8e2\xe4\xf6\xa6\xe0\xefWL\xb1\x92' 19 | 20 | # add bootstrap style to the app 21 | Bootstrap(app) 22 | 23 | 24 | @app.route('/') 25 | def home(): 26 | return render_template("index.html") 27 | 28 | 29 | @app.route('/login', methods=["GET", "POST"]) 30 | def login(): 31 | login_form = LoginForm() 32 | if login_form.validate_on_submit(): 33 | if login_form.email.data == "admin@email.com" and login_form.password.data == "123456": 34 | return render_template("success.html") 35 | else: 36 | return render_template("denied.html") 37 | return render_template('login.html', form=login_form) 38 | 39 | 40 | if __name__ == '__main__': 41 | app.run() 42 | -------------------------------------------------------------------------------- /flaskWTForm/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block title %} {% endblock %} 6 | 13 | 14 | 15 | {% block content %} {% endblock %} 16 | 17 | -------------------------------------------------------------------------------- /flaskWTForm/templates/denied.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% extends "bootstrap/base.html" %} 4 | 5 | 6 | {% block title %}Denied{% endblock %} 7 | 8 | 9 | {% block content %} 10 | 11 |
12 |

Access Denied

13 |
14 |
15 | 16 | 19 |
20 |

via GIPHY

21 |
22 | 23 |
24 | 25 | {% endblock %} -------------------------------------------------------------------------------- /flaskWTForm/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% extends 'bootstrap/base.html' %} 4 | 5 | {% block title %} Flask WTForm {% endblock %} 6 | 7 | {% block content %} 8 | 9 |
10 |
11 |

Welcome Flask WTForm

12 |

Are you ready to discover my secret?

13 | Login 14 |
15 |
16 | 17 | {% endblock %} -------------------------------------------------------------------------------- /flaskWTForm/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% extends 'bootstrap/base.html' %} 4 | 5 | 6 | {% import "bootstrap/wtf.html" as wtf %} 7 | 8 | 9 | {% block title %} Login {% endblock %} 10 | 11 | 12 | {% block content %} 13 | 14 |
15 |

Login Form

16 | 17 | {{ wtf.quick_form(form) }} 18 |
19 | 20 | 21 | {% endblock %} -------------------------------------------------------------------------------- /flaskWTForm/templates/success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% extends "base.html" %} 4 | 5 | 6 | {% block title %}Success{% endblock %} 7 | 8 | 9 | {% block content %} 10 | 11 |
12 |

Successfully Login

13 |
14 |
15 | 18 | 19 |

via GIPHY

20 |
21 |
22 | 23 |
24 | 25 | {% endblock %} -------------------------------------------------------------------------------- /hangman/__pycache__/hangman_art.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/hangman/__pycache__/hangman_art.cpython-38.pyc -------------------------------------------------------------------------------- /hangman/__pycache__/hangman_words.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/hangman/__pycache__/hangman_words.cpython-38.pyc -------------------------------------------------------------------------------- /hangman/hangman.py: -------------------------------------------------------------------------------- 1 | # import random package, hangman art and word list 2 | 3 | from hangman_art import logo, stages 4 | import random 5 | import os 6 | 7 | # Update the word list to use the 'word_list' from hangman_words.py 8 | from hangman_words import word_list 9 | 10 | chosen_word = random.choice(word_list) 11 | word_length = len(chosen_word) 12 | 13 | end_of_game = False 14 | lives = 6 15 | 16 | # display the hangman game logo 17 | print(logo) 18 | 19 | # Testing code 20 | print(f'Pssst, the solution is {chosen_word}.') 21 | 22 | # Create blanks 23 | display = [] 24 | for _ in range(word_length): 25 | display += "_" 26 | 27 | while not end_of_game: 28 | guess = input("Guess a letter: ").lower() 29 | # clean the display 30 | os.system('cls' if os.name == 'nt' else 'clear') 31 | 32 | # If the user has entered a letter they've already guessed, print the letter and let them know. 33 | if guess in display: 34 | print(f"You've already guessed {guess}") 35 | 36 | # Check guessed letter 37 | for position in range(word_length): 38 | letter = chosen_word[position] 39 | #print(f"Current position: {position}\n Current letter: {letter}\n Guessed letter: {guess}") 40 | if letter == guess: 41 | display[position] = letter 42 | 43 | # Check if user is wrong. 44 | if guess not in chosen_word: 45 | # If the letter is not in the chosen_word, print out the letter and let them know it's not in the word. 46 | print(f"You guessed {guess}, that's not in the word. You lose a life.") 47 | 48 | lives -= 1 49 | if lives == 0: 50 | end_of_game = True 51 | print("You lose.") 52 | 53 | # Join all the elements in the list and turn it into a String. 54 | print(f"{' '.join(display)}") 55 | 56 | # Check if user has got all letters. 57 | if "_" not in display: 58 | end_of_game = True 59 | print("You win.") 60 | 61 | # printing the stages 62 | print(stages[lives]) 63 | -------------------------------------------------------------------------------- /hangman/hangman_art.py: -------------------------------------------------------------------------------- 1 | stages = [''' 2 | +---+ 3 | | | 4 | O | 5 | /|\ | 6 | / \ | 7 | | 8 | ========= 9 | ''', ''' 10 | +---+ 11 | | | 12 | O | 13 | /|\ | 14 | / | 15 | | 16 | ========= 17 | ''', ''' 18 | +---+ 19 | | | 20 | O | 21 | /|\ | 22 | | 23 | | 24 | ========= 25 | ''', ''' 26 | +---+ 27 | | | 28 | O | 29 | /| | 30 | | 31 | | 32 | =========''', ''' 33 | +---+ 34 | | | 35 | O | 36 | | | 37 | | 38 | | 39 | ========= 40 | ''', ''' 41 | +---+ 42 | | | 43 | O | 44 | | 45 | | 46 | | 47 | ========= 48 | ''', ''' 49 | +---+ 50 | | | 51 | | 52 | | 53 | | 54 | | 55 | ========= 56 | '''] 57 | 58 | logo = ''' 59 | _ 60 | | | 61 | | |__ __ _ _ __ __ _ _ __ ___ __ _ _ __ 62 | | '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \ 63 | | | | | (_| | | | | (_| | | | | | | (_| | | | | 64 | |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_| 65 | __/ | 66 | |___/ ''' 67 | -------------------------------------------------------------------------------- /hello.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmhmubin/Python-Projects-with-source-code/cd8fa6e6e81a591e20157b94404abb662f50bf21/hello.py -------------------------------------------------------------------------------- /higher_or_lower_game/art.py: -------------------------------------------------------------------------------- 1 | logo = """ 2 | __ ___ __ 3 | / / / (_)___ _/ /_ ___ _____ 4 | / /_/ / / __ `/ __ \/ _ \/ ___/ 5 | / __ / / /_/ / / / / __/ / 6 | /_/ ///_/\__, /_/ /_/\___/_/ 7 | / / /____/_ _____ _____ 8 | / / / __ \ | /| / / _ \/ ___/ 9 | / /___/ /_/ / |/ |/ / __/ / 10 | /_____/\____/|__/|__/\___/_/ 11 | """ 12 | 13 | vs = """ 14 | _ __ 15 | | | / /____ 16 | | | / / ___/ 17 | | |/ (__ ) 18 | |___/____(_) 19 | """ 20 | -------------------------------------------------------------------------------- /leapyear.py: -------------------------------------------------------------------------------- 1 | # Write a program that works out whether if a given year is a leap year. A normal year has 365 days, leap years have 366, with an extra day in February. 2 | # This is how you work out whether if a particular year is a leap year. 3 | # on every year that is evenly divisible by 4 except every year that is evenly divisible by 100 ** unless ** the year is also evenly divisible by 400 4 | 5 | # Solution 6 | 7 | # taking input 8 | year = int(input("Which year do you want to check? \n => ")) 9 | 10 | # leap year calculation 11 | if year % 4 == 0: 12 | if year % 100: 13 | if year % 400: 14 | print("Leap Year") 15 | else: 16 | print("Not leap year") 17 | else: 18 | print("Leap Year") 19 | else: 20 | print("Not leap year") 21 | -------------------------------------------------------------------------------- /life_in_weeks.py: -------------------------------------------------------------------------------- 1 | # Your life in weeks 2 | # A program that tells us how many days, weeks, months we have left if we live until 90 days 3 | 4 | # takeing user input 5 | age = input("What is your current age?") 6 | 7 | # convert input string to int value 8 | age_in_int = int(age) 9 | 10 | # Calculation for years,months,weeks and days 11 | years_remaining = 90 - age_in_int 12 | days_remaining = years_remaining * 365 13 | weeks_remaining = years_remaining * 52 14 | months_remaining = years_remaining * 12 15 | 16 | # Printing the result 17 | 18 | message = f"You have {days_remaining} days, {weeks_remaining} weeks, and {months_remaining} months left" 19 | 20 | print(message) 21 | -------------------------------------------------------------------------------- /love_calculator.py: -------------------------------------------------------------------------------- 1 | """ 2 | You are going to write a program that tests the compatibility between two people. We're going to use the super scientific method recommended by BuzzFeed. 3 | To work out the love score between two people: 4 | Take both people's names and check for the number of times the letters in the word TRUE occurs. Then check for the number of times the letters in the word LOVE occurs. Then combine these numbers to make a 2 digit number. 5 | For Love Scores less than 10 or greater than 90, the message should be: 6 | "Your score is **x**, you go together like coke and mentos." 7 | For Love Scores between 40 and 50, the message should be: 8 | "Your score is **y**, you are alright together." 9 | Otherwise, the message will just be their score. e.g.: 10 | "Your score is **z**." 11 | e.g. 12 | name1 = "Angela Yu" 13 | name2 = "Jack Bauer" 14 | 15 | T occurs 0 times 16 | R occurs 1 time 17 | U occurs 2 times 18 | E occurs 2 times 19 | Total = 5 20 | 21 | L occurs 1 time 22 | O occurs 0 times 23 | V occurs 0 times 24 | E occurs 2 times 25 | Total = 3 26 | 27 | Love Score = 53 28 | 29 | Print: "Your score is 53." 30 | """ 31 | 32 | # solution 33 | 34 | print("Welcome to the Love Calculator!") 35 | name1 = input("What is your name? \n") 36 | name2 = input("What is their name? \n") 37 | 38 | 39 | combined_names = name1 + name2 40 | lower_names = combined_names.lower() 41 | t = lower_names.count("t") 42 | r = lower_names.count("r") 43 | u = lower_names.count("u") 44 | e = lower_names.count("e") 45 | first_digit = t + r + u + e 46 | 47 | l = lower_names.count("l") 48 | o = lower_names.count("o") 49 | v = lower_names.count("v") 50 | e = lower_names.count("e") 51 | second_digit = l + o + v + e 52 | 53 | score = int(str(first_digit) + str(second_digit)) 54 | 55 | if (score < 10) or (score > 90): 56 | print(f"Your score is {score}, you go together like coke and mentos.") 57 | elif (score >= 40) and (score <= 50): 58 | print(f"Your score is {score}, you are alright together.") 59 | else: 60 | print(f"Your score is {score}.") 61 | -------------------------------------------------------------------------------- /password_generator.py: -------------------------------------------------------------------------------- 1 | # Password Generator Project 2 | import random 3 | letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 4 | 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] 5 | numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] 6 | symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+'] 7 | 8 | print("Welcome to the PyPassword Generator!") 9 | nr_letters = int(input("How many letters would you like in your password?\n")) 10 | nr_symbols = int(input(f"How many symbols would you like?\n")) 11 | nr_numbers = int(input(f"How many numbers would you like?\n")) 12 | 13 | 14 | # empty list 15 | password_list = [] 16 | # generating the letters 17 | for char in range(1, nr_letters+1): 18 | password_list.append(random.choice(letters)) 19 | 20 | # generating the symbols 21 | for char in range(1, nr_symbols + 1): 22 | password_list.append(random.choice(symbols)) 23 | 24 | # generating the numbers 25 | for char in range(1, nr_numbers + 1): 26 | password_list.append(random.choice(numbers)) 27 | 28 | # print(password_list) 29 | # shuffle password inside of the list 30 | random.shuffle(password_list) 31 | # print(password_list) 32 | 33 | # empty variable 34 | password = "" 35 | 36 | for char in password_list: 37 | password += char 38 | 39 | print(f"Your Password is: {password}") 40 | -------------------------------------------------------------------------------- /rock_paper_scissor.py: -------------------------------------------------------------------------------- 1 | # rock, paper and scissors games 2 | 3 | # import random package 4 | import random 5 | 6 | # ASCII Arts for rock, paper and scissors 7 | # Adding ASCII art into a variable 8 | 9 | rock = ''' 10 | _______ 11 | ---' ____) 12 | (_____) 13 | (_____) 14 | (____) 15 | ---.__(___) 16 | ''' 17 | 18 | paper = ''' 19 | _______ 20 | ---' ____)____ 21 | ______) 22 | _______) 23 | _______) 24 | ---.__________) 25 | ''' 26 | 27 | scissors = ''' 28 | _______ 29 | ---' ____)____ 30 | ______) 31 | __________) 32 | (____) 33 | ---.__(___) 34 | ''' 35 | 36 | # Adding Game Images into a list 37 | game_images = [rock, paper, scissors] 38 | 39 | # Taking input from user choice 40 | user_choice = int(input( 41 | "What do you choose? Type 0 for Rock, 1 for Paper, 2 for scissor. \n => ")) 42 | 43 | print("User Choice: ") 44 | 45 | # print game image by user choice 46 | print(game_images[user_choice]) 47 | 48 | # random computer choice 49 | computer_chocie = random.randint(0, 2) 50 | 51 | print("Computer Choice: ") 52 | 53 | # print game image by computer choice 54 | print(game_images[computer_chocie]) 55 | 56 | # rules in logic 57 | if user_choice == 0 and computer_chocie == 2: 58 | print("You win! 🎉") 59 | elif computer_choice == 0 and user_chocie == 2: 60 | print("You lose. ☠") 61 | elif computer_chocie > user_choice: 62 | print("You lose. ☠") 63 | elif user_choice > computer_chocie: 64 | print("You win!🎉 ") 65 | elif computer_chocie == user_choice: 66 | print("It's a draw.") 67 | elif user_choice >= 3 or user_choice < 0: 68 | print("You typed an invalid number, You Lose. ☠") 69 | -------------------------------------------------------------------------------- /tipcal.py: -------------------------------------------------------------------------------- 1 | # TIP CALCULATOR 2 | # If the bill $150.00, split between 5 people, with 12% tip. Round the result to 2 decimal places. 3 | # Equation = (bill / person) * tip 4 | 5 | # welcome message 6 | print("Welcome to the tip calculator!!") 7 | 8 | # takeing user input value 9 | bill = float(input("What was the total bill? \n $")) 10 | 11 | # Tip percentage message 12 | tip = int( 13 | input("What percentage tip would you like to give? [10,12 or 15 %] \n %")) 14 | 15 | # how many people 16 | people = int(input("How many people to split the bill? \n")) 17 | 18 | # tip calculation 19 | tip_as_percentage = tip / 100 20 | total_tip_amount = bill * tip_as_percentage 21 | total_bill = bill + total_tip_amount 22 | bill_per_person = total_bill / people 23 | 24 | final_amount = round(bill_per_person, 2) 25 | 26 | print(f"Each person should pay: ${final_amount}") 27 | -------------------------------------------------------------------------------- /tresure_map.py: -------------------------------------------------------------------------------- 1 | """ 2 | Instructions 3 | You are going to write a program which will mark a spot with an X. 4 | 5 | The map is made of 3 rows of blank squares. 6 | 7 | 1 2 3 8 | 1 ['⬜️', '⬜️', '⬜️'] 9 | 2 ['⬜️', '⬜️', '⬜️'] 10 | 3 ['⬜️', '⬜️', '⬜️'] 11 | 12 | Your program should allow you to enter the position of the treasure using a two-digit system. The first digit is the vertical column number and the second digit is the horizontal row number. e.g.: 13 | 14 | Example Input 1 15 | column 2, row 3 would be entered as: 16 | => 23 17 | 18 | print 19 | ['⬜️', '⬜️', '⬜️'] 20 | ['⬜️', 'X', '⬜️'] 21 | ['⬜️', '⬜️', '⬜️'] 22 | """ 23 | 24 | # Creating the box for map with emoji 25 | row1 = ["⬜️", "⬜️", "⬜️"] 26 | row2 = ["⬜️", "⬜️", "⬜️"] 27 | row3 = ["⬜️", "⬜️", "⬜️"] 28 | map = [row1, row2, row3] 29 | print(f"{row1}\n{row2}\n{row3}") 30 | position = input("Where do you want to put the treasure? ") 31 | 32 | # Horizontal & Vertical initilize Postion 0 33 | horizonal = int(position[0]) 34 | vertical = int(position[0]) 35 | 36 | # selecting row and replace selected row with "x" 37 | selected_row = map[vertical - 1] 38 | selected_row[horizonal - 1] = "X" 39 | 40 | # Printing the tresure map 41 | print(f"{row1}\n{row2}\n{row3}") 42 | -------------------------------------------------------------------------------- /whos_paying.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | # creating a random seed nubmer 4 | test_seed = int(input("Create a seed number: ")) 5 | random.seed(test_seed) 6 | 7 | # Split string method 8 | nameAsCSV = input("Give me everybody's name, seperated by commas.\n =>") 9 | names = nameAsCSV.split(", ") 10 | 11 | # Get the total number of items in list 12 | num_items = len(names) 13 | 14 | # Generate random numbers between 0 and the last item on the list 15 | random_choice = random.randint(0, num_items - 1) 16 | preson_who_will_pay = names[random_choice] 17 | print(preson_who_will_pay + " is going to buy the meal today!") 18 | --------------------------------------------------------------------------------