├── .github ├── dependabot.yml └── workflows │ ├── datadog-synthetics.yml │ └── lint_python.yml ├── .gitignore ├── 1 File handle ├── File handle binary │ ├── Deleting record in a binary file.py │ ├── File handle binary read (record in non list form).py │ ├── Update a binary file.py │ ├── Update a binary file2.py │ ├── class.dat │ ├── question 1 (elegible for remedial, top marks).py │ ├── search record in binary file.py │ └── studrec.dat └── File handle text │ ├── counter.py │ ├── file handle 12 length of line in text file.py │ ├── happy.txt │ ├── input,output and error streams.py │ ├── question 2.py │ ├── question 5.py │ ├── question 6.py │ ├── question3.py │ ├── special symbol after word.py │ └── story.txt ├── 8_puzzle.py ├── A solution to project euler problem 3.py ├── AI Game └── Tic-Tac-Toe-AI │ ├── tic tac │ └── tictactoe.py ├── AREA OF TRIANGLE.py ├── ARKA.py ├── ASCIIvaluecharacter.py ├── Add_two_Linked_List.py ├── Anonymous_TextApp.py ├── AreaOfTriangle.py ├── Armstrong_number ├── Armstrong_number.py ├── Assembler ├── GUIDE.txt ├── README.md ├── assembler.py ├── examples │ ├── code.txt │ ├── code2.txt │ ├── code3.txt │ ├── code4.txt │ ├── klmn │ └── test.txt └── requirements.txt ├── AutoComplete_App ├── backend.py └── frontend.py ├── Automated Scheduled Call Reminders ├── caller.py ├── requirements.txt └── schedular.py ├── Bank Application .ipynb ├── Base Converter Number system.py ├── Battery_notifier.py ├── Binary Coefficients.py ├── Binary_search.py ├── Binary_to_Decimal.py ├── BlackJack_game ├── blackjack.py ├── blackjack_rr.py ├── blackjack_simulate.py └── requirements.txt ├── BoardGame-CLI ├── python.py ├── snakeLadder.py └── uno.py ├── BrowserHistory ├── backend.py └── tests │ └── test_browser_history.py ├── BruteForce.py ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CRC └── crc.py ├── CSV_file.py ├── Caesar Cipher Encoder & Decoder.py ├── Calculate resistance.py ├── Calculator with simple ui.py ├── Calendar (GUI).py ├── Cat ├── cat.py ├── text_a.txt ├── text_b.txt └── text_c.txt ├── Checker_game_by_dz ├── __init__.py ├── assets │ └── crown.png ├── first.py └── modules │ ├── __init__.py │ ├── checker.py │ ├── checker_board.py │ ├── pieces.py │ └── statics.py ├── Chrome Dino Automater.py ├── Classification_human_or_horse.py ├── CliYoutubeDownloader.py ├── CliYoutubeDownloader ├── CliYoutubeDownloader.py └── requirements.txt ├── Collatz-Conjecture.py ├── Colors ├── multicoloredline.py ├── pixel_sort.py ├── primary_colors.py └── print_colors.py ├── Compression_Analysis ├── PSNR.py ├── compressed_image.png ├── example_image.jpg └── orignal_image.png ├── Conversation.py ├── CountMillionCharacter.py ├── CountMillionCharacters-2.0.py ├── CountMillionCharacters-Variations └── variation1.py ├── Crack_password.py ├── Credit_Card_Validator.py ├── Cricket_score.py ├── Day_of_week.py ├── Decimal number to binary function.py ├── Decimal_To_Binary.py ├── Delete_Linked_List.py ├── Detect_Remove_loop.py ├── Dictionary opperations (input,update a dict).py ├── Differentiate_List.py ├── Divide Operator.py ├── Downloaded Files Organizer ├── browser_status.py ├── move_to_directory.py ├── obs.py ├── readme.md └── requirements.txt ├── Droplistmenu ├── GamesCalender.py └── README.md ├── Electronics_Algorithms ├── Ohms_law.py └── resistance.py ├── Email-Automation.py ├── Emoji Dictionary ├── Images │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ ├── 8.jpg │ └── 9.jpg ├── README.md ├── emoji_dictionary.py └── requirements.txt ├── Encryption using base64.py ├── EncryptionTool.py ├── Exception_Handling_in_Python.py ├── Extract-Table-from-pdf-txt-docx ├── Parent │ ├── Child1 │ │ ├── Document_Child1.docx │ │ ├── Pdf1_Child1.pdf │ │ ├── Pdf2_Child2.pdf │ │ └── Text_Child1.txt │ ├── Child2 │ │ ├── Document_Child2.docx │ │ ├── Pdf1_Child2.pdf │ │ ├── Pdf2_Child2.pdf │ │ └── Text_Child2.txt │ └── Child3 │ │ ├── Document_Child3.docx │ │ ├── Pdf1_Child3.pdf │ │ ├── Pdf2_Child3.pdf │ │ └── Text_Child3.txt └── main.py ├── ExtractThumbnailFromVideo ├── README.md └── extract_thumbnail_from_video.py ├── Extract_Text_from_image.py ├── FIND FACTORIAL OF A NUMBER.py ├── FTP in python ├── Face and eye Recognition ├── face_recofnation_first.py └── gesture_control.py ├── Face_Mask_detection (haarcascade) ├── Resources │ ├── haarcascade_frontalface_default.xml │ └── keras_model.h5 └── mask_detection.py ├── FibonacciNumbersWithGenerators.py ├── Fibonacci_sequence_recursive_sol.py ├── Find current weather of any city using openweathermap API.py ├── FindingResolutionOfAnImage.py ├── FizzBuzz.py ├── Flappy Bird - created with tkinter ├── .gitignore ├── Background.py ├── Bird.py ├── Flappy Bird.py ├── Images │ ├── background.png │ ├── bird.png │ ├── exit_button.png │ ├── original_background.png │ ├── scoreboard.png │ ├── start_button.png │ ├── title.png │ ├── tube.png │ └── tube_mouth.png ├── README.md ├── Settings.py └── Tubes.py ├── Generate a random number between 0 to 9.py ├── Google_Image_Downloader ├── create_dir.py └── image_grapper.py ├── Google_News.py ├── Gregorian_Calendar.py ├── Grocery calculator.py ├── GroupSms_Way2.py ├── Guess_the_number_game.py ├── Guessing_Game.py ├── HTML_to_PDF ├── index.html ├── main.py └── output.pdf ├── Hand-Motion-Detection ├── hand_motion_recognizer.py └── requirements.txt ├── HangMan Game ├── Hangman.py ├── Hotel-Management.py ├── Image-watermarker ├── README.md ├── app.py ├── fonts │ ├── AkayaKanadaka.ttf │ ├── DancingScript.ttf │ ├── Decorative.ttf │ └── MartianMono.ttf ├── requirements.txt └── watermark.py ├── ImageDownloader ├── img_downloader.py └── requirements.txt ├── Image_resize.py ├── Industrial_developed_hangman ├── Data │ ├── local_words.txt │ └── text_images.txt ├── Makefile ├── README.md ├── poetry.lock ├── pyproject.toml ├── pytest.ini ├── recorces │ └── img.png ├── setup.cfg ├── src │ └── hangman │ │ ├── __init__.py │ │ └── main.py └── tests │ ├── __init__.py │ └── test_hangman │ ├── __init__.py │ └── test_main.py ├── Infix_to_Postfix.py ├── Insert_operation_on_Linked_List.py ├── JARVIS ├── JARVIS_2.0.py ├── README.md └── requirements.txt ├── Job_scheduling.py ├── JsonParser.py ├── JustDialScrapperGUI └── Justdial Scrapper GUI.py ├── Key_Binding ├── key_binding.py └── requirement.txt ├── Kilometerstomile.py ├── Koch Curve ├── README.txt ├── koch curve.py └── output_2.mp4 ├── LETTER GUESSER ├── LICENSE.md ├── Laundary System ├── README.md └── code.py ├── Letter_Counter.py ├── LinkedLists all Types ├── circular_linked_list.py ├── doubly_linked_list.py └── singly_linked_list.py ├── List.py ├── Luhn_Algorithm.py ├── ML House Prediction.ipynb ├── Mad Libs Generator.py ├── Memory_game.py ├── Merge_linked_list.py ├── MobiusFunction.py ├── Model Usage.ipynb ├── Monitor Apache ├── Mp3_media_player.py ├── Multiply.py ├── MySQL_Databses.py ├── News_App ├── Newsapp.py ├── README.md ├── patterns.py └── requirements.txt ├── Number reverse.py ├── Organise.py ├── PDF ├── basic.py ├── demerge_pdfs.py ├── header_footer.py ├── images.py ├── images │ └── ss.png ├── output.pdf └── requirements.txt ├── PDFtoAudiobook.py ├── PONG_GAME.py ├── PORT SCANNER.PY ├── PRACTICEPROJECT-DISREGARD.txt ├── Palindrome_Checker.py ├── Password Generator ├── pass_gen.py ├── requirements.txt └── requirements_new.txt ├── Patterns ├── half triangle pattern.py ├── pattern2.py ├── pattern5.py ├── pattern6.py └── patterns.py ├── Pc_information.py ├── Personal-Expense-Tracker ├── README.md └── expense_tracker.py ├── PingPong ├── Ball.py ├── Slab.py └── main.py ├── Polyline.py ├── Pomodoro (tkinter).py ├── PongPong_Game ├── README.md ├── pong │ ├── __init__.py │ ├── ball.py │ ├── load.py │ ├── paddle.py │ └── rectangle.py ├── pong_game_play.gif ├── pongpong.py └── requirements.txt ├── Prime_number.py ├── Program of Reverse of any number.py ├── Program to print table of given number.py ├── Program to reverse Linked List( Recursive solution).py ├── Python Distance.py ├── Python Program for Product of unique prime factors of a number.py ├── Python Program for Tower of Hanoi.py ├── Python Program for factorial of a number ├── Python Program to Count the Number of Each Vowel.py ├── Python Program to Display Fibonacci Sequence Using Recursion.py ├── Python Program to Find LCM.py ├── Python Program to Merge Mails.py ├── Python Program to Print the Fibonacci sequence.py ├── Python Program to Remove Punctuations from a String.py ├── Python Program to Reverse a linked list.py ├── Python Program to Sort Words in Alphabetic Order.py ├── Python Program to Transpose a Matrix.py ├── Python Voice Generator.py ├── Python-Array-Equilibrium-Index.py ├── Python_chatting_application ├── README.md ├── client.py └── server.py ├── Python_swapping.py ├── QR_code_generator └── qrcode.py ├── QuadraticCalc.py ├── QuestionAnswerVirtualAssistant ├── backend.py ├── frontend.py └── requirements.txt ├── README.md ├── Random Password Generator.py ├── RandomDice.py ├── RandomNumberGame.py ├── Randomnumber.py ├── ReadFromCSV.py ├── Recursion Visulaizer ├── .recursionVisualizer.py.swp ├── Meshimproved.PNG ├── fencedmesh.PNG ├── git └── recursionVisualizer.py ├── Reverse_list_in_groups.py ├── Rotate_Linked_List.py ├── SOUNDEX.py ├── Search_Engine ├── README.md ├── backend.py ├── frontend.py └── test_data.py ├── Secret message generator GUI by tkinter.py ├── Shortest Distance between Two Lines.py ├── SimpleStopWatch.py ├── Snake-Water-Gun-Game.py ├── Snake_water_gun ├── README.md └── main.py ├── Sorting Algorithims ├── heapsort_linkedlist.py ├── mergesort_linkedlist.py └── quicksort_linkedlist.py ├── Sorting Algorithms ├── Binary_Insertion_Sort.py ├── Bubble_Sorting_Prog.py ├── Bubble_sort.py ├── Count sort.py ├── Counting Sort.py ├── Counting-sort.py ├── Cycle Sort.py ├── Heap sort.py ├── Iterative Merge Sort.py ├── Linear_Insertion_Sort.py ├── Merge Sort.py ├── Merge-sort.py ├── Quick sort.py ├── Shell Sort.py ├── Sort the values of first list using second list.py ├── Sorted_Inserted_Linked_List.py ├── SortingAStringAlphabetically.py ├── Sorting_List.py ├── Tim_sort.py ├── brickSort.py ├── bubblesortpgm.py ├── dual_pivot_quicksort.py ├── heap_sort.py ├── insertion_sort.py ├── merge_sort.py ├── pigeonhole_sort.py ├── quick_sort.py ├── recursive-quick-sort.py ├── selectionSort.py ├── selection_sort.py ├── sorting.py ├── stooge_sort.py └── wave_sort.py ├── SpeechToText.py ├── Split_Circular_Linked_List.py ├── StringToBinary.py ├── String_Palindrome.py ├── Strings.py ├── Sum of digits of a number.py ├── TIC_TAC_TOE └── index.py ├── TTS.py ├── Task1.2.txt ├── TaskManager.py ├── TaskPlanner.py ├── Test-Case-Generator └── test_case.py ├── ThirdAI └── Terms and Conditions │ ├── Readme.md │ ├── ThirdAI.py │ ├── TkinterUI.py │ └── XYZ product.pdf ├── TicTacToe.py ├── Tic_Tac_Toe.py ├── Timetable_Operations.py ├── To find the largest number between 3 numbers.py ├── To print series 1,12,123,1234......py ├── Todo_GUi.py ├── Translator ├── README.md └── translator.py ├── Trending youtube videos ├── Triplets with zero sum ├── Readme.md └── find_Triplets_with_zero_sum.py ├── Turn your PDFs into audio books ├── audiobook_gen.py └── requirements.txt ├── Turtle_Star.py ├── Tweet Pre-Processing.py ├── Type of angles of a triangle.py ├── Type_of_angles_of_triangle.py ├── UI-Apps ├── README.md └── clock.py ├── Unit Digit of a raised to power b.py ├── Untitled.ipynb ├── Voice Command Calculator.py ├── VoiceAssistant ├── DOCUMENTATION.md ├── GUIDE.md ├── PRE-REQUISITES.md ├── Project_Basic_struct │ ├── TextTospeech.py │ ├── VoiceAssistant_main.py │ ├── dictator.py │ ├── menu.py │ ├── speakListen.py │ ├── speechtotext.py │ ├── textRead.py │ └── websiteWork.py └── README.md ├── VoiceRepeater ├── __main__.py └── readme.md ├── Weather Scrapper ├── weather.csv └── weather.py ├── WeatherGUI.py ├── Web Socket.py ├── Web_Scraper.py ├── Webbrowser └── tk-browser.py ├── Wikipdedia ├── flask_rendering.py ├── main.py ├── practice_beautifulsoap.py ├── static │ └── js │ │ └── output.js └── template │ ├── index.html │ └── output.html ├── WikipediaModule.py ├── Windows_Wallpaper_Script ├── ReadMe.md ├── Wallpapers │ ├── desktop │ │ ├── 89d49683c75888287b50ccb05cab960b991231639dabe5bc817e1d9395a39694.jpg │ │ ├── acc15612b1c85619e06c584a52f6474242963dbb9fe315ec4ecd44de8f3702c8.jpg │ │ └── c1385a4022859c16bdf317e09668dbb3fc41a7e1c160605539abd1bcd29625af.jpg │ └── mobile │ │ ├── 5678c6685841ab637cfa63b8c0e32ee205649af2051eb75f40b00f4d5a42b7b9.jpg │ │ ├── a33845e422c7d1b668f60e53e942736c7bbc74299469b7df734254d28e026dc4.jpg │ │ └── e22f23869f500ee576cdc02fb83f911de31440d589e329d04576e571a54b8851.jpg └── wallpaper_extract.py ├── Word_Dictionary └── dictionary.py ├── Wordle ├── 5 letter word dictionary.txt ├── Dictionary.txt └── wordle.py ├── XML └── HTML parsing ├── XORcipher ├── README.md ├── XOR_cipher.py └── test_XOR_cipher.py ├── Youtube Downloader With GUI ├── Screenshot (138).png ├── main.py ├── photo.jpg ├── photo.png └── youtube-ios-app.ico ├── add_two_number.py ├── add_two_nums.py ├── advanced_calculator.py ├── agecalculator.py ├── alexa_news_headlines.py ├── area_of_square_app.py ├── armstrongnumber.py ├── async_downloader ├── async_downloader.py └── requirements.txt ├── automail.py ├── avg_xdspam_confidence.py ├── backup_automater_services.py ├── balance_parenthesis.py ├── bank_managment_system ├── backend.py └── frontend.py ├── bankmanaging.db ├── basic_cal.py ├── batch_file_rename.py ├── billing.py ├── binary search.py ├── binarySTree isTrue_YashV1729.Java ├── binary_search_tree.py ├── binary_search_trees ├── delete_a_node_in_bst.py ├── inorder_successor.py ├── inorder_traversal.py ├── insert_in_bst.py ├── main.py ├── mirror_a_bst.py ├── print_in_range.py ├── root_to_leaf_paths.py ├── search_in_bst.py ├── tree_node.py └── validate_bst.py ├── binod.py ├── binod.txt ├── birthdays.py ├── blackJackGUI.py ├── blackjack.py ├── bodymass.py ├── bookstore_manangement_system.py ├── brickout-game ├── README.md ├── brickout-game.py └── classDiagram.png ├── calc_area.py ├── calculator-gui.py ├── calculator.py ├── cartesian_product.py ├── changemac.py ├── chaos.py ├── check if a number positive , negative or zero ├── check whether the string is Symmetrical or Palindrome.py ├── check_file.py ├── check_for_sqlite_files.py ├── check_input.py ├── check_internet_con.py ├── check_prime.py ├── chicks_n_rabs.py ├── cicd ├── classicIndianCardMatch.py ├── cli_master ├── cli_master.py ├── database_import_countries.py └── validation_page.py ├── cloning_a_list.py ├── colorma_as_color.py ├── colour spiral.py ├── communication ├── file.py ├── pipe.py └── socket_conn.py ├── compass_code.py ├── consonant.py ├── contribution.txt ├── convert celsius into fahrenheit.py ├── convert_time.py ├── convert_wind_direction_to_degrees.py ├── count the numbers of two vovels.py ├── create password validity in python.py ├── create_dir_if_not_there.py ├── cricket_live_score.py ├── cricket_news.py ├── currency converter ├── README.md ├── country.txt ├── gui.ui └── main.py ├── daily_checks.py ├── daily_horoscope.py ├── data.csv ├── data.db ├── data.json ├── date-timeclient.py ├── date-timeserver.py ├── days_from_date.py ├── dec_to_hex.py ├── decimal to binary.py ├── depreciated_programs └── corona_cases.py ├── dialogs ├── README.md ├── messagebox.py └── requirements.txt ├── diamond.py ├── dice.py ├── diceV2_dynamic.py ├── dice_rolling_simulator.py ├── diction.py ├── different model output ├── digital_clock.py ├── dir_test.py ├── divisors_of_a_number.py ├── email id dictionary ├── README.md ├── dict1.py └── mbox-short.txt ├── encrypter-decrypter-gui.py ├── encrypter_decrypter_gui.py ├── encryptsys.py ├── env_check.py ├── environment.yml ├── equations.py ├── ex20.py ├── example.txt ├── fF ├── facebook id hack.py ├── facebook-autologin-bot.py ├── factorial_perm_comp.py ├── factors.py ├── fastapi.py ├── fetch_news.py ├── fibonacci.py ├── fibonacci_SIMPLIFIED ├── fibonici series.py ├── file_ext_changer.py ├── fileinfo.py ├── find_cube_root.py ├── find_prime.py ├── finding LCM.py ├── findlargestno.md ├── flappyBird_pygame ├── README.md ├── flappy_bird.py └── images │ ├── background.png │ ├── bird.gif │ ├── bird_wing_down.png │ ├── bird_wing_up.png │ ├── ground.png │ ├── pipe.png │ ├── pipe_body.png │ └── pipe_end.png ├── floodfill ├── demo.gif └── floodfill.py ├── folder_size.py ├── four_digit_num_combination.py ├── framework └── quo.md ├── friday.py ├── ftp_send_receive.py ├── gambler.py ├── game_of_life ├── 05_mixed_sorting.py ├── game_o_life.py └── sample.gif ├── gcd.py ├── generate_permutations.py ├── get_crypto_price.py ├── get_info_remoute_srv.py ├── get_likes_on_FB.py ├── get_youtube_view.py ├── google.py ├── googlemaps.py ├── googleweb.py ├── greaterno.py ├── greattwono ├── gstin_scraper.py ├── gui_calculator.py ├── hamming-numbers ├── happy_num.py ├── heap_sort.py ├── helloworld.py ├── housing.data ├── housing.names ├── how to add three numbers and find type in python.py ├── how to display the fibonacci sequence up to n-.py ├── image2pdf ├── image2pdf.py └── requirements.txt ├── img └── hand1.jpg ├── importerror.txt ├── index.html ├── index.py ├── inheritance_YahV1729.python ├── input matrice,product any order!.py ├── insertion_sort.py ├── insta_image_saving ├── driver │ ├── driver.exe │ └── file ├── instagram_image_scrapping.ipynb ├── instructions.txt ├── output │ └── file └── readme.txt ├── insta_monitering ├── con_file.py ├── insta_api.py ├── insta_datafetcher.py ├── ipList.txt └── subpinsta.py ├── internet_connection_py3.py ├── invisible_clock.py ├── iprint.py ├── is_number.py ├── jee_result.py ├── kilo_to_miles.py ├── kmp_str_search.py ├── large_files_reading.py ├── largestno.py ├── lcm.py ├── leap year.py ├── length.py ├── letter_frequency.py ├── levenshtein_distance.py ├── libs ├── haarcascade_eye.xml ├── haarcascade_eye_tree_eyeglasses.xml └── haarcascade_frontalface_default.xml ├── linear search.py ├── linear-algebra-python ├── README.md └── src │ ├── Transformations2D.py │ ├── lib.py │ ├── lib.pyc │ └── tests.py ├── linear_search.py ├── live_sketch.py ├── loader.py ├── local_weighted_learning ├── local_weighted_learning.md └── local_weighted_learning.py ├── login.py ├── logs.py ├── longest_increasing_subsequence_length.py ├── loops.py ├── love_turtle.py ├── luhn_algorithm_for_credit_card_validation.py ├── magic8ball.py ├── magic_8_ball.py ├── mapit.py ├── mathfunctions ├── meme_maker.py ├── memorygame.py ├── merge.py ├── missing number from list.py ├── mobilePhoneSpecsScrapper.py ├── move_files_over_x_days.py ├── movie_details.py ├── multiple_comditions.py ├── multiplication_table.py ├── my project ├── nDigitNumberCombinations.py ├── nasa_apod_with_requests ├── README.md ├── run.py └── settings.py ├── new.py ├── new_pattern.py ├── new_script.py ├── news_articles__scraper.py ├── news_intent_schema.json ├── next_number.py ├── nitkarshchourasia └── to_sort │ ├── GUI_apps │ └── tkinter_apps │ │ ├── counter_app │ │ └── counter_app.py │ │ ├── hello_world_excla_increment_app │ │ └── hello_world_incre_decre_(!).py │ │ └── simple_calc_GUI │ │ └── simple_calculator_GUI.py │ ├── JARVIS_python_bot │ ├── .vscode │ │ └── settings.json │ ├── JARVIS_2.0.py │ ├── README.md │ ├── check_internet_con.py │ ├── features_to_add.py │ └── requirements.txt │ ├── determine_sign.py │ ├── django_projects │ └── ToDo_webapp │ │ ├── ToDo_webapp_Screenshot_demo.png │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── todo │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── todo │ │ │ │ └── index.html │ │ ├── tests.py │ │ └── views.py │ │ └── todo_site │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── one_rep_max_calculator │ ├── README.md │ ├── one_rep_max_calculator.py │ └── one_rep_max_calculator_gui.py │ ├── pdf_to_docx_converter │ ├── pdf_to_docx.py │ └── requirements.txt │ └── word2number │ └── word2number.py ├── nmap_scan.py ├── nodepad ├── README.md ├── bin │ ├── notepad.pyc │ └── notepad_support.pyc ├── img │ └── screenshot.png ├── notepad.py └── src │ └── notepad.tcl ├── notepad └── notepad_support.py ├── nslookup_check.py ├── num-py.py ├── number guessing.py ├── numberguessinggame └── index.py ├── numeric_password_cracker.py ├── oneeven.py ├── oryx-build-commands.txt ├── osinfo.py ├── other_pepole └── get_ip_gui ├── output.pdf ├── pan.py ├── passwordGen.py ├── passwordGenerator.py ├── password_checker.py ├── password_cracker.py ├── password_manager.py ├── password_programs_multiple ├── animal_name_scraiper.py └── passwordGenerator.py ├── personal_translator.py ├── ph_email.py ├── ping_servers.py ├── ping_subnet.py ├── polygon.py ├── portscanner.py ├── positiveNegetive.py ├── power_of_n.py ├── power_of_two.py ├── powerdown_startup.py ├── powers of 2.py ├── powerup_checks.py ├── primelib ├── Prime.txt ├── README └── primelib.py ├── print hello world.py ├── prison_break_scrapper.py ├── pscheck.py ├── psunotify.py ├── puttylogs.py ├── pyauto.py ├── pygame.py ├── pyhton_array.py ├── pythagoreanTriplets.py ├── python Space Invader game.py ├── python program for finding square root for positive number.py ├── pythonVideoDownloader.py ├── python_codes ├── python_sms.py ├── python_webscraper.py ├── qrcode.py ├── qrdecoder.py ├── quiz_game.py ├── quote.py ├── random-sentences.py ├── random_file_move.py ├── randomloadingmessage.py ├── rangoli.py ├── read_excel_file.py ├── reading_csv.py ├── rearrange-files └── rearrange-files.py ├── recursive-fibonacci.py ├── recursiveStrings.py ├── recyclebin.py ├── remove a character from a file and rewrite.py ├── repeat.py ├── replacetext.py ├── repo_website ├── docs │ ├── README_og.md │ └── img │ │ └── favicon.ico └── mkdocs.yml ├── requirements.txt ├── requirements_with_versions.txt ├── reversed_pattern3.py ├── rock_paper_scissor_game.py ├── rook.py ├── rotate_string.py ├── rotatelist.py ├── russian_roulette.py ├── sample.xlsx ├── saving_input_into_list.py ├── scalg.py ├── scientific_cal.py ├── scrap_file.py ├── script_count.py ├── script_listing.py ├── season-1819_csv.csv ├── send_message_automation ├── README.md ├── author_name_NC.txt ├── automatic_send-message_demo_video.mp4 ├── message_automation.py ├── send_message_automation_demo_gif_image.gif └── send_message_automation_demo_video_2.mp4 ├── sendemail.py ├── sensors_information.py ├── serial_scanner.py ├── sha1.py ├── sierpinski_triangle.py ├── simpleInterest.py ├── simple_calcu.py ├── simple_calculator └── simple_calculator.py ├── simulate_memory_cpu.py ├── singly_linked_list.py ├── size(resolution)image.py ├── slack_message.py ├── snake.py ├── snake_case_renamer_depth_one.py ├── socket-programming ├── README.md ├── client.py ├── requirements.txt └── server.py ├── solution to euler project problem 10.py ├── sorting_algos.py ├── soundex_algorithm.py ├── spiralmatrix.py ├── spotifyAccount.py ├── sqlite_check.py ├── sqlite_table_check.py ├── square_root.py ├── stack.py ├── stackF_Harsh2255.py ├── stone_paper_scissor ├── main.py └── utils.py ├── string_palin.py ├── string_rotation.py ├── sudoku.py ├── sum_of_digits_of_a_number.py ├── swap.py ├── swapping of two numbers ├── test.cpp ├── testlines.py ├── text to speech ├── text-to-audio ├── README.md ├── hello.txt ├── hello_world.mp3 ├── main.py ├── requirements.txt └── text-file-to-audio.py ├── text_file_replace.py ├── text_to_audio ├── README.md ├── author_name_NC.txt ├── main.py ├── requirements.txt └── special_file.txt ├── text_to_pig_latin.py ├── tf_idf_generator.py ├── thired-party-haarcascade-mustache-on-face ├── Nose.xml ├── face.xml ├── image │ ├── avee.png │ └── mustache.png ├── mustache-add-on-face.py └── utils.py ├── thread_signal.py ├── tic-tac-toe.py ├── tic_tak_toe.py ├── tik_tak.py ├── time_delta.py ├── to check leap year ├── totaldigits.py ├── translation_of_sizes_of_underwear_RU.py ├── triangles.py ├── tuple.py ├── turtal game.ipynb ├── turtle module ├── turtle_shapes_made.py ├── tweeter.py ├── twitter_post_scraper.py ├── two_num.py ├── ultimate-phone-book ├── contacts.py └── readme.md ├── url_shortner.py ├── very_easy └── is_number.py ├── video-operations ├── slow-motion.py └── timelapse.py ├── videodownloder.py ├── vigenere_cipher.py ├── voice.py ├── vowel remover function.py ├── webcam.py ├── whatsapp-monitor.py ├── whatsapp-schedule.py ├── wifi hack by brutefore.py ├── wiki ├── requirements.txt └── wiki.py ├── wiki_random.py ├── wikipedia.py ├── work_connect.py ├── write_excel_file.py └── youtubedownloader.py /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "pip" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.pyc 3 | string=sorted(input()) 4 | lower="" 5 | even="" 6 | odd="" 7 | upper="" 8 | for i in string: 9 | if i.islower(): 10 | lower+=i 11 | elif i.isupper(): 12 | upper+=i 13 | elif int(i)%2==0: 14 | even+=i 15 | else: 16 | odd+=i 17 | print(lower+upper+odd+even) 18 | 19 | .venv 20 | # operating system-related files 21 | 22 | # file properties cache/storage on macOS 23 | *.DS_Store 24 | 25 | # thumbnail cache on Windows 26 | Thumbs.db 27 | -------------------------------------------------------------------------------- /1 File handle/File handle binary/Deleting record in a binary file.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | 3 | 4 | def bdelete(): 5 | # Opening a file & loading it 6 | with open("studrec.dat","rb") as F: 7 | stud = pickle.load(F) 8 | print(stud) 9 | 10 | # Deleting the Roll no. entered by user 11 | rno = int(input("Enter the Roll no. to be deleted: ")) 12 | with open("studrec.dat","wb") as F: 13 | rec = [i for i in stud if i[0] != rno] 14 | pickle.dump(rec, F) 15 | 16 | 17 | bdelete() 18 | -------------------------------------------------------------------------------- /1 File handle/File handle binary/File handle binary read (record in non list form).py: -------------------------------------------------------------------------------- 1 | import pickle 2 | 3 | 4 | def binary_read(): 5 | with open("studrec.dat","rb") as b: 6 | stud = pickle.load(b) 7 | print(stud) 8 | 9 | # prints the whole record in nested list format 10 | print("contents of binary file") 11 | 12 | for ch in stud: 13 | 14 | print(ch) # prints one of the chosen rec in list 15 | 16 | rno = ch[0] 17 | rname = ch[1] # due to unpacking the val not printed in list format 18 | rmark = ch[2] 19 | 20 | print(rno, rname, rmark, end="\t") 21 | 22 | 23 | binary_read() 24 | -------------------------------------------------------------------------------- /1 File handle/File handle binary/Update a binary file.py: -------------------------------------------------------------------------------- 1 | # Updating records in a binary file 2 | 3 | import pickle 4 | 5 | 6 | def update(): 7 | with open("class.dat", "rb+") as F: 8 | S = pickle.load(F) 9 | found = False 10 | rno = int(input("enter the roll number you want to update")) 11 | 12 | for i in S: 13 | if rno == i[0]: 14 | print(f"the currrent name is {i[1]}") 15 | i[1] = input("enter the new name") 16 | found = True 17 | break 18 | 19 | if found: 20 | print("Record not found") 21 | 22 | else: 23 | F.seek(0) 24 | pickle.dump(S, F) 25 | 26 | 27 | update() 28 | 29 | with open("class.dat", "rb") as F: 30 | print(pickle.load(F)) 31 | -------------------------------------------------------------------------------- /1 File handle/File handle binary/class.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/1 File handle/File handle binary/class.dat -------------------------------------------------------------------------------- /1 File handle/File handle binary/search record in binary file.py: -------------------------------------------------------------------------------- 1 | # binary file to search a given record 2 | 3 | import pickle 4 | 5 | 6 | def binary_search(): 7 | with open("studrec.dat", "rb") as F: 8 | # your file path will be different 9 | search = 0 10 | rno = int(input("Enter the roll number of the student")) 11 | 12 | for i in pickle.load(F): 13 | if i[0] == rno: 14 | print(f"Record found successfully\n{i}") 15 | search = 1 16 | 17 | if search == 0: 18 | print("Sorry! record not found") 19 | 20 | 21 | binary_search() 22 | -------------------------------------------------------------------------------- /1 File handle/File handle binary/studrec.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/1 File handle/File handle binary/studrec.dat -------------------------------------------------------------------------------- /1 File handle/File handle text/happy.txt: -------------------------------------------------------------------------------- 1 | hello how are you 2 | what is your name 3 | do not worry everything is alright 4 | everything will be alright 5 | please don't lose hope 6 | Wonders are on the way 7 | Take a walk in the park 8 | At the end of the day you are more important than anything else. 9 | Many moments of happiness are waiting 10 | You are amazing! 11 | If you truly believe. -------------------------------------------------------------------------------- /1 File handle/File handle text/input,output and error streams.py: -------------------------------------------------------------------------------- 1 | # practicing with streams 2 | import sys 3 | 4 | sys.stdout.write("Enter the name of the file") 5 | file = sys.stdin.readline() 6 | 7 | with open(file.strip(), ) as F: 8 | 9 | while True: 10 | ch = F.readlines() 11 | for (i) in ch: # ch is the whole file,for i in ch gives lines, for j in i gives letters,for j in i.split gives words 12 | print(i, end="") 13 | else: 14 | sys.stderr.write("End of file reached") 15 | break 16 | 17 | -------------------------------------------------------------------------------- /1 File handle/File handle text/question 6.py: -------------------------------------------------------------------------------- 1 | """Write a function in python to count the number of lowercase 2 | alphabets present in a text file “happy.txt”""" 3 | 4 | from counter import Counter 5 | 6 | def lowercase(): 7 | 8 | with open("happy.txt") as F: 9 | word_counter = Counter(F.read()) 10 | 11 | print(f"The total number of lower case letters are {word_counter.get_total_lower()}") 12 | print(f"The total number of upper case letters are {word_counter.get_total_upper()}") 13 | print(f"The total number of letters are {word_counter.get_total()}") 14 | 15 | if __name__ == "__main__": 16 | lowercase() 17 | -------------------------------------------------------------------------------- /1 File handle/File handle text/special symbol after word.py: -------------------------------------------------------------------------------- 1 | with open("happy.txt", "r") as F: 2 | # method 1 3 | for i in F.read().split(): 4 | print(i, "*", end="") 5 | print("\n") 6 | 7 | # method 2 8 | F.seek(0) 9 | for line in F.readlines(): 10 | for word in line.split(): 11 | print(word, "*", end="") 12 | -------------------------------------------------------------------------------- /1 File handle/File handle text/story.txt: -------------------------------------------------------------------------------- 1 | once upon a time there was a king. 2 | he was powerful and happy. 3 | he 4 | all the flowers in his garden were beautiful. 5 | he lived happily ever after. -------------------------------------------------------------------------------- /AI Game/Tic-Tac-Toe-AI/tic tac: -------------------------------------------------------------------------------- 1 | hii 2 | -------------------------------------------------------------------------------- /AREA OF TRIANGLE.py: -------------------------------------------------------------------------------- 1 | # Python Program to find the area of triangle 2 | # calculates area of traingle in efficient way!! 3 | a = 5 4 | b = 6 5 | c = 7 6 | 7 | # Uncomment below to take inputs from the user 8 | # a = float(input('Enter first side: ')) 9 | # b = float(input('Enter second side: ')) 10 | # c = float(input('Enter third side: ')) 11 | 12 | # calculate the semi-perimeter 13 | s = (a + b + c) / 2 14 | 15 | # calculate the area 16 | area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 17 | print("The area of the triangle is %0.2f" % area) 18 | -------------------------------------------------------------------------------- /ARKA.py: -------------------------------------------------------------------------------- 1 | def sumOfSeries(n): 2 | x = n * (n + 1) / 2 3 | return (int)(x * x) 4 | 5 | 6 | # Driver Function 7 | n = 5 8 | print(sumOfSeries(n)) 9 | -------------------------------------------------------------------------------- /ASCIIvaluecharacter.py: -------------------------------------------------------------------------------- 1 | # Program to find the ASCII value of the given character 2 | 3 | c = "p" 4 | print("The ASCII value of '" + c + "' is", ord(c)) 5 | -------------------------------------------------------------------------------- /AreaOfTriangle.py: -------------------------------------------------------------------------------- 1 | # Python Program to find the area of triangle when all three side-lengths are known! 2 | 3 | a = 5 4 | b = 6 5 | c = 7 6 | 7 | # Uncomment below to take inputs from the user 8 | # a = float(input('Enter first side: ')) 9 | # b = float(input('Enter second side: ')) 10 | # c = float(input('Enter third side: ')) 11 | 12 | # calculate the semi-perimeter 13 | s = (a + b + c) / 2 14 | 15 | # calculate the area 16 | area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 17 | print("The area of the triangle is: " + area) 18 | -------------------------------------------------------------------------------- /Armstrong_number: -------------------------------------------------------------------------------- 1 | def is_armstrong_number(number): 2 | numberstr = str(number) 3 | length = len(numberstr) 4 | num = number 5 | rev = 0 6 | temp = 0 7 | while num != 0: 8 | rem = num % 10 9 | num //= 10 10 | temp += rem ** length 11 | return temp == number 12 | 13 | is_armstrong_number(5) 14 | -------------------------------------------------------------------------------- /Assembler/README.md: -------------------------------------------------------------------------------- 1 | # hy your name 2 | # Python-Assembler 3 | # WE need A FREE T-SHIRT 4 | This program is a simple assembler-like (intel-syntax) interpreter language. The program is written in python 3. 5 | To start the program you will need to type 6 | 7 | ``` python assembler.py code.txt ``` 8 | 9 | 10 | After you hit 'enter' the program will interpret the source-code in 'code.txt'. 11 | You can use many textfiles as input. These will be interpreted one by one. 12 | 13 | You can find some examples in the directory 'examples'. 14 | 15 | For instance- 16 | 17 | ``` 18 | $msg db "hello world" 19 | 20 | mov ecx, $msg 21 | mov eax, 4 22 | int 0x80 23 | mov eax, 1 24 | mov ebx, 0 25 | int 0x80 26 | ``` 27 | 28 | Will print onto console 29 | 30 | ``` 31 | hello world 32 | END PROGRAM 33 | ``` 34 | 35 | **Refer to GUIDE.txt to read a guide** 36 | -------------------------------------------------------------------------------- /Assembler/examples/code.txt: -------------------------------------------------------------------------------- 1 | ; begin program 2 | ; variable section 3 | $var1 db 56 4 | $var2 db 44 5 | mov ecx, $var1 6 | push ecx 7 | mov eax, 3 8 | int 0x80 9 | pop eax 10 | add ecx, ebx 11 | add ecx, eax 12 | mov eax, 4 13 | int 0x80 14 | 15 | 16 | -------------------------------------------------------------------------------- /Assembler/examples/code2.txt: -------------------------------------------------------------------------------- 1 | $msg db "hello world" 2 | 3 | mov ecx, $msg 4 | mov eax, 4 5 | int 0x80 6 | mov eax, 1 7 | mov ebx, 0 8 | int 0x80 9 | -------------------------------------------------------------------------------- /Assembler/examples/code3.txt: -------------------------------------------------------------------------------- 1 | 2 | mov ecx, 5 3 | call _double 4 | call _cube 5 | call _inc 6 | mov eax, 4 7 | int 0x80 8 | mov eax, 1 9 | mov ebx, 0 10 | int 0x80 11 | 12 | 13 | 14 | _double: 15 | add ecx, ecx 16 | ret 17 | 18 | _cube: 19 | push eax 20 | mov eax, ecx 21 | add ecx, eax 22 | add ecx, eax 23 | pop eax 24 | ret 25 | 26 | _inc: 27 | add ecx, 1 28 | ret 29 | -------------------------------------------------------------------------------- /Assembler/examples/code4.txt: -------------------------------------------------------------------------------- 1 | mov eax, 8 2 | mov ebx, 2 3 | mul ebx 4 | mov ecx, eax 5 | mov eax, 4 6 | int 0x80 7 | 8 | mov eax, 8 9 | mov ebx, 2 10 | div ebx 11 | mov ecx, eax 12 | mov eax, 4 13 | int 0x80 14 | 15 | -------------------------------------------------------------------------------- /Assembler/examples/klmn: -------------------------------------------------------------------------------- 1 | Assembler/examples/code2.txt 2 | hello world 3 | -------------------------------------------------------------------------------- /Assembler/examples/test.txt: -------------------------------------------------------------------------------- 1 | 2 | ; variables 3 | VAR1 db 56 4 | $var1 db 10 5 | 6 | mov ecx, VAR1 7 | mov ebx, $var1 8 | sub ecx, ebx 9 | mov eax, 4 10 | int 0x80 -------------------------------------------------------------------------------- /Assembler/requirements.txt: -------------------------------------------------------------------------------- 1 | print_function 2 | sys 3 | -------------------------------------------------------------------------------- /Automated Scheduled Call Reminders/requirements.txt: -------------------------------------------------------------------------------- 1 | BlockingScheduler 2 | search 3 | os 4 | time 5 | gmtime 6 | strftime 7 | Client 8 | twilio 9 | datetime 10 | timedelta 11 | credentials 12 | firestore 13 | initialize_app 14 | -------------------------------------------------------------------------------- /Automated Scheduled Call Reminders/schedular.py: -------------------------------------------------------------------------------- 1 | # schedular code for blocking schedular as we have only 1 process to run 2 | 3 | from apscheduler.schedulers.blocking import BlockingScheduler 4 | 5 | from caller import search 6 | 7 | 8 | sched = BlockingScheduler() 9 | 10 | # Schedule job_function to be called every two hours 11 | sched.add_job(search, "interval", hours=1) # for testing instead add hours =1 12 | 13 | sched.start() 14 | -------------------------------------------------------------------------------- /Battery_notifier.py: -------------------------------------------------------------------------------- 1 | from plyer import notification # pip install plyer 2 | import psutil # pip install psutil 3 | 4 | # psutil.sensors_battery() will return the information related to battery 5 | battery = psutil.sensors_battery() 6 | 7 | # battery percent will return the current battery prcentage 8 | percent = battery.percent 9 | charging = ( 10 | battery.power_plugged 11 | ) 12 | 13 | # Notification(title, description, duration)--to send 14 | # notification to desktop 15 | # help(Notification) 16 | if charging: 17 | if percent == 100: 18 | charging_message = "Unplug your Charger" 19 | else: 20 | charging_message = "Charging" 21 | else: 22 | charging_message = "Not Charging" 23 | message = str(percent) + "% Charged\n" + charging_message 24 | 25 | notification.notify("Battery Information", message, timeout=10) 26 | -------------------------------------------------------------------------------- /Binary Coefficients.py: -------------------------------------------------------------------------------- 1 | def pascal_triangle(lineNumber): 2 | list1 = list() 3 | list1.append([1]) 4 | i = 1 5 | while i <= lineNumber: 6 | j = 1 7 | l = [] 8 | l.append(1) 9 | while j < i: 10 | l.append(list1[i - 1][j] + list1[i - 1][j - 1]) 11 | j = j + 1 12 | l.append(1) 13 | list1.append(l) 14 | i = i + 1 15 | return list1 16 | 17 | 18 | def binomial_coef(n, k): 19 | pascalTriangle = pascal_triangle(n) 20 | return pascalTriangle[n][k - 1] 21 | -------------------------------------------------------------------------------- /Binary_to_Decimal.py: -------------------------------------------------------------------------------- 1 | # Program to convert binary to decimal 2 | 3 | 4 | def binaryToDecimal(binary): 5 | """ 6 | >>> binaryToDecimal(111110000) 7 | 496 8 | >>> binaryToDecimal(10100) 9 | 20 10 | >>> binaryToDecimal(101011) 11 | 43 12 | """ 13 | decimal, i, n = 0, 0, 0 14 | while binary != 0: 15 | dec = binary % 10 16 | decimal = decimal + dec * pow(2, i) 17 | binary = binary // 10 18 | i += 1 19 | print(decimal) 20 | 21 | 22 | binaryToDecimal(100) 23 | -------------------------------------------------------------------------------- /BlackJack_game/requirements.txt: -------------------------------------------------------------------------------- 1 | time 2 | random 3 | -------------------------------------------------------------------------------- /CSV_file.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | # loading the dataset 4 | 5 | df= pd.read_csv(r"c:\PROJECT\Drug_Recommendation_System\drug_recommendation_system\Drugs_Review_Datasets.csv") 6 | 7 | print(df) #prints Dataset 8 | # funtions 9 | print(df.tail()) 10 | print(df.head()) 11 | print(df.info()) 12 | print(df.describe()) 13 | print(df.column) 14 | print(df.shape()) -------------------------------------------------------------------------------- /Calculate resistance.py: -------------------------------------------------------------------------------- 1 | def res(R1, R2): 2 | sum = R1 + R2 3 | if option =="series": 4 | return sum 5 | elif option =="parallel" : 6 | return (R1 * R2)/sum 7 | return 0 8 | Resistance1 = int(input("Enter R1 : ")) 9 | Resistance2 = int(input("Enter R2 : ")) 10 | option = input("Enter series or parallel :") 11 | print("\n") 12 | R = res(Resistance1,Resistance2 ) 13 | if R==0: 14 | print('Wrong Input!!' ) 15 | else: 16 | print("The total resistance is", R) 17 | -------------------------------------------------------------------------------- /Cat/text_a.txt: -------------------------------------------------------------------------------- 1 | Sample Text Here 2 | 3 | Lorem ipsum, dolor sit amet. 4 | Hello, 5 | World! 6 | 7 | ABCD 1234 8 | -------------------------------------------------------------------------------- /Cat/text_b.txt: -------------------------------------------------------------------------------- 1 | I am another sample text file. 2 | 3 | The knights who say ni! 4 | 5 | Lines 6 | of 7 | Text! 8 | This file does not end with a newline. -------------------------------------------------------------------------------- /Cat/text_c.txt: -------------------------------------------------------------------------------- 1 | I am the beginning of yet another text file. 2 | 3 | Spam and eggs. 4 | -------------------------------------------------------------------------------- /Checker_game_by_dz/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Checker_game_by_dz/__init__.py -------------------------------------------------------------------------------- /Checker_game_by_dz/assets/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Checker_game_by_dz/assets/crown.png -------------------------------------------------------------------------------- /Checker_game_by_dz/modules/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Auhtor : Dhruv B Kakadiya 3 | 4 | """ 5 | -------------------------------------------------------------------------------- /Checker_game_by_dz/modules/statics.py: -------------------------------------------------------------------------------- 1 | """ 2 | Author : Dhruv B Kakadiya 3 | 4 | """ 5 | 6 | import pygame as pg 7 | 8 | # size of board 9 | width, height = 800, 800 10 | rows, cols = 8, 8 11 | sq_size = width // cols 12 | 13 | # colours for board 14 | yellow = (255, 255, 0) 15 | white = (255, 255, 255) 16 | green = (0, 255, 0) 17 | gray = (128, 128, 128) 18 | red = (255, 0, 0) 19 | 20 | # colour for for next move 21 | black = (0, 0, 0) 22 | 23 | crown = pg.transform.scale(pg.image.load("assets/crown.png"), (45, 25)) 24 | -------------------------------------------------------------------------------- /CliYoutubeDownloader/requirements.txt: -------------------------------------------------------------------------------- 1 | pytubefix 2 | -------------------------------------------------------------------------------- /Colors/print_colors.py: -------------------------------------------------------------------------------- 1 | import sys 2 | class colors: 3 | CYAN = "\033[36m" 4 | GREEN = "\033[32m" 5 | YELLOW = "\033[33m" 6 | BLUE = "\033[34m" 7 | RED = "\033[31m" 8 | ENDC = "\033[0m" 9 | def printc(color, message): 10 | print(color + message + colors.ENDC) 11 | printc(colors.CYAN, sys.argv[1]) 12 | printc(colors.GREEN, sys.argv[1]) 13 | printc(colors.YELLOW, sys.argv[1]) 14 | printc(colors.BLUE, sys.argv[1]) 15 | printc(colors.RED, sys.argv[1]) 16 | -------------------------------------------------------------------------------- /Compression_Analysis/compressed_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Compression_Analysis/compressed_image.png -------------------------------------------------------------------------------- /Compression_Analysis/example_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Compression_Analysis/example_image.jpg -------------------------------------------------------------------------------- /Compression_Analysis/orignal_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Compression_Analysis/orignal_image.png -------------------------------------------------------------------------------- /CountMillionCharacters-2.0.py: -------------------------------------------------------------------------------- 1 | """Get the number of each character in any given text. 2 | Inputs: 3 | A txt file -- You will be asked for an input file. Simply input the name 4 | of the txt file in which you have the desired text. 5 | """ 6 | 7 | import collections 8 | import pprint 9 | 10 | 11 | def main(): 12 | file_input = input("File Name: ") 13 | try: 14 | with open(file_input, "r") as info: 15 | count = collections.Counter(info.read().upper()) 16 | except FileNotFoundError: 17 | print("Please enter a valid file name.") 18 | main() 19 | 20 | value = pprint.pformat(count) 21 | print(value) 22 | exit() 23 | 24 | 25 | if __name__ == "__main__": 26 | main() 27 | -------------------------------------------------------------------------------- /Crack_password.py: -------------------------------------------------------------------------------- 1 | from random import * 2 | user_pass = input("Enter your password: ") 3 | password = ['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',"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"] 4 | guess = "" 5 | while (guess != user_pass): 6 | guess = "" 7 | for letter in range(len(user_pass)): 8 | guess_letter = password[randint(0, 51)] 9 | guess = str(guess_letter) + str(guess) 10 | print(guess) 11 | print("Your password is",guess) 12 | -------------------------------------------------------------------------------- /Decimal number to binary function.py: -------------------------------------------------------------------------------- 1 | # decimal number 2 | number = int(input("Enter any decimal number: ")) 3 | 4 | # print equivalent binary number 5 | print("Equivalent Binary Number: ", bin(number)) 6 | -------------------------------------------------------------------------------- /Dictionary opperations (input,update a dict).py: -------------------------------------------------------------------------------- 1 | # Update the value of dictionary written by the user... 2 | 3 | print("Dictinary opperations") 4 | 5 | 6 | def Dictionary(Dict, key, value): 7 | print("Original dictionary", Dict) 8 | Dict[key] = value 9 | print("Updated dictionary", Dict) 10 | 11 | 12 | d = eval(input("Enter the dictionary")) 13 | print("Dictionary", d, "\n") 14 | 15 | k = input("Enter the key to be updated") 16 | if k in d.keys(): 17 | v = input("Enter the updated value") 18 | Dictionary(d, k, v) 19 | 20 | else: 21 | print("Key not found") 22 | -------------------------------------------------------------------------------- /Differentiate_List.py: -------------------------------------------------------------------------------- 1 | # this code gives the numbers of integers, floats, and strings present in the list 2 | 3 | 4 | a = ["Hello", 35, "b", 45.5, "world", 60] 5 | i = f = s = 0 6 | for j in a: 7 | if isinstance(j, int): 8 | i = i + 1 9 | elif isinstance(j, float): 10 | f = f + 1 11 | else: 12 | s = s + 1 13 | print(f"Number of integers are: {i}") 14 | print(f"Number of Floats are: {f}") 15 | print(f"numbers of strings are: {s}") 16 | -------------------------------------------------------------------------------- /Downloaded Files Organizer/browser_status.py: -------------------------------------------------------------------------------- 1 | import psutil 2 | from obs import watcher 3 | 4 | browsers = ["chrome.exe", "firefox.exe", "edge.exe", "iexplore.exe"] 5 | 6 | # ADD DOWNLOADS PATH HERE::: r is for raw string enter the path 7 | # Example: path_to_watch=r"C:\Users\Xyz\Downloads" 8 | # find downloads path . 9 | 10 | 11 | path_to_watch = r" " 12 | 13 | 14 | for browser in browsers: 15 | while browser in (process.name() for process in psutil.process_iter()): 16 | watcher(path_to_watch) 17 | -------------------------------------------------------------------------------- /Downloaded Files Organizer/obs.py: -------------------------------------------------------------------------------- 1 | def watcher(path): 2 | # python script to observe changes in a folder 3 | import sys 4 | import time 5 | import os 6 | from watchdog.observers import Observer 7 | from watchdog.events import FileSystemEventHandler 8 | from move_to_directory import add_to_dir 9 | 10 | class Handler(FileSystemEventHandler): 11 | def on_created(self, event): 12 | if event.event_type == "created": 13 | file_name = os.path.basename(event.src_path) 14 | ext = os.path.splitext(event.src_path)[1] 15 | time.sleep(2) 16 | add_to_dir(ext[1:], event.src_path, path) 17 | observer.stop() 18 | 19 | observer = Observer() 20 | event_handler = Handler() 21 | observer.schedule(event_handler, path, recursive=True) 22 | observer.start() 23 | observer.join() 24 | -------------------------------------------------------------------------------- /Downloaded Files Organizer/readme.md: -------------------------------------------------------------------------------- 1 | # Downloaded files organizer using python 2 | ##### Operating System : Windows Only 3 | ### Modules used 4 | 1.Built-in Modules: 5 | sys,os,time 6 | 2.External Modules: 7 | download the following modules using pip: 8 | psutil,watchdog 9 | ### How to use 10 | 1.After installing above modules,run browser_status.py.In browser_status.py makesure correct download path is given in this script. 11 | 2.Make sure that all the three python scripts reside in same directory 12 | 13 | ### Working 14 | Whenever a file is downloaded,when this script is running ,it automatically categorize the file based on the file extension 15 | For example, if a python script is downloaded which has ".py" extension, it goes into "code" folder automatically. 16 | 17 | The file extensions and categories are collected from 18 | https://github.com/dyne/file-extension-list 19 | -------------------------------------------------------------------------------- /Downloaded Files Organizer/requirements.txt: -------------------------------------------------------------------------------- 1 | sys 2 | os 3 | time 4 | psutil 5 | watchdog 6 | -------------------------------------------------------------------------------- /Droplistmenu/README.md: -------------------------------------------------------------------------------- 1 | The code is to show using tkinter GUI to creat droplist and calender, and using .place() manage the positions. 2 | -------------------------------------------------------------------------------- /Electronics_Algorithms/Ohms_law.py: -------------------------------------------------------------------------------- 1 | def ohms_law(v=0, i=0, r=0): 2 | if v == 0: 3 | result = i * r 4 | return result 5 | elif i == 0: 6 | result = v / r 7 | return result 8 | elif r == 0: 9 | result = v / i 10 | return result 11 | else: 12 | return 0 13 | -------------------------------------------------------------------------------- /Email-Automation.py: -------------------------------------------------------------------------------- 1 | import smtplib 2 | from email.mime.multipart import MIMEMultipart 3 | from email.mime.text import MIMEText 4 | 5 | fro_add = "dilipvijjapu@gmail.com" 6 | to_add = "vijjapudilip@gmail.com" 7 | 8 | message = MIMEMultipart() 9 | message["From"] = fro_add 10 | message["To"] = ",".join(to_add) 11 | message["subject"] = "Testinf mail" 12 | 13 | body = "Hai this is dilip ,How are you" 14 | 15 | message.attach(MIMEText(body, "plain")) 16 | 17 | email = " " 18 | password = " " 19 | 20 | mail = smtplib.SMTP("smtp.gmail.com", 587) 21 | mail.ehlo() 22 | mail.starttls() 23 | mail.login(email, password) 24 | text = message.as_string() 25 | mail.sendmail(fro_add, to_add, text) 26 | mail.quit() 27 | -------------------------------------------------------------------------------- /Emoji Dictionary/Images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/1.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/2.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/3.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/4.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/5.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/6.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/7.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/8.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/Images/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Emoji Dictionary/Images/9.jpg -------------------------------------------------------------------------------- /Emoji Dictionary/requirements.txt: -------------------------------------------------------------------------------- 1 | tkinter 2 | messagebox 3 | emoji 4 | -------------------------------------------------------------------------------- /Encryption using base64.py: -------------------------------------------------------------------------------- 1 | import base64 2 | #Encryption 3 | message = input() 4 | message_bytes = message.encode('ascii') 5 | base64_bytes = base64.b64encode(message_bytes) 6 | base64_message = base64_bytes.decode('ascii') 7 | print(base64_message) 8 | 9 | #Decryption 10 | base64_bytes = base64_message.encode('ascii') 11 | message_bytes = base64.b64decode(base64_bytes) 12 | message = message_bytes.decode('ascii') 13 | 14 | print(message) 15 | -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child1/Document_Child1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child1/Document_Child1.docx -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child1/Pdf1_Child1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child1/Pdf1_Child1.pdf -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child1/Pdf2_Child2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child1/Pdf2_Child2.pdf -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child1/Text_Child1.txt: -------------------------------------------------------------------------------- 1 | AB,DF,G,DF,SDF,ADA,QW,WE,ER,FD 2,45,56,7,8,9,65,3,5436,78 12,34,345,667,56,5657,768,45,46,67 67,89,8,9,89,8,78,9,67,67 1,23,4,5,65,76,8,6,45,67 -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child2/Document_Child2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child2/Document_Child2.docx -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child2/Pdf1_Child2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child2/Pdf1_Child2.pdf -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child2/Pdf2_Child2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child2/Pdf2_Child2.pdf -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child2/Text_Child2.txt: -------------------------------------------------------------------------------- 1 | AC,DXFC,GB,DCF,SCDF,BADA,QB,W,R,F,C 2,45,56,7,8,9,65,3,5436,78,34 12,34,345,667,56,5657,768,45,46,67,34 67,89,8,9,89,8,78,9,67,67,43 1,23,4,5,65,76,8,6,45,67,61 -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child3/Document_Child3.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child3/Document_Child3.docx -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child3/Pdf1_Child3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child3/Pdf1_Child3.pdf -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child3/Pdf2_Child3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Extract-Table-from-pdf-txt-docx/Parent/Child3/Pdf2_Child3.pdf -------------------------------------------------------------------------------- /Extract-Table-from-pdf-txt-docx/Parent/Child3/Text_Child3.txt: -------------------------------------------------------------------------------- 1 | AF,FC,GFB,DW,SF,BA,Q,WS,RR,FR,CW 2,45,56,7,8,9,65,3,5436,78,34 12,34,345,667,56,5657,768,45,46,67,34 67,89,8,9,89,8,78,9,67,67,43 1,23,4,5,65,76,8,6,45,67,61 -------------------------------------------------------------------------------- /Extract_Text_from_image.py: -------------------------------------------------------------------------------- 1 | # extract text from a img and its coordinates using the pytesseract module 2 | import cv2 3 | import pytesseract 4 | 5 | # You need to add tesseract binary dependency to system variable for this to work 6 | 7 | img = cv2.imread("img.png") 8 | # We need to convert the img into RGB format 9 | img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) 10 | 11 | hI, wI, k = img.shape 12 | print(pytesseract.image_to_string(img)) 13 | boxes = pytesseract.image_to_boxes(img) 14 | for b in boxes.splitlines(): 15 | b = b.split(" ") 16 | x, y, w, h = int(b[1]), int(b[2]), int(b[3]), int(b[4]) 17 | cv2.rectangle(img, (x, hI - y), (w, hI - h), (0, 0, 255), 0.2) 18 | 19 | cv2.imshow("img", img) 20 | cv2.waitKey(0) 21 | -------------------------------------------------------------------------------- /FIND FACTORIAL OF A NUMBER.py: -------------------------------------------------------------------------------- 1 | # Python program to find the factorial of a number provided by the user. 2 | 3 | def factorial(n): 4 | if n < 0: # factorial of number less than 0 is not possible 5 | return "Oops!Factorial Not Possible" 6 | elif n == 0: # 0! = 1; when n=0 it returns 1 to the function which is calling it previously. 7 | return 1 8 | else: 9 | return n*factorial(n-1) 10 | #Recursive function. At every iteration "n" is getting reduced by 1 until the "n" is equal to 0. 11 | 12 | n = int(input("Enter a number: ")) # asks the user for input 13 | print(factorial(n)) # function call 14 | -------------------------------------------------------------------------------- /Face_Mask_detection (haarcascade)/Resources/keras_model.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Face_Mask_detection (haarcascade)/Resources/keras_model.h5 -------------------------------------------------------------------------------- /FibonacciNumbersWithGenerators.py: -------------------------------------------------------------------------------- 1 | def fibonacci_generator(n = None): 2 | """ 3 | Generating function up to n fibonacci numbers iteratively 4 | Params: 5 | n: int 6 | Return: 7 | int 8 | """ 9 | f0, f1 = 0, 1 10 | yield f1 11 | while n == None or n > 1: 12 | fn = f0 + f1 13 | yield fn 14 | f0, f1 = f1, fn 15 | n -= 1 16 | 17 | for n_fibo in fibonacci_generator(7): 18 | print(n_fibo) 19 | -------------------------------------------------------------------------------- /Fibonacci_sequence_recursive_sol.py: -------------------------------------------------------------------------------- 1 | def fib(term): 2 | if term <= 1: 3 | return term 4 | else: 5 | return fib(term - 1) + fib(term - 2) 6 | 7 | 8 | # Change this value to adjust the number of terms in the sequence. 9 | number_of_terms = int(input()) 10 | for i in range(number_of_terms): 11 | print(fib(i)) 12 | -------------------------------------------------------------------------------- /FindingResolutionOfAnImage.py: -------------------------------------------------------------------------------- 1 | def jpeg_res(filename): 2 | """"This function prints the resolution of the jpeg image file passed into it""" 3 | 4 | # open image for reading in binary mode 5 | with open(filename,'rb') as img_file: 6 | 7 | # height of image (in 2 bytes) is at 164th position 8 | img_file.seek(163) 9 | 10 | # read the 2 bytes 11 | a = img_file.read(2) 12 | 13 | # calculate height 14 | height = (a[0] << 8) + a[1] 15 | 16 | # next 2 bytes is width 17 | a = img_file.read(2) 18 | 19 | # calculate width 20 | width = (a[0] << 8) + a[1] 21 | 22 | print("The resolution of the image is",width,"x",height) 23 | 24 | jpeg_res("img1.jpg") 25 | -------------------------------------------------------------------------------- /FizzBuzz.py: -------------------------------------------------------------------------------- 1 | # FizzBuzz 2 | # A program that prints the numbers from 1 to num (User given number)! 3 | # For multiples of ‘3’ print “Fizz” instead of the number. 4 | # For the multiples of ‘5’ print “Buzz”. 5 | # If the number is divisible by both 3 and 5 then print "FizzBuzz". 6 | # If none of the given conditions are true then just print the number! 7 | 8 | 9 | def FizzBuzz(num): 10 | for i in range(1, num + 1): 11 | if i % 3 == 0 and i % 5 == 0: 12 | print("FizzBuzz") 13 | elif i % 3 == 0: 14 | print("Fizz") 15 | elif i % 5 == 0: 16 | print("Buzz") 17 | else: 18 | print(i) 19 | 20 | 21 | 22 | FizzBuzz(20) # prints FizzBuzz up to 20 23 | -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/.gitignore: -------------------------------------------------------------------------------- 1 | Data -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/background.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/bird.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/exit_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/exit_button.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/original_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/original_background.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/scoreboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/scoreboard.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/start_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/start_button.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/title.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/tube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/tube.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/Images/tube_mouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Flappy Bird - created with tkinter/Images/tube_mouth.png -------------------------------------------------------------------------------- /Flappy Bird - created with tkinter/README.md: -------------------------------------------------------------------------------- 1 | # Description: 2 | This is a simple game created with tkinter.
3 | Enjoy and do give feedback
4 | Warning: If the game is too slow, lower the game resolution in Data/settings.json 5 | 6 | # Requirements: 7 | Tkinter 8 | ```bash 9 | pip install tkinter 10 | ``` 11 | PIL
12 | Python 3.x 13 | -------------------------------------------------------------------------------- /Generate a random number between 0 to 9.py: -------------------------------------------------------------------------------- 1 | # Program to generate a random number between 0 and 9 2 | 3 | # importing the random module 4 | import random 5 | 6 | print(random.randint(0,9)) 7 | -------------------------------------------------------------------------------- /HTML_to_PDF/output.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/HTML_to_PDF/output.pdf -------------------------------------------------------------------------------- /Hand-Motion-Detection/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy==2.2.3 2 | opencv_python==4.11.0.86 3 | mediapipe==0.10.21 4 | -------------------------------------------------------------------------------- /Image-watermarker/fonts/AkayaKanadaka.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Image-watermarker/fonts/AkayaKanadaka.ttf -------------------------------------------------------------------------------- /Image-watermarker/fonts/DancingScript.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Image-watermarker/fonts/DancingScript.ttf -------------------------------------------------------------------------------- /Image-watermarker/fonts/Decorative.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Image-watermarker/fonts/Decorative.ttf -------------------------------------------------------------------------------- /Image-watermarker/fonts/MartianMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Image-watermarker/fonts/MartianMono.ttf -------------------------------------------------------------------------------- /Image-watermarker/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Image-watermarker/requirements.txt -------------------------------------------------------------------------------- /ImageDownloader/img_downloader.py: -------------------------------------------------------------------------------- 1 | # ImageDownloader - Muhammed Shokr its amazing 2 | 3 | 4 | def ImageDownloader(url): 5 | import os, re, requests 6 | 7 | response = requests.get(url) 8 | text = response.text 9 | 10 | p = r']+>' 11 | img_addrs = re.findall(p, text) 12 | 13 | for i in img_addrs: 14 | os.system("wget {}".format(i)) 15 | 16 | return "DONE" 17 | 18 | 19 | # USAGE 20 | print("Hey!! Welcome to the Image downloader...") 21 | link=input("Please enter the url from where you want to download the image..") 22 | # now you can give the input at run time and get download the images. 23 | # https://www.123rf.com/stock-photo/spring_color.html?oriSearch=spring&ch=spring&sti=oazo8ueuz074cdpc48 24 | ImageDownloader(link) 25 | -------------------------------------------------------------------------------- /ImageDownloader/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.32.3 2 | -------------------------------------------------------------------------------- /Image_resize.py: -------------------------------------------------------------------------------- 1 | def jpeg_res(filename): 2 | """"This function prints the resolution of the jpeg image file passed into it""" 3 | 4 | # open image for reading in binary mode 5 | with open(filename,'rb') as img_file: 6 | 7 | # height of image (in 2 bytes) is at 164th position 8 | img_file.seek(163) 9 | 10 | # read the 2 bytes 11 | a = img_file.read(2) 12 | 13 | # calculate height 14 | height = (a[0] << 8) + a[1] 15 | 16 | # next 2 bytes is width 17 | a = img_file.read(2) 18 | 19 | # calculate width 20 | width = (a[0] << 8) + a[1] 21 | 22 | print("The resolution of the image is",width,"x",height) 23 | 24 | jpeg_res("img1.jpg") 25 | -------------------------------------------------------------------------------- /Industrial_developed_hangman/Data/text_images.txt: -------------------------------------------------------------------------------- 1 | ╔══╗─╔╗╔╗╔══╗╔═══╗─╔══╗╔╗╔╗╔╗╔╗╔══╗ 2 | ║╔╗║─║║║║║╔═╝║╔══╝─║╔╗║║║║║║║║║║╔╗║ 3 | ║╚╝╚╗║║║║║║──║╚══╗─║║║║║║║║║║║║║╚╝║ 4 | ║╔═╗║║║╔║║║──║╔══╝─║║║║║║╔║║║║║║╔╗║ 5 | ║╚═╝║║╚╝║║╚═╗║╚══╗╔╝║║║║╚╝║║╚╝║║║║║ 6 | ╚═══╝╚══╝╚══╝╚═══╝╚═╝╚╝╚══╝╚══╗╚╝╚╝ 7 | ⡖⠒⢒⣶⠖⠒⠒⠒⡖⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 8 | ⡇⣠⠟⠁⠀⠀⠀⡖⠓⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 9 | ⡿⠉⠀⠀⠀⠀⠀⢹⣞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 10 | ⡇⠀⠀⠀⠀⠀⣠⠻⡟⢧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 11 | ⠀ ⡇⠀⠀⠀⠀⠐⠃⢨⡧⠀⠳⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 12 | ⠀⠀ ⡇⠀⠀⠀⠀⠀⠀⠠⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 13 | ⠀⠀ ⡇⠀⠀⠀⠀⠀⠀⢨⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 14 | ⠀⠀ ⡇⠀⠀⠀⠀⠀⠀⠆⠘⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 15 | ⠀⠀ ⡇⠀⠀⠀⠀⠀⠈⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 16 | ⠀⠀ ⠧⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤ 17 | -------------------------------------------------------------------------------- /Industrial_developed_hangman/Makefile: -------------------------------------------------------------------------------- 1 | lint: 2 | poetry run isort src tests 3 | poetry run flake8 src tests 4 | poetry run mypy src 5 | poetry run mypy tests 6 | 7 | test: 8 | poetry run pytest 9 | 10 | build: 11 | python src/hangman/main.py 12 | install: 13 | pip install poetry 14 | poetry install -------------------------------------------------------------------------------- /Industrial_developed_hangman/README.md: -------------------------------------------------------------------------------- 1 | This is a simple game hangman 2 | 3 | to install dependencies got to repository "Industrial_developed_hangman" by `cd .\Industrial_developed_hangman\` and run `make install` 4 | 5 | to start it use `make build` command 6 | 7 | example of programm run: 8 | 9 | 10 | ![img.png](recorces/img.png) 11 | 12 | also makefile have lint command to lint source code -------------------------------------------------------------------------------- /Industrial_developed_hangman/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | markers = 3 | internet_required: marks tests that requires internet connection (deselect with '-m "not internet_required"') 4 | serial 5 | timeout = 20 6 | -------------------------------------------------------------------------------- /Industrial_developed_hangman/recorces/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Industrial_developed_hangman/recorces/img.png -------------------------------------------------------------------------------- /Industrial_developed_hangman/src/hangman/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Industrial_developed_hangman/src/hangman/__init__.py -------------------------------------------------------------------------------- /Industrial_developed_hangman/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Industrial_developed_hangman/tests/__init__.py -------------------------------------------------------------------------------- /Industrial_developed_hangman/tests/test_hangman/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Industrial_developed_hangman/tests/test_hangman/__init__.py -------------------------------------------------------------------------------- /JARVIS/README.md: -------------------------------------------------------------------------------- 1 | # JARVIS 2 | patch-5
3 | It can Control windows programs with your voice.
4 | What can it do: 5 | 1. It can tell you time.
6 | 2. It can open, These of the following:-
a.) Notepad
7 | b.) Calculator
8 | c.) Sticky Note
9 | d.) PowerShell
10 | e.) MS Paint
11 | f.) cmd
12 | g.) Browser (Internet Explorer)
13 | 14 | It will make your experience better while using the Windows computer. 15 | =========================================================================== 16 | It demonstrates Controlling windows programs with your voice. 17 | -------------------------------------------------------------------------------- /JARVIS/requirements.txt: -------------------------------------------------------------------------------- 1 | datetime 2 | pyjokes 3 | requests 4 | Pillow 5 | Image 6 | ImageGrab 7 | gTTS 8 | keyboard 9 | key 10 | playsound 11 | pyttsx3 12 | SpeechRecognition 13 | openai -------------------------------------------------------------------------------- /Key_Binding/key_binding.py: -------------------------------------------------------------------------------- 1 | from quo.keys import bind 2 | from quo.prompt import Prompt 3 | 4 | session = Prompt() 5 | 6 | @bind.add("ctrl-h") 7 | def _(event): 8 | print("Hello, World") 9 | 10 | session.prompt("") 11 | -------------------------------------------------------------------------------- /Key_Binding/requirement.txt: -------------------------------------------------------------------------------- 1 | quo>=2022.4 2 | -------------------------------------------------------------------------------- /Kilometerstomile.py: -------------------------------------------------------------------------------- 1 | # Taking kilometers input from the user 2 | kilometers = float(input("Enter value in kilometers: ")) 3 | 4 | # conversion factor 5 | conv_fac = 0.621371 6 | 7 | # calculate miles 8 | miles = kilometers * conv_fac 9 | print(f'{kilometers:.2f} kilometers is equal to {miles:.2f} miles') 10 | -------------------------------------------------------------------------------- /Koch Curve/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Koch Curve/README.txt -------------------------------------------------------------------------------- /Koch Curve/output_2.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Koch Curve/output_2.mp4 -------------------------------------------------------------------------------- /LETTER GUESSER: -------------------------------------------------------------------------------- 1 | import random 2 | import string 3 | 4 | ABCS = string.ascii_lowercase 5 | ABCS = list(ABCS) 6 | 7 | play = True 8 | 9 | compChosse = random.choice(ABCS) 10 | 11 | print(":guess the letter (only 10 guesses):") 12 | userInput = input("guess:") 13 | 14 | failed = 10 15 | 16 | while failed > 0: 17 | if userInput == compChosse: 18 | print("---------->") 19 | print("You are correct!") 20 | print("---------->") 21 | print("Your guesses: " + str(10 - failed)) 22 | break 23 | 24 | elif userInput != compChosse: 25 | failed = failed - 1 26 | 27 | print(":no your wrong: " + "left: " + str(failed)) 28 | 29 | userInput = input("guess:") 30 | 31 | if failed == 0: 32 | print("out of guesses") 33 | -------------------------------------------------------------------------------- /List.py: -------------------------------------------------------------------------------- 1 | List = [] 2 | # List is Muteable 3 | # means value can be change 4 | List.insert(0, 5) #insertion takes place at mentioned index 5 | List.insert(1, 10) 6 | List.insert(0, 6) 7 | print(List) 8 | List.remove(6) 9 | List.append(9) #insertion takes place at last 10 | List.append(1) 11 | List.sort() #arranges element in ascending order 12 | print(List) 13 | List.pop() 14 | List.reverse() 15 | print(List) 16 | """ 17 | List.append(1) 18 | print(List) 19 | List.append(2) 20 | print(List) 21 | List.insert(1 , 3) 22 | print(List) 23 | """ 24 | 25 | list2 = [2, 3, 7, 5, 10, 17, 12, 4, 1, 13] 26 | for i in list2: 27 | if i % 2 == 0: 28 | print(i) 29 | """ 30 | Expected Output: 31 | 2 32 | 10 33 | 12 34 | 4 35 | """ 36 | -------------------------------------------------------------------------------- /Multiply.py: -------------------------------------------------------------------------------- 1 | def product(a,b): 2 | if(a>>> mycursor.execute("SQL Query") 11 | mycursor.execute("SELECT column FROM table") 12 | 13 | myresult = mycursor.fetchall() 14 | 15 | for x in myresult: 16 | print(x) 17 | -------------------------------------------------------------------------------- /News_App/README.md: -------------------------------------------------------------------------------- 1 | ## News App 2 | 3 | - I have create News app using python solara framework and yfinace for getting news of stocks. 4 | 5 | Steps to run the app: 6 | 7 | 1. Clone the repositery and go to the `News_App` and Install all the requirements 8 | 9 | ``` 10 | pip install -r requirements.txt 11 | ``` 12 | 13 | 2. Run the solara app 14 | 15 | ``` 16 | solara run Newsapp.py 17 | ``` 18 | -------------------------------------------------------------------------------- /News_App/requirements.txt: -------------------------------------------------------------------------------- 1 | solara == 1.47.0 2 | Flask 3 | gunicorn ==23.0.0 4 | simple-websocket 5 | flask-sock 6 | yfinance -------------------------------------------------------------------------------- /Number reverse.py: -------------------------------------------------------------------------------- 1 | n=int(input("Enter number: ")) 2 | rev=0 3 | while(n>0): 4 | dig=n%10 5 | rev=rev*10+dig 6 | n=n//10 7 | print("Reverse of the number:",rev) 8 | -------------------------------------------------------------------------------- /PDF/images/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/PDF/images/ss.png -------------------------------------------------------------------------------- /PDF/output.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/PDF/output.pdf -------------------------------------------------------------------------------- /PDF/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow==11.2.1 2 | fpdf==1.7.2 -------------------------------------------------------------------------------- /PDFtoAudiobook.py: -------------------------------------------------------------------------------- 1 | import pyttsx3 2 | import pyPDF2 3 | book = open('book.pdf','rb') 4 | pdfreader = pyPDF2.PdfFileReader(book) 5 | pages = pdfreader.numPages 6 | print(pages) 7 | speaker = pyttsx3.init() 8 | page= pdfreader.getpage(7) 9 | text = page.extractText() 10 | speaker.say(text) 11 | speaker.runAndWait() 12 | -------------------------------------------------------------------------------- /PRACTICEPROJECT-DISREGARD.txt: -------------------------------------------------------------------------------- 1 | This is practice for my first time using GitHub 2 | 3 | Please disregard as I'm getting used to using CLI and GitHub 4 | 5 | Thanks! 6 | -------------------------------------------------------------------------------- /Palindrome_Checker.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | A simple method is , to reverse the string and and compare with original string. 4 | If both are same that's means string is palindrome otherwise else. 5 | """ 6 | phrase = input() 7 | if phrase == phrase[::-1]: # slicing technique 8 | """phrase[::-1] this code is for reverse a string very smartly""" 9 | 10 | print("\n Wow!, The phrase is a Palindrome!") 11 | else: 12 | print("\n Sorry, The given phrase is not a Palindrome.") 13 | -------------------------------------------------------------------------------- /Password Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | colorama==0.4.6 2 | inquirer==3.4.0 -------------------------------------------------------------------------------- /Password Generator/requirements_new.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Patterns/pattern2.py: -------------------------------------------------------------------------------- 1 | #pattern 2 | #$$$$$$$$$$$ 3 | # $$$$$$$$$ 4 | # $$$$$$$ 5 | # $$$$$ 6 | # $$$ 7 | # $ 8 | 9 | 10 | 11 | def main(): 12 | lines = int(input("Enter no.of lines: ")) 13 | pattern(lines) 14 | 15 | def pattern(lines): 16 | flag=lines 17 | for i in range(lines): 18 | print(" "*(i),'$'*(2*flag-1)) 19 | flag-=1 20 | 21 | if __name__ == "__main__": 22 | main() 23 | 24 | -------------------------------------------------------------------------------- /Patterns/pattern5.py: -------------------------------------------------------------------------------- 1 | #pattern Reverse piramid of numbers 2 | #1 3 | #21 4 | #321 5 | #4321 6 | #54321 7 | 8 | def main(): 9 | lines = int(input("Enter the number of lines: ")) 10 | pattern(lines) 11 | 12 | def pattern(rows): 13 | const='' 14 | for i in range(1, rows+1): 15 | const=str(i)+const 16 | print(const) 17 | 18 | if __name__ == "__main__": 19 | main() 20 | -------------------------------------------------------------------------------- /Patterns/pattern6.py: -------------------------------------------------------------------------------- 1 | # Python code to print the following alphabet pattern 2 | #A 3 | #B B 4 | #C C C 5 | #D D D D 6 | #E E E E E 7 | def alphabetpattern(n): 8 | num = 65 9 | for i in range(0, n): 10 | for j in range(0, i+1): 11 | ch = chr(num) 12 | print(ch, end=" ") 13 | num = num + 1 14 | print("\r") 15 | 16 | a = 5 17 | alphabetpattern(a) 18 | -------------------------------------------------------------------------------- /Patterns/patterns.py: -------------------------------------------------------------------------------- 1 | # Lets say we want to print a combination of stars as shown below. 2 | 3 | # * 4 | # * * 5 | # * * * 6 | # * * * * 7 | # * * * * * 8 | 9 | 10 | # Let's say we want to print pattern which is opposite of above: 11 | # * * * * * 12 | # * * * * 13 | # * * * 14 | # * * 15 | # * 16 | 17 | def main(): 18 | lines = int(input("Enter no.of lines: ")) 19 | pattern(lines) 20 | 21 | def pattern(lines): 22 | for i in range(1,lines+1): 23 | print("* "*i) 24 | print() 25 | for i in range(lines): 26 | print(" "*i,"* "*(lines-i)) 27 | 28 | if __name__ == "__main__": 29 | main() 30 | -------------------------------------------------------------------------------- /Pc_information.py: -------------------------------------------------------------------------------- 1 | import platform # built in lib 2 | 3 | print(f"System : {platform.system()}") # Prints type of Operating System 4 | print(f"System name : {platform.node()}") # Prints System Name 5 | print(f"version : {platform.release()}") # Prints System Version 6 | # TO get the detailed version number 7 | print(f"detailed version number : {platform.version()}") # Prints detailed version number 8 | print(f"System architecture : {platform.machine()}") # Prints whether the system is 32-bit ot 64-bit 9 | print(f"System processor : {platform.processor()}") # Prints CPU model 10 | 11 | 12 | -------------------------------------------------------------------------------- /Polyline.py: -------------------------------------------------------------------------------- 1 | # Polyline drawing in codeskulptor 2 | 3 | import simplegui 4 | 5 | polyline = [] 6 | 7 | 8 | def click(pos): 9 | global polyline 10 | polyline.append(pos) 11 | 12 | 13 | def clear(): 14 | global polyline 15 | polyline = [] 16 | 17 | 18 | def draw(canvas): 19 | if len(polyline) == 1: 20 | canvas.draw_point(polyline[0], "White") 21 | for i in range(1, len(polyline)): 22 | canvas.draw_line(polyline[i - 1], polyline[i], 2, "White") 23 | 24 | 25 | frame = simplegui.create_frame("Echo click", 300, 200) 26 | frame.set_mouseclick_handler(click) 27 | frame.set_draw_handler(draw) 28 | frame.add_button("Clear", clear) 29 | 30 | frame.start() 31 | -------------------------------------------------------------------------------- /PongPong_Game/pong/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /PongPong_Game/pong/rectangle.py: -------------------------------------------------------------------------------- 1 | # ./PongPong/pong/rectangle.py 2 | 3 | import pyglet 4 | 5 | 6 | class RectangleObject(pyglet.shapes.Rectangle): 7 | def __init__(self, *args, **kwargs): 8 | super(RectangleObject, self).__init__(*args, **kwargs) 9 | -------------------------------------------------------------------------------- /PongPong_Game/pong_game_play.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/PongPong_Game/pong_game_play.gif -------------------------------------------------------------------------------- /PongPong_Game/requirements.txt: -------------------------------------------------------------------------------- 1 | pyglet==2.1.6 2 | -------------------------------------------------------------------------------- /Program of Reverse of any number.py: -------------------------------------------------------------------------------- 1 | num = int(input("enter any Number")) 2 | rev = 0 3 | while num > 0: 4 | Rem = num % 10 5 | num = num // 10 6 | rev = rev * 10 + Rem 7 | print("The Reverse of the number", rev) 8 | ################## 9 | # could also simply do this another way 10 | 11 | num = input() 12 | print(int(num[::-1])) 13 | -------------------------------------------------------------------------------- /Program to print table of given number.py: -------------------------------------------------------------------------------- 1 | n = int(input("Enter the number to print the tables for:")) 2 | for i in range(1, 11): 3 | print(n, "x", i, "=", n * i) 4 | 5 | # Example 6 | # input: 2 7 | # output: 8 | """ 9 | 2 x 1 = 2 10 | 2 x 2 = 4 11 | 2 x 3 = 6 12 | 2 x 4 = 8 13 | 2 x 5 = 10 14 | 2 x 6 = 12 15 | 2 x 7 = 14 16 | 2 x 8 = 16 17 | 2 x 9 = 18 18 | 2 x 10 = 20 19 | """ 20 | -------------------------------------------------------------------------------- /Python Distance.py: -------------------------------------------------------------------------------- 1 | # Display the powers of 2 using anonymous function 2 | 3 | terms = 10 4 | 5 | # Uncomment code below to take input from the user 6 | # terms = int(input("How many terms? ")) 7 | 8 | # use anonymous function 9 | result = list(map(lambda x: 2 ** x, range(terms))) 10 | 11 | print("The total terms are:",terms) 12 | for i in range(terms): 13 | print("2 raised to power",i,"is",result[i]) 14 | -------------------------------------------------------------------------------- /Python Program for Product of unique prime factors of a number.py: -------------------------------------------------------------------------------- 1 | # Python program to find sum of given 2 | # series. 3 | 4 | def productPrimeFactors(n): 5 | product = 1 6 | 7 | for i in range(2, n+1): 8 | if (n % i == 0): 9 | isPrime = 1 10 | 11 | for j in range(2, int(i/2 + 1)): 12 | if (i % j == 0): 13 | isPrime = 0 14 | break 15 | 16 | # condition if \'i\' is Prime number 17 | # as well as factor of num 18 | if (isPrime): 19 | product = product * i 20 | 21 | return product 22 | 23 | 24 | 25 | # main() 26 | n = 44 27 | print (productPrimeFactors(n)) 28 | 29 | # Contributed by _omg 30 | -------------------------------------------------------------------------------- /Python Program for Tower of Hanoi.py: -------------------------------------------------------------------------------- 1 | # Recursive Python function to solve the tower of hanoi 2 | def TowerOfHanoi(n , source, destination, auxiliary): 3 | if n==1: 4 | print("Move disk 1 from source ",source," to destination ",destination) 5 | return 6 | TowerOfHanoi(n-1, source, auxiliary, destination) 7 | print("Move disk ",n," from source ",source," to destination ",destination) 8 | TowerOfHanoi(n-1, auxiliary, destination, source) 9 | n = 4 10 | TowerOfHanoi(n,'A','B','C') 11 | -------------------------------------------------------------------------------- /Python Program to Count the Number of Each Vowel.py: -------------------------------------------------------------------------------- 1 | # Program to count the number of each vowels 2 | 3 | # string of vowels 4 | vowels = 'aeiou' 5 | 6 | ip_str = 'Hello, have you tried our tutorial section yet?' 7 | 8 | # make it suitable for caseless comparisions 9 | ip_str = ip_str.casefold() 10 | 11 | # make a dictionary with each vowel a key and value 0 12 | count = {}.fromkeys(vowels,0) 13 | 14 | # count the vowels 15 | for char in ip_str: 16 | if char in count: 17 | count[char] += 1 18 | 19 | print(count) 20 | -------------------------------------------------------------------------------- /Python Program to Display Fibonacci Sequence Using Recursion.py: -------------------------------------------------------------------------------- 1 | def recur_fibo(n): 2 | if n <= 1: 3 | return n 4 | else: 5 | return(recur_fibo(n-1) + recur_fibo(n-2)) 6 | 7 | nterms = 10 8 | 9 | # check if the number of terms is valid 10 | if nterms <= 0: 11 | print("Please enter a positive integer") 12 | else: 13 | print("Fibonacci sequence:") 14 | for i in range(nterms): 15 | print(recur_fibo(i)) 16 | -------------------------------------------------------------------------------- /Python Program to Find LCM.py: -------------------------------------------------------------------------------- 1 | # Python Program to find the L.C.M. of two input number 2 | 3 | def compute_lcm(x, y): 4 | 5 | # choose the greater number 6 | if x > y: 7 | greater = x 8 | else: 9 | greater = y 10 | 11 | while(True): 12 | if((greater % x == 0) and (greater % y == 0)): 13 | lcm = greater 14 | break 15 | greater += 1 16 | 17 | return lcm 18 | 19 | num1 = 54 20 | num2 = 24 21 | 22 | print("The L.C.M. is", compute_lcm(num1, num2)) 23 | -------------------------------------------------------------------------------- /Python Program to Merge Mails.py: -------------------------------------------------------------------------------- 1 | # Python program to mail merger 2 | # Names are in the file names.txt 3 | # Body of the mail is in body.txt 4 | 5 | # open names.txt for reading 6 | with open("names.txt", 'r', encoding='utf-8') as names_file: 7 | 8 | # open body.txt for reading 9 | with open("body.txt", 'r', encoding='utf-8') as body_file: 10 | 11 | # read entire content of the body 12 | body = body_file.read() 13 | 14 | # iterate over names 15 | for name in names_file: 16 | mail = "Hello " + name.strip() + "\n" + body 17 | 18 | # write the mails to individual files 19 | with open(name.strip()+".txt", 'w', encoding='utf-8') as mail_file: 20 | mail_file.write(mail) 21 | 22 | -------------------------------------------------------------------------------- /Python Program to Print the Fibonacci sequence.py: -------------------------------------------------------------------------------- 1 | # Program to display the Fibonacci sequence up to n-th term 2 | 3 | nterms = int(input("How many terms? ")) 4 | 5 | # first two terms 6 | n1, n2 = 0, 1 7 | count = 0 8 | 9 | # check if the number of terms is valid 10 | if nterms <= 0: 11 | print("Please enter a positive integer") 12 | elif nterms == 1: 13 | print("Fibonacci sequence upto",nterms,":") 14 | print(n1) 15 | else: 16 | print("Fibonacci sequence:") 17 | while count < nterms: 18 | print(n1) 19 | nth = n1 + n2 20 | # update values 21 | n1 = n2 22 | n2 = nth 23 | count += 1 24 | -------------------------------------------------------------------------------- /Python Program to Remove Punctuations from a String.py: -------------------------------------------------------------------------------- 1 | # define punctuation 2 | punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' 3 | 4 | my_str = "Hello!!!, he said ---and went." 5 | 6 | # To take input from the user 7 | # my_str = input("Enter a string: ") 8 | 9 | # remove punctuation from the string 10 | no_punct = "" 11 | for char in my_str: 12 | if char not in punctuations: 13 | no_punct = no_punct + char 14 | 15 | # display the unpunctuated string 16 | print(no_punct) 17 | -------------------------------------------------------------------------------- /Python Program to Transpose a Matrix.py: -------------------------------------------------------------------------------- 1 | X = [[12,7], 2 | [4 ,5], 3 | [3 ,8]] 4 | 5 | result = [[0,0,0], 6 | [0,0,0]] 7 | 8 | # iterate through rows 9 | for i in range(len(X)): 10 | # iterate through columns 11 | for j in range(len(X[0])): 12 | result[j][i] = X[i][j] 13 | 14 | for r in result: 15 | print(r) 16 | -------------------------------------------------------------------------------- /Python Voice Generator.py: -------------------------------------------------------------------------------- 1 | #install and import google text-to-speech library gtts 2 | from gtts import gTTS 3 | import os 4 | #provide user input text 5 | text=input('enter the text: ') 6 | #covert text into voice 7 | voice=gTTS(text=text, lang='en') 8 | #save the generated voice 9 | voice.save('output.mp3') 10 | #play the file in windows 11 | os.system('start output.mp3') -------------------------------------------------------------------------------- /Python_chatting_application/README.md: -------------------------------------------------------------------------------- 1 | # Python_chat_App 2 | Simple chat application using python 3 | -------------------------------------------------------------------------------- /Python_swapping.py: -------------------------------------------------------------------------------- 1 | # Python3 program to swap first 2 | # and last element of a list 3 | 4 | # Swap function 5 | def swapList(newList): 6 | size = len(newList) 7 | 8 | # Swapping 9 | temp = newList[0] 10 | newList[0] = newList[size - 1] 11 | newList[size - 1] = temp 12 | 13 | return newList 14 | 15 | # Driver code 16 | newList = [12, 35, 9, 56, 24] 17 | 18 | print(swapList(newList)) 19 | -------------------------------------------------------------------------------- /QR_code_generator/qrcode.py: -------------------------------------------------------------------------------- 1 | import pyqrcode, png 2 | # from pyqrcode import QRCode 3 | # no need to import same library again and again 4 | 5 | # Creating QR code after given text "input" 6 | url = pyqrcode.create(input("Enter text to convert: ")) 7 | # Saving QR code as a png file 8 | url.show() 9 | # Name of QR code png file "input" 10 | url.png(input("Enter image name to save: ") + ".png", scale=6) 11 | -------------------------------------------------------------------------------- /QuestionAnswerVirtualAssistant/requirements.txt: -------------------------------------------------------------------------------- 1 | pandas 2 | scikit-learn -------------------------------------------------------------------------------- /Random Password Generator.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | low="abcdefghijklmnopqrstuvwxyz" 4 | upp="ABCDEFGHIJKLMNOPQRSTUVWXYZ" 5 | num="0123456789" 6 | sym="!@#$%^&*" 7 | 8 | all=low+upp+num+sym 9 | length=8 10 | password="".join(random.sample(all,length)) 11 | print(password) 12 | 13 | -------------------------------------------------------------------------------- /RandomDice.py: -------------------------------------------------------------------------------- 1 | # GGearing 01/10/19 2 | # Random Dice Game using Tkinter 3 | # Tkinter is used for Making Using GUI in Python Program! 4 | # randint provides you with a random number within your given range! 5 | from random import randint 6 | from tkinter import * 7 | 8 | # Function to rool the dice 9 | def roll(): 10 | text.delete(0.0, END) 11 | text.insert(END, str(randint(1, 100))) 12 | 13 | 14 | # Defining our GUI 15 | window = Tk() 16 | text = Text(window, width=3, height=1) 17 | buttonA = Button(window, text="Press to roll!", command=roll) 18 | text.pack() 19 | buttonA.pack() 20 | # End Of The Program! 21 | -------------------------------------------------------------------------------- /Randomnumber.py: -------------------------------------------------------------------------------- 1 | # Program to generate a random number between 0 and 9 2 | 3 | # importing the random module 4 | from random import randint 5 | 6 | print(randint(0,9)) 7 | -------------------------------------------------------------------------------- /ReadFromCSV.py: -------------------------------------------------------------------------------- 1 | __author__ = "vamsi" 2 | import pandas as pd # pandas library to read csv file 3 | from matplotlib import pyplot as plt # matplotlib library to visualise the data 4 | from matplotlib import style 5 | 6 | style.use("ggplot") 7 | 8 | """reading data from SalesData.csv file 9 | and passing data to dataframe""" 10 | 11 | df = pd.read_csv("..\SalesData.csv") # Reading the csv file 12 | x = df[ 13 | "SalesID" 14 | ].as_matrix() # casting SalesID to list #extracting the column with name SalesID 15 | y = df["ProductPrice"].as_matrix() # casting ProductPrice to list 16 | plt.xlabel("SalesID") # assigning X-axis label 17 | plt.ylabel("ProductPrice") # assigning Y-axis label 18 | plt.title("Sales Analysis") # assigning Title to the graph 19 | plt.plot(x, y) # Plot X and Y axis 20 | plt.show() # Show the graph 21 | -------------------------------------------------------------------------------- /Recursion Visulaizer/.recursionVisualizer.py.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Recursion Visulaizer/.recursionVisualizer.py.swp -------------------------------------------------------------------------------- /Recursion Visulaizer/Meshimproved.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Recursion Visulaizer/Meshimproved.PNG -------------------------------------------------------------------------------- /Recursion Visulaizer/fencedmesh.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Recursion Visulaizer/fencedmesh.PNG -------------------------------------------------------------------------------- /Recursion Visulaizer/git: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Recursion Visulaizer/git -------------------------------------------------------------------------------- /Search_Engine/README.md: -------------------------------------------------------------------------------- 1 | Python Program to search through various documents and return the documents containing the search term. Algorithm involves using a reverse index to store each word in each document where a document is defined by an index. To get the document that contains a search term, we simply find an intersect of all the words in the search term, and using the resulting indexes, retrieve the document(s) that contain these words 2 | 3 | To use directly, run 4 | 5 | ```python3 backend.py``` 6 | 7 | To use a gui, run 8 | 9 | ```python3 frontend.py``` -------------------------------------------------------------------------------- /Search_Engine/test_data.py: -------------------------------------------------------------------------------- 1 | documents = [ 2 | "we should all strive to be happy", 3 | "happiness is all you need", 4 | "a cheerful heart is a happy one", 5 | "no way should we be sad" 6 | ] 7 | 8 | search = "happy" -------------------------------------------------------------------------------- /Shortest Distance between Two Lines.py: -------------------------------------------------------------------------------- 1 | import math 2 | import numpy as NP 3 | 4 | LC1 = eval(input("Enter DRs of Line 1 : ")) 5 | LP1 = eval(input("Enter Coordinate through which Line 1 passes : ")) 6 | LC2 = eval(input("Enter DRs of Line 2 : ")) 7 | LP2 = eval(input("Enter Coordinate through which Line 2 passes : ")) 8 | a1, b1, c1, a2, b2, c2 = LC1[0], LC1[1], LC1[2], LC2[0], LC2[1], LC2[2] 9 | x = NP.array( 10 | [[LP2[0] - LP1[0], LP2[1] - LP1[1], LP2[2] - LP1[2]], [a1, b1, c1], [a2, b2, c2]] 11 | ) 12 | y = math.sqrt( 13 | (((b1 * c2) - (b2 * c1)) ** 2) 14 | + (((c1 * a2) - (c2 * a1)) ** 2) 15 | + (((a1 * b2) - (b1 * a2)) ** 2) 16 | ) 17 | -------------------------------------------------------------------------------- /SimpleStopWatch.py: -------------------------------------------------------------------------------- 1 | # Author: OMKAR PATHAK 2 | # This script helps to build a simple stopwatch application using Python's time module. 3 | 4 | import time 5 | 6 | print("Press ENTER to begin, Press Ctrl + C to stop") 7 | while True: 8 | try: 9 | input() # For ENTER. Use raw_input() if you are running python 2.x instead of input() 10 | starttime = time.time() 11 | print("Started") 12 | while True: 13 | print("Time Elapsed: ", round(time.time() - starttime, 0), "secs", end="\r") 14 | time.sleep(1) # 1 second delay 15 | except KeyboardInterrupt: 16 | print("Stopped") 17 | endtime = time.time() 18 | print("Total Time:", round(endtime - starttime, 2), "secs") 19 | break 20 | -------------------------------------------------------------------------------- /Snake_water_gun/README.md: -------------------------------------------------------------------------------- 1 | # Snake_water_gun 2 | Snake Water Gun game 3 | -------------------------------------------------------------------------------- /Sorting Algorithms/Bubble_Sorting_Prog.py: -------------------------------------------------------------------------------- 1 | def bubblesort(list): 2 | 3 | # Swap the elements to arrange in order 4 | for iter_num in range(len(list) - 1, 0, -1): 5 | for idx in range(iter_num): 6 | if list[idx] > list[idx + 1]: 7 | temp = list[idx] 8 | list[idx] = list[idx + 1] 9 | list[idx + 1] = temp 10 | 11 | 12 | list = [19, 2, 31, 45, 6, 11, 121, 27] 13 | bubblesort(list) 14 | print(list) 15 | -------------------------------------------------------------------------------- /Sorting Algorithms/Bubble_sort.py: -------------------------------------------------------------------------------- 1 | def bubble_sort(Lists): 2 | for i in range(len(Lists)): 3 | for j in range(len(Lists) - 1): 4 | # We check whether the adjecent number is greater or not 5 | if Lists[j] > Lists[j + 1]: 6 | Lists[j], Lists[j + 1] = Lists[j + 1], Lists[j] 7 | 8 | 9 | # Lets the user enter values of an array and verify by himself/herself 10 | array = [] 11 | array_length = int( 12 | input("Enter the number of elements of array or enter the length of array") 13 | ) 14 | for i in range(array_length): 15 | value = int(input("Enter the value in the array")) 16 | array.append(value) 17 | 18 | bubble_sort(array) 19 | print(array) 20 | -------------------------------------------------------------------------------- /Sorting Algorithms/Count sort.py: -------------------------------------------------------------------------------- 1 | def counting_sort(array1, max_val): 2 | m = max_val + 1 3 | count = [0] * m 4 | 5 | for a in array1: 6 | # count occurences 7 | count[a] += 1 8 | i = 0 9 | for a in range(m): 10 | for c in range(count[a]): 11 | array1[i] = a 12 | i += 1 13 | return array1 14 | 15 | 16 | print(counting_sort([1, 2, 7, 3, 2, 1, 4, 2, 3, 2, 1], 7)) 17 | -------------------------------------------------------------------------------- /Sorting Algorithms/Linear_Insertion_Sort.py: -------------------------------------------------------------------------------- 1 | def Linear_Search(Test_arr, val): 2 | index = 0 3 | for i in range(len(Test_arr)): 4 | if val > Test_arr[i]: 5 | index = i + 1 6 | return index 7 | 8 | 9 | def Insertion_Sort(Test_arr): 10 | for i in range(1, len(Test_arr)): 11 | val = Test_arr[i] 12 | j = Linear_Search(Test_arr[:i], val) 13 | Test_arr.pop(i) 14 | Test_arr.insert(j, val) 15 | return Test_arr 16 | 17 | 18 | if __name__ == "__main__": 19 | Test_list = input("Enter the list of Numbers: ").split() 20 | Test_list = [int(i) for i in Test_list] 21 | print(f"Binary Insertion Sort: {Insertion_Sort(Test_list)}") 22 | -------------------------------------------------------------------------------- /Sorting Algorithms/Sort the values of first list using second list.py: -------------------------------------------------------------------------------- 1 | # one list using 2 | # the other list 3 | 4 | 5 | def sort_list(list1, list2): 6 | 7 | zipped_pairs = zip(list2, list1) 8 | 9 | z = [x for _, x in sorted(zipped_pairs)] 10 | 11 | return z 12 | 13 | 14 | # driver code 15 | x = ["a", "b", "c", "d", "e", "f", "g", "h", "i"] 16 | y = [0, 1, 1, 0, 1, 2, 2, 0, 1] 17 | 18 | print(sort_list(x, y)) 19 | 20 | x = ["g", "e", "e", "k", "s", "f", "o", "r", "g", "e", "e", "k", "s"] 21 | y = [0, 1, 1, 0, 1, 2, 2, 0, 1] 22 | 23 | print(sort_list(x, y)) 24 | -------------------------------------------------------------------------------- /Sorting Algorithms/SortingAStringAlphabetically.py: -------------------------------------------------------------------------------- 1 | # Program to sort alphabetically the words form a string provided by the user 2 | 3 | my_str = "Hello this Is an Example With cased letters" 4 | 5 | # To take input from the user 6 | # my_str = input("Enter a string: ") 7 | 8 | # breakdown the string into a list of words 9 | words = my_str.split() 10 | 11 | # sort the list 12 | words.sort() 13 | 14 | # display the sorted words 15 | 16 | print("The sorted words are:") 17 | for word in words: 18 | print(word) 19 | -------------------------------------------------------------------------------- /Sorting Algorithms/brickSort.py: -------------------------------------------------------------------------------- 1 | # Python Program to implement 2 | # Odd-Even / Brick Sort 3 | 4 | 5 | def oddEvenSort(arr, n): 6 | # Initially array is unsorted 7 | isSorted = 0 8 | while isSorted == 0: 9 | isSorted = 1 10 | temp = 0 11 | for i in range(1, n - 1, 2): 12 | if arr[i] > arr[i + 1]: 13 | arr[i], arr[i + 1] = arr[i + 1], arr[i] 14 | isSorted = 0 15 | 16 | for i in range(0, n - 1, 2): 17 | if arr[i] > arr[i + 1]: 18 | arr[i], arr[i + 1] = arr[i + 1], arr[i] 19 | isSorted = 0 20 | 21 | return 22 | 23 | 24 | arr = [34, 2, 10, -9] 25 | n = len(arr) 26 | 27 | oddEvenSort(arr, n) 28 | for i in range(0, n): 29 | print(arr[i], end=" ") 30 | -------------------------------------------------------------------------------- /Sorting Algorithms/insertion_sort.py: -------------------------------------------------------------------------------- 1 | def insertion_sort(nums): 2 | # Start on the second element as we assume the first element is sorted 3 | for i in range(1, len(nums)): 4 | item_to_insert = nums[i] 5 | # And keep a reference of the index of the previous element 6 | j = i - 1 7 | # Move all items of the sorted segment forward if they are larger than 8 | # the item to insert 9 | while j >= 0 and nums[j] > item_to_insert: 10 | nums[j + 1] = nums[j] 11 | j -= 1 12 | # Insert the item 13 | nums[j + 1] = item_to_insert 14 | 15 | 16 | # Verify it works 17 | random_list_of_nums = [9, 1, 15, 28, 6] 18 | insertion_sort(random_list_of_nums) 19 | print(random_list_of_nums) 20 | -------------------------------------------------------------------------------- /Sorting Algorithms/pigeonhole_sort.py: -------------------------------------------------------------------------------- 1 | # know what is Pigeonhole_principle 2 | # https://www.youtube.com/watch?v=IeTLZPNIPJQ 3 | 4 | 5 | def pigeonhole_sort(a): 6 | 7 | # (number of pigeonholes we need) 8 | my_min = min(a) 9 | my_max = max(a) 10 | size = my_max - my_min + 1 11 | 12 | # total pigeonholes 13 | holes = [0] * size 14 | 15 | # filling up the pigeonholes. 16 | for x in a: 17 | holes[x - my_min] += 1 18 | 19 | # Put the elements back into the array in order. 20 | i = 0 21 | for count in range(size): 22 | while holes[count] > 0: 23 | holes[count] -= 1 24 | a[i] = count + my_min 25 | i += 1 26 | 27 | 28 | a = [10, 3, 2, 7, 4, 6, 8] 29 | 30 | # list only integers 31 | print(pigeonhole_sort(a)) 32 | print(a) 33 | -------------------------------------------------------------------------------- /Sorting Algorithms/recursive-quick-sort.py: -------------------------------------------------------------------------------- 1 | def quick_sort(l): 2 | if len(l) <= 1: 3 | return l 4 | else: 5 | return ( 6 | quick_sort([e for e in l[1:] if e <= l[0]]) 7 | + [l[0]] 8 | + quick_sort([e for e in l[1:] if e > l[0]]) 9 | ) 10 | -------------------------------------------------------------------------------- /Sorting Algorithms/selectionSort.py: -------------------------------------------------------------------------------- 1 | list = [] 2 | 3 | N = int(input("Enter The Size Of List")) 4 | 5 | for i in range(0, N): 6 | a = int(input("Enter The number")) 7 | list.append(a) 8 | 9 | 10 | # Let's sort list in ascending order using Selection Sort 11 | # Every time The Element Of List is fetched and the smallest element in remaining list is found and if it comes out 12 | # to be smaller than the element fetched then it is swapped with smallest number. 13 | 14 | for i in range(0, len(list) - 1): 15 | smallest = list[i + 1] 16 | k = 0 17 | for j in range(i + 1, len(list)): 18 | if list[j] <= smallest: 19 | smallest = list[j] 20 | k = j 21 | 22 | if smallest < list[i]: 23 | temp = list[i] 24 | list[i] = list[k] 25 | list[k] = temp 26 | 27 | print(list) 28 | -------------------------------------------------------------------------------- /Sorting Algorithms/selection_sort.py: -------------------------------------------------------------------------------- 1 | def selection_sort(nums): 2 | # This value of i corresponds to how many values were sorted 3 | for i in range(len(nums)): 4 | # We assume that the first item of the unsorted segment is the smallest 5 | lowest_value_index = i 6 | # This loop iterates over the unsorted items 7 | for j in range(i + 1, len(nums)): 8 | if nums[j] < nums[lowest_value_index]: 9 | lowest_value_index = j 10 | # Swap values of the lowest unsorted element with the first unsorted 11 | # element 12 | nums[i], nums[lowest_value_index] = nums[lowest_value_index], nums[i] 13 | 14 | 15 | # Verify it works 16 | random_list_of_nums = [12, 8, 3, 20, 11] 17 | selection_sort(random_list_of_nums) 18 | print(random_list_of_nums) 19 | -------------------------------------------------------------------------------- /Sorting Algorithms/sorting.py: -------------------------------------------------------------------------------- 1 | arr = [7, 2, 8, 5, 1, 4, 6, 3] 2 | temp = 0 3 | 4 | print("Elements of original array: ") 5 | for i in range(0, len(arr)): 6 | print(arr[i], end=" ") 7 | 8 | for i in range(0, len(arr)): 9 | for j in range(i + 1, len(arr)): 10 | if arr[i] > arr[j]: 11 | temp = arr[i] 12 | arr[i] = arr[j] 13 | arr[j] = temp 14 | 15 | print() 16 | 17 | 18 | print("Elements of array sorted in ascending order: ") 19 | for i in range(0, len(arr)): 20 | print(arr[i], end=" ") 21 | -------------------------------------------------------------------------------- /Sorting Algorithms/wave_sort.py: -------------------------------------------------------------------------------- 1 | def sortInWave(arr, n): 2 | arr.sort() 3 | for i in range(0, n - 1, 2): 4 | arr[i], arr[i + 1] = arr[i + 1], arr[i] 5 | 6 | 7 | arr = [] 8 | arr = input("Enter the arr") 9 | sortInWave(arr, len(arr)) 10 | for i in range(0, len(arr)): 11 | print(arr[i], " ") 12 | -------------------------------------------------------------------------------- /SpeechToText.py: -------------------------------------------------------------------------------- 1 | import pyttsx3 2 | 3 | engine = pyttsx3.init() 4 | 5 | voices = engine.getProperty("voices") 6 | for voice in voices: 7 | print(voice.id) 8 | print(voice.name) 9 | 10 | id ="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0" 11 | engine.setProperty("voices",id ) 12 | engine.setProperty("rate",165) 13 | engine.say("jarivs") # Replace string with our own text 14 | engine.runAndWait() -------------------------------------------------------------------------------- /StringToBinary.py: -------------------------------------------------------------------------------- 1 | text = input("Enter Text : ") 2 | 3 | for chr in text: 4 | bin = "" 5 | asciiVal = int(ord(chr)) 6 | while asciiVal > 0: 7 | if asciiVal % 2 == 0: 8 | bin = bin + "0" 9 | else: 10 | bin = bin + "1" 11 | asciiVal = int(asciiVal / 2) 12 | print(bin + " : " + bin[::-1]) 13 | -------------------------------------------------------------------------------- /String_Palindrome.py: -------------------------------------------------------------------------------- 1 | # Program to check if a string is palindrome or not 2 | 3 | my_str = input().strip() 4 | 5 | # make it suitable for caseless comparison 6 | my_str = my_str.casefold() 7 | 8 | # reverse the string 9 | rev_str = my_str[::-1] 10 | 11 | # check if the string is equal to its reverse 12 | if my_str == rev_str: 13 | print("The string is a palindrome.") 14 | else: 15 | print("The string is not a palindrome.") 16 | -------------------------------------------------------------------------------- /Strings.py: -------------------------------------------------------------------------------- 1 | String1 = "Welcome to Malya's World" 2 | print("String with the use of Single Quotes: ") 3 | print(String1) 4 | 5 | # Creating a String 6 | # with double Quotes 7 | String1 = "I'm a TechGeek" 8 | print("\nString with the use of Double Quotes: ") 9 | print(String1) 10 | 11 | # Creating a String 12 | # with triple Quotes 13 | String1 = '''I'm Malya and I live in a world of "TechGeeks"''' 14 | print("\nString with the use of Triple Quotes: ") 15 | print(String1) 16 | 17 | # Creating String with triple 18 | # Quotes allows multiple lines 19 | String1 = """Smile 20 | For 21 | Life""" 22 | print("\nCreating a multiline String: ") 23 | print(String1) 24 | -------------------------------------------------------------------------------- /Task1.2.txt: -------------------------------------------------------------------------------- 1 | Task 1.2 2 | -------------------------------------------------------------------------------- /ThirdAI/Terms and Conditions/XYZ product.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/ThirdAI/Terms and Conditions/XYZ product.pdf -------------------------------------------------------------------------------- /To find the largest number between 3 numbers.py: -------------------------------------------------------------------------------- 1 | # Python program to find the largest number among the three input numbers 2 | 3 | a=[] 4 | for i in range(3): 5 | a.append(int(input())) 6 | print("The largest among three numbers is:",max(a)) 7 | 8 | -------------------------------------------------------------------------------- /Translator/README.md: -------------------------------------------------------------------------------- 1 | # Python-Translator 2 | ## Overview 3 | 4 | This is a python script that uses translator module powered by Google and translates words from a language of user's choice to another language of user's choice. 5 | 6 | ## Author 7 | - [Manisha Gupta](https://manisha069.github.io/) 8 | -------------------------------------------------------------------------------- /Turn your PDFs into audio books/audiobook_gen.py: -------------------------------------------------------------------------------- 1 | import PyPDF2 2 | import pyttsx3 3 | 4 | book = open(input("Enter the book name: "), "rb") 5 | pg_no = int( 6 | input( 7 | "Enter the page number from which you want the system to start reading text: " 8 | ) 9 | ) 10 | 11 | pdf_Reader = PyPDF2.PdfFileReader(book) 12 | pages = pdf_Reader.numPages 13 | 14 | speaker = pyttsx3.init() 15 | 16 | for num in range((pg_no - 1), pages): 17 | page = pdf_Reader.getPage(num) 18 | text = page.extractText() 19 | speaker.say(text) 20 | speaker.runAndWait() 21 | -------------------------------------------------------------------------------- /Turn your PDFs into audio books/requirements.txt: -------------------------------------------------------------------------------- 1 | PyPDF2 2 | pyttsx3 3 | -------------------------------------------------------------------------------- /Turtle_Star.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | board = turtle.Turtle() 4 | 5 | # first triangle for star 6 | board.forward(100) # draw base 7 | 8 | board.left(120) 9 | board.forward(100) 10 | 11 | board.left(120) 12 | board.forward(100) 13 | 14 | board.penup() 15 | board.right(150) 16 | board.forward(50) 17 | 18 | # second triangle for star 19 | board.pendown() 20 | board.right(90) 21 | board.forward(100) 22 | 23 | board.right(120) 24 | board.forward(100) 25 | 26 | board.right(120) 27 | board.forward(100) 28 | 29 | turtle.done() 30 | -------------------------------------------------------------------------------- /UI-Apps/README.md: -------------------------------------------------------------------------------- 1 | ### SIMPLE CLOCK WIDGET USING TKINTER 2 | 3 | ## Running instruction 4 | 5 | # windows user 6 | run `py clock.py` 7 | 8 | # linux user 9 | run `python3 clock.py` -------------------------------------------------------------------------------- /UI-Apps/clock.py: -------------------------------------------------------------------------------- 1 | import tkinter 2 | 3 | # retrieve system's time 4 | from time import strftime 5 | 6 | # ------------------main code----------------------- 7 | # initializing the main UI object 8 | top = tkinter.Tk() 9 | # setting title of the App 10 | top.title("Clock") 11 | # restricting the resizable property 12 | top.resizable(0, 0) 13 | 14 | 15 | def time(): 16 | string = strftime("%H:%M:%S %p") 17 | clockTime.config(text=string) 18 | clockTime.after(1000, time) 19 | 20 | 21 | clockTime = tkinter.Label( 22 | top, font=("calibri", 40, "bold"), background="black", foreground="white" 23 | ) 24 | 25 | clockTime.pack(anchor="center") 26 | time() 27 | 28 | 29 | top.mainloop() 30 | -------------------------------------------------------------------------------- /Unit Digit of a raised to power b.py: -------------------------------------------------------------------------------- 1 | def last_digit(a, b): 2 | if b == 0: # This Code assumes that 0^0 is 1 3 | return 1 4 | elif a % 10 in [0, 5, 6, 1]: 5 | return a % 10 6 | elif b % 4 == 0: 7 | return ((a % 10) ** 4) % 10 8 | else: 9 | return ((a % 10) ** (b % 4)) % 10 10 | 11 | 12 | # Courtesy to https://brilliant.org/wiki/finding-the-last-digit-of-a-power/ 13 | -------------------------------------------------------------------------------- /VoiceAssistant/Project_Basic_struct/TextTospeech.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | from playsound import playsound 3 | import win32com 4 | from win32com import client 5 | import os 6 | 7 | def tts(): 8 | audio = 'speech.mp3' 9 | language = 'en' 10 | sentence = input("Enter the text to be spoken :- ") 11 | 12 | speaker = win32com.client.Dispatch("SAPI.SpVoice") 13 | sp = speaker.Speak(sentence) 14 | 15 | 16 | -------------------------------------------------------------------------------- /VoiceAssistant/Project_Basic_struct/speechtotext.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | # initialize the recognizer 3 | r = sr.Recognizer() 4 | def stt(): 5 | with sr.Microphone() as source: 6 | # read the audio data from the default microphone 7 | audio_data = r.record(source, duration=5) 8 | print("Recognizing...") 9 | # convert speech to text 10 | text = r.recognize_google(audio_data) 11 | print(text) -------------------------------------------------------------------------------- /VoiceRepeater/__main__.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | import speech_recognition as sr 4 | import os 5 | import playsound 6 | import shutil 7 | 8 | shutil.rmtree("spoken") 9 | os.mkdir("spoken") 10 | 11 | speeches = [] 12 | 13 | 14 | def callback(recognizer, audio): 15 | with open("spoken/" + str(len(speeches)) + ".wav", "wb") as file: 16 | file.write(audio.get_wav_data()) 17 | 18 | playsound.playsound("spoken/" + str(len(speeches)) + ".wav") 19 | speeches.append(1) 20 | print("____") 21 | 22 | 23 | r = sr.Recognizer() 24 | m = sr.Microphone() 25 | with m as source: 26 | r.adjust_for_ambient_noise(source) 27 | 28 | stop_listening = r.listen_in_background(m, callback) 29 | print("say:") 30 | while True: 31 | time.sleep(0.1) 32 | -------------------------------------------------------------------------------- /VoiceRepeater/readme.md: -------------------------------------------------------------------------------- 1 | # A simple Voice repeater. 2 | 3 | ### Run the code and speak something: It will repeat exactly what you said! 4 | 5 | ### It creates a folder, 6 | 7 | ### Stores your speech as a sound file, 8 | 9 | ### And plays it! 10 | 11 | ### Requirements: Python, SpeechRecognition and playsound 12 | -------------------------------------------------------------------------------- /Weather Scrapper/weather.csv: -------------------------------------------------------------------------------- 1 | City,Time,Date,Temperature,Precipitation,Sky,Wind 2 | Manhatten,07:02,Tue 06/05,Low 71 F,Precipitate:30%,Isolated Thunderstorms,Winds light and variable 3 | Manhattan,07:03,Wed 06/06,Low 47 F,Precipitate:10%,Partly Cloudy,Winds NE at 10 to 15 mph 4 | Aligarh,07:03,Wed 06/06,High 109 F,Precipitate:20%,Partly Cloudy,Winds ENE at 10 to 15 mph 5 | Delhi,07:03,Wed 06/06,High 107 F,Precipitate:40%,AM Thunderstorms,Winds E at 10 to 15 mph 6 | Portland,02:20,Aug-21-2022,Low 61F,Precipitation:3%,A few clouds,Winds light and variable. 7 | Washington,02:21,Aug-21-2022,High 83F,Precipitation:48%,Cloudy early with scattered thunderstorms developing this afternoon,Winds SSE at 5 to 10 mph 8 | Guadalajara,02:21,Aug-21-2022,Scattered thunderstorms developing this afternoon,Precipitation:52%,Mostly cloudy this morning,High near 80F 9 | -------------------------------------------------------------------------------- /Web Socket.py: -------------------------------------------------------------------------------- 1 | # Program to print a data & it's Metadata of online uploaded file using "socket". 2 | import socket 3 | skt_c=socket.socket(socket.AF_INET,socket.SOCK_STREAM) 4 | skt_c.connect(('data.pr4e.org',80)) 5 | link='GET http://data.pr4e.org/intro-short.txt HTTP/1.0\r\n\r\n'.encode() 6 | skt_c.send(link) 7 | 8 | while True: 9 | data=skt_c.recv(512) 10 | if len(data)<1: 11 | break 12 | print(data.decode()) 13 | skt_c.close() 14 | -------------------------------------------------------------------------------- /Webbrowser/tk-browser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # Webbrowser v1.0 3 | # Written by Sina Meysami 4 | # 5 | 6 | from tkinter import * # pip install tk-tools 7 | import tkinterweb # pip install tkinterweb 8 | import sys 9 | 10 | class Browser(Tk): 11 | def __init__(self): 12 | super(Browser,self).__init__() 13 | self.title("Tk Browser") 14 | try: 15 | browser = tkinterweb.HtmlFrame(self) 16 | browser.load_website("https://google.com") 17 | browser.pack(fill="both",expand=True) 18 | except Exception: 19 | sys.exit() 20 | 21 | 22 | def main(): 23 | browser = Browser() 24 | browser.mainloop() 25 | 26 | if __name__ == "__main__": 27 | # Webbrowser v1.0 28 | main() 29 | -------------------------------------------------------------------------------- /Wikipdedia/main.py: -------------------------------------------------------------------------------- 1 | # This is a sample Python script. 2 | 3 | # Press Shift+F10 to execute it or replace it with your code. 4 | # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. 5 | 6 | 7 | def print_hi(name): 8 | # Use a breakpoint in the code line below to debug your script. 9 | print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. 10 | 11 | 12 | # Press the green button in the gutter to run the script. 13 | if __name__ == '__main__': 14 | print_hi('PyCharm') 15 | 16 | # See PyCharm help at https://www.jetbrains.com/help/pycharm/ 17 | -------------------------------------------------------------------------------- /Wikipdedia/static/js/output.js: -------------------------------------------------------------------------------- 1 | function validateForm() { 2 | var language = document.getElementById("language").value; 3 | 4 | if (language === "Select") { 5 | alert("Please select a language."); 6 | return false; 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Windows_Wallpaper_Script/Wallpapers/desktop/89d49683c75888287b50ccb05cab960b991231639dabe5bc817e1d9395a39694.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Windows_Wallpaper_Script/Wallpapers/desktop/89d49683c75888287b50ccb05cab960b991231639dabe5bc817e1d9395a39694.jpg -------------------------------------------------------------------------------- /Windows_Wallpaper_Script/Wallpapers/desktop/acc15612b1c85619e06c584a52f6474242963dbb9fe315ec4ecd44de8f3702c8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Windows_Wallpaper_Script/Wallpapers/desktop/acc15612b1c85619e06c584a52f6474242963dbb9fe315ec4ecd44de8f3702c8.jpg -------------------------------------------------------------------------------- /Windows_Wallpaper_Script/Wallpapers/desktop/c1385a4022859c16bdf317e09668dbb3fc41a7e1c160605539abd1bcd29625af.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Windows_Wallpaper_Script/Wallpapers/desktop/c1385a4022859c16bdf317e09668dbb3fc41a7e1c160605539abd1bcd29625af.jpg -------------------------------------------------------------------------------- /Windows_Wallpaper_Script/Wallpapers/mobile/5678c6685841ab637cfa63b8c0e32ee205649af2051eb75f40b00f4d5a42b7b9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Windows_Wallpaper_Script/Wallpapers/mobile/5678c6685841ab637cfa63b8c0e32ee205649af2051eb75f40b00f4d5a42b7b9.jpg -------------------------------------------------------------------------------- /Windows_Wallpaper_Script/Wallpapers/mobile/a33845e422c7d1b668f60e53e942736c7bbc74299469b7df734254d28e026dc4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Windows_Wallpaper_Script/Wallpapers/mobile/a33845e422c7d1b668f60e53e942736c7bbc74299469b7df734254d28e026dc4.jpg -------------------------------------------------------------------------------- /Windows_Wallpaper_Script/Wallpapers/mobile/e22f23869f500ee576cdc02fb83f911de31440d589e329d04576e571a54b8851.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Windows_Wallpaper_Script/Wallpapers/mobile/e22f23869f500ee576cdc02fb83f911de31440d589e329d04576e571a54b8851.jpg -------------------------------------------------------------------------------- /XORcipher/README.md: -------------------------------------------------------------------------------- 1 | 2 | ### XORCipher class 3 | 4 | This class implements the XOR-cipher algorithm and provides some useful methods for encrypting and decrypting strings and 5 | files. You will find detailed docstrings in each method. 6 | 7 | #### Overview about methods 8 | 9 | * encrypt : list of char 10 | * decrypt : list of char 11 | * encrypt_string : str 12 | * decrypt_string : str 13 | * encrypt_file : boolean 14 | * decrypt_file : boolean -------------------------------------------------------------------------------- /Youtube Downloader With GUI/Screenshot (138).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Youtube Downloader With GUI/Screenshot (138).png -------------------------------------------------------------------------------- /Youtube Downloader With GUI/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Youtube Downloader With GUI/photo.jpg -------------------------------------------------------------------------------- /Youtube Downloader With GUI/photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Youtube Downloader With GUI/photo.png -------------------------------------------------------------------------------- /Youtube Downloader With GUI/youtube-ios-app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/Youtube Downloader With GUI/youtube-ios-app.ico -------------------------------------------------------------------------------- /add_two_number.py: -------------------------------------------------------------------------------- 1 | user_input = (input("type type 'start' to run program:")).lower() 2 | 3 | if user_input == 'start': 4 | is_game_running = True 5 | else: 6 | is_game_running = False 7 | 8 | 9 | while (is_game_running): 10 | num1 = int(input("enter number 1:")) 11 | num2 = int(input("enter number 2:")) 12 | num3 = num1+num2 13 | print(f"sum of {num1} and {num2} is {num3}") 14 | user_input = (input("if you want to discontinue type 'stop':")).lower() 15 | if user_input == "stop": 16 | is_game_running = False 17 | 18 | -------------------------------------------------------------------------------- /add_two_nums.py: -------------------------------------------------------------------------------- 1 | __author__ = "Nitkarsh Chourasia" 2 | __version__ = "1.0" 3 | def addition( 4 | num1: typing.Union[int, float], 5 | num2: typing.Union[int, float] 6 | ) -> str: 7 | """A function to add two given numbers.""" 8 | 9 | # Checking if the given parameters are numerical or not. 10 | if not isinstance(num1, (int, float)): 11 | return "Please input numerical values only for num1." 12 | if not isinstance(num2, (int, float)): 13 | return "Please input numerical values only for num2." 14 | 15 | # Adding the given parameters. 16 | sum_result = num1 + num2 17 | 18 | # returning the result. 19 | return f"The sum of {num1} and {num2} is: {sum_result}" 20 | ) 21 | 22 | print(addition(5, 10)) # This will use the provided parameters 23 | print(addition(2, 2)) 24 | print(addition(-3, -5)) 25 | -------------------------------------------------------------------------------- /armstrongnumber.py: -------------------------------------------------------------------------------- 1 | # Python program to check if the number is an Armstrong number or not 2 | 3 | # take input from the user 4 | num = int(input("Enter a number: ")) 5 | 6 | # initialize sum 7 | sum = 0 8 | 9 | # find the sum of the cube of each digit 10 | temp = num 11 | while temp > 0: 12 | digit = temp % 10 13 | sum += digit ** 3 14 | temp //= 10 15 | 16 | # display the result 17 | if num == sum: 18 | print(num, "is an Armstrong number") 19 | else: 20 | print(num, "is not an Armstrong number") 21 | -------------------------------------------------------------------------------- /async_downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | aiohttp==3.11.18 2 | -------------------------------------------------------------------------------- /avg_xdspam_confidence.py: -------------------------------------------------------------------------------- 1 | fh = open("mbox-short.txt") 2 | # The 'mbox-short.txt' file can be downloaded from the link: https://www.py4e.com/code3/mbox-short.txt 3 | sum = 0 4 | count = 0 5 | for fx in fh: 6 | fx = fx.rstrip() 7 | if not fx.startswith("X-DSPAM-Confidence:"): 8 | continue 9 | fy = fx[19:] 10 | count = count + 1 11 | sum = sum + float(fy) 12 | print("Average spam confidence: ", sum / count) 13 | -------------------------------------------------------------------------------- /bankmanaging.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/bankmanaging.db -------------------------------------------------------------------------------- /basic_cal.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | print(eval(input("enter digits with operator (e.g. 5+5)\n"))) 4 | except: 5 | print("Invalid Input, try again..") 6 | 7 | # Simple Calculator using eval() in Python 8 | # This calculator takes user input like "5+5" or "10/2" and shows the result. -------------------------------------------------------------------------------- /binary search.py: -------------------------------------------------------------------------------- 1 | def binarySearchAppr (arr, start, end, x): 2 | # check condition 3 | if end >= start: 4 | mid = start + (end- start)//2 5 | # If element is present at the middle 6 | if arr[mid] == x: 7 | return mid 8 | # If element is smaller than mid 9 | elif arr[mid] > x: 10 | return binarySearchAppr(arr, start, mid-1, x) 11 | # Else the element greator than mid 12 | else: 13 | return binarySearchAppr(arr, mid+1, end, x) 14 | else: 15 | # Element is not found in the array 16 | return -1 17 | arr = sorted(['t','u','t','o','r','i','a','l']) 18 | x ='r' 19 | result = binarySearchAppr(arr, 0, len(arr)-1, x) 20 | if result != -1: 21 | print ("Element is present at index "+str(result)) 22 | else: 23 | print ("Element is not present in array") 24 | -------------------------------------------------------------------------------- /binary_search_trees/inorder_successor.py: -------------------------------------------------------------------------------- 1 | def inorder_successor(root): 2 | # This function returns the inorder successor of a node in a BST 3 | 4 | # The inorder successor of a node is the node with the smallest value greater than the value of the node 5 | current=root 6 | 7 | # The inorder successor is the leftmost node in the right subtree 8 | while current.left is not None: 9 | current=current.left 10 | return current -------------------------------------------------------------------------------- /binary_search_trees/inorder_traversal.py: -------------------------------------------------------------------------------- 1 | def inorder(root): 2 | """ This function performs an inorder traversal of a BST""" 3 | 4 | # The inorder traversal of a BST is the nodes in increasing order 5 | if root is None: 6 | return 7 | 8 | # Traverse the left subtree 9 | inorder(root.left) 10 | 11 | # Print the root node 12 | print(root.data) 13 | 14 | # Traverse the right subtree 15 | inorder(root.right) -------------------------------------------------------------------------------- /binary_search_trees/insert_in_bst.py: -------------------------------------------------------------------------------- 1 | from tree_node import Node 2 | def insert(root,val): 3 | 4 | """ This function inserts a node with value val into the BST""" 5 | 6 | # If the tree is empty, create a new node 7 | if root is None: 8 | return Node(val) 9 | 10 | # If the value to be inserted is less than the root value, insert in the left subtree 11 | if val < root.data: 12 | root.left = insert(root.left,val) 13 | 14 | # If the value to be inserted is greater than the root value, insert in the right subtree 15 | else: 16 | root.right = insert(root.right,val) 17 | return root -------------------------------------------------------------------------------- /binary_search_trees/mirror_a_bst.py: -------------------------------------------------------------------------------- 1 | from tree_node import Node 2 | def create_mirror_bst(root): 3 | """ Function to create a mirror of a binary search tree""" 4 | 5 | # If the tree is empty, return None 6 | if root is None: 7 | return None 8 | 9 | # Create a new node with the root value 10 | 11 | # Recursively create the mirror of the left and right subtrees 12 | left_mirror = create_mirror_bst(root.left) 13 | right_mirror = create_mirror_bst(root.right) 14 | root.left = right_mirror 15 | root.right = left_mirror 16 | return root -------------------------------------------------------------------------------- /binary_search_trees/print_in_range.py: -------------------------------------------------------------------------------- 1 | def print_in_range(root,k1,k2): 2 | 3 | """ This function prints the nodes in a BST that are in the range k1 to k2 inclusive""" 4 | 5 | # If the tree is empty, return 6 | if root is None: 7 | return 8 | 9 | # If the root value is in the range, print the root value 10 | if root.data >= k1 and root.data <= k2: 11 | print_in_range(root.left,k1,k2) 12 | print(root.data) 13 | print_in_range(root.right,k1,k2) 14 | 15 | # If the root value is less than k1, the nodes in the range will be in the right subtree 16 | elif root.data < k1: 17 | print_in_range(root.left,k1,k2) 18 | 19 | # If the root value is greater than k2, the nodes in the range will be in the left subtree 20 | else: 21 | print_in_range(root.right,k1,k2) -------------------------------------------------------------------------------- /binary_search_trees/root_to_leaf_paths.py: -------------------------------------------------------------------------------- 1 | def print_root_to_leaf_paths(root, path): 2 | """ This function prints all the root to leaf paths in a BST""" 3 | 4 | # If the tree is empty, return 5 | if root is None: 6 | return 7 | 8 | # Add the root value to the path 9 | path.append(root.data) 10 | if root.left is None and root.right is None: 11 | print(path) 12 | 13 | # Recursively print the root to leaf paths in the left and right subtrees 14 | else: 15 | print_root_to_leaf_paths(root.left, path) 16 | print_root_to_leaf_paths(root.right, path) 17 | path.pop() -------------------------------------------------------------------------------- /binary_search_trees/search_in_bst.py: -------------------------------------------------------------------------------- 1 | def search(root, val): 2 | """ This function searches for a node with value val in the BST and returns True if found, False otherwise""" 3 | 4 | # If the tree is empty, return False 5 | if root == None: 6 | return False 7 | 8 | # If the root value is equal to the value to be searched, return True 9 | if root.data == val: 10 | return True 11 | 12 | # If the value to be searched is less than the root value, search in the left subtree 13 | if root.data > val: 14 | return search(root.left, val) 15 | return search(root.right, val) -------------------------------------------------------------------------------- /binary_search_trees/tree_node.py: -------------------------------------------------------------------------------- 1 | 2 | # Node class for binary tree 3 | 4 | class Node: 5 | def __init__(self, data): 6 | self.data = data 7 | self.left = None 8 | self.right = None 9 | -------------------------------------------------------------------------------- /binary_search_trees/validate_bst.py: -------------------------------------------------------------------------------- 1 | def is_valid_bst(root,min,max): 2 | """ Function to check if a binary tree is a binary search tree""" 3 | 4 | # If the tree is empty, return True 5 | if root is None: 6 | return True 7 | 8 | # If the root value is less than the minimum value or greater than the maximum value, return False 9 | if min is not None and root.data <= min.data: 10 | return False 11 | 12 | # If the root value is greater than the maximum value or less than the minimum value, return False 13 | elif max is not None and root.data >= max.data: 14 | return False 15 | 16 | # Recursively check if the left and right subtrees are BSTs 17 | return is_valid_bst(root.left,min,root) and is_valid_bst(root.right,root,max) -------------------------------------------------------------------------------- /binod.txt: -------------------------------------------------------------------------------- 1 | I am binod 2 | -------------------------------------------------------------------------------- /birthdays.py: -------------------------------------------------------------------------------- 1 | birthdays = {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'} 2 | while True: 3 | 4 | print('Enter a name: (blank to quit)') 5 | name = input() 6 | if name == '': 7 | break 8 | if name in birthdays: 9 | print(birthdays[name] + ' is the birthday of ' + name) 10 | else: 11 | print('I do not have birthday information for ' + name) 12 | print('What is their birthday?') 13 | bday = input() 14 | birthdays[name] = bday 15 | print('Birthday database updated.') 16 | -------------------------------------------------------------------------------- /bodymass.py: -------------------------------------------------------------------------------- 1 | kilo = float (input("kilonuzu giriniz(örnek: 84.9): ")) 2 | boy = float (input("Boyunuzu m cinsinden giriniz: ")) 3 | 4 | vki = (kilo / (boy**2)) 5 | 6 | if vki < 18.5: 7 | print(f"vucut kitle indeksiniz: {vki} zayıfsınız.") 8 | elif vki < 25: 9 | print (f"vucut kitle indeksiniz: {vki} normalsiniz.") 10 | elif vki < 30: 11 | print (f"vucut kitle indeksiniz: {vki} fazla kilolusunuz.") 12 | elif vki < 35: 13 | print (f"vucut kitle indeksiniz: {vki} 1. derece obezsiniz") 14 | elif vki < 40: 15 | print (f"vucut kitle indeksiniz: {vki} 2.derece obezsiniz.") 16 | elif vki >40: 17 | print (f"vucut kitle indeksiniz: {vki} 3.derece obezsiniz.") 18 | else: 19 | print("Yanlış değer girdiniz.") 20 | -------------------------------------------------------------------------------- /brickout-game/README.md: -------------------------------------------------------------------------------- 1 | # Brickout-Game in pygame 2 | 3 | This is a simple brickout-game. It's includes ball, paddle, brick wall 4 | and additional collision detection between these objects. Furthermore, logic for winning and losing and 5 | scoring. The game is written in **Python 2**. 6 | 7 | You start the game with ```python game.py``` 8 | 9 | The game runs with 60 frames per second. 10 | 11 | I used a code sample for the basic structure of pygame from this site [http://programarcadegames.com/](http://programarcadegames.com/) 12 | The site contains a comprehensive introduction in Python and Pygame. In addition many many examples. 13 | 14 | -------------------------------------------------------------------------------- /brickout-game/classDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/brickout-game/classDiagram.png -------------------------------------------------------------------------------- /cartesian_product.py: -------------------------------------------------------------------------------- 1 | """Cartesian Product of Two Lists.""" 2 | 3 | # Import 4 | from itertools import product 5 | 6 | 7 | # Cartesian Product of Two Lists 8 | def cartesian_product(list1, list2): 9 | """Cartesian Product of Two Lists.""" 10 | for _i in list1: 11 | for _j in list2: 12 | print((_i, _j), end=' ') 13 | 14 | 15 | # Main 16 | if __name__ == '__main__': 17 | list1 = input().split() 18 | list2 = input().split() 19 | 20 | # Convert to ints 21 | list1 = [int(i) for i in list1] 22 | list2 = [int(i) for i in list2] 23 | 24 | cartesian_product(list1, list2) 25 | 26 | -------------------------------------------------------------------------------- /chaos.py: -------------------------------------------------------------------------------- 1 | # A simple program illustrating chaotic behaviour 2 | 3 | 4 | def main(): 5 | print("This program illustrates a chaotic function") 6 | 7 | while True: 8 | try: 9 | x = float((input("Enter a number between 0 and 1: "))) 10 | if 0 < x and x < 1: 11 | break 12 | else: 13 | print("Please enter correct number") 14 | except Exception as e: 15 | print("Please enter correct number") 16 | 17 | for i in range(10): 18 | x = 3.9 * x * (1 - x) 19 | print(x) 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /check if a number positive , negative or zero: -------------------------------------------------------------------------------- 1 | num = float(input("Enter a number: ")) 2 | if num > 0: 3 | print("Positive number") 4 | elif num == 0: 5 | print("Zero") 6 | else: 7 | print("Negative number") 8 | num = float(input("Enter a number: ")) 9 | if num >= 0: 10 | if num == 0: 11 | print("Zero") 12 | else: 13 | print("Positive number") 14 | else: 15 | print("Negative number") 16 | 17 | -------------------------------------------------------------------------------- /check_internet_con.py: -------------------------------------------------------------------------------- 1 | from sys import argv 2 | 3 | try: 4 | # For Python 3.0 and later 5 | from urllib.error import URLError 6 | from urllib.request import urlopen 7 | except ImportError: 8 | # Fall back to Python 2's urllib2 9 | from urllib2 import URLError, urlopen 10 | 11 | 12 | def checkInternetConnectivity(): 13 | try: 14 | url = argv[1] 15 | print(url) 16 | protocols = ["https://", "http://"] 17 | if not any(x for x in protocols if x in url): 18 | url = "https://" + url 19 | print("URL:" + url) 20 | except BaseException: 21 | url = "https://google.com" 22 | try: 23 | urlopen(url, timeout=2) 24 | print(f'Connection to "{url}" is working') 25 | 26 | except URLError as E: 27 | print("Connection error:%s" % E.reason) 28 | 29 | 30 | checkInternetConnectivity() 31 | -------------------------------------------------------------------------------- /chicks_n_rabs.py: -------------------------------------------------------------------------------- 1 | """ 2 | Author Anurag Kumar(mailto:anuragkumarak95@gmail.com) 3 | 4 | Module to solve a classic ancient Chinese puzzle: 5 | We count 35 heads and 94 legs among the chickens and rabbits in a farm. 6 | How many rabbits and how many chickens do we have? 7 | 8 | """ 9 | 10 | 11 | def solve(num_heads, num_legs): 12 | ns = "No solutions!" 13 | for i in range(num_heads + 1): 14 | j = num_heads - i 15 | if 2 * i + 4 * j == num_legs: 16 | return i, j 17 | return ns, ns 18 | 19 | 20 | if __name__ == "__main__": 21 | numheads = 35 22 | numlegs = 94 23 | 24 | solutions = solve(numheads, numlegs) 25 | print(solutions) 26 | -------------------------------------------------------------------------------- /cicd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli_master/database_import_countries.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | url = "https://api.countrystatecity.in/v1/countries" 4 | 5 | headers = {"X-CSCAPI-KEY": "API_KEY"} 6 | 7 | response = requests.request("GET", url, headers=headers) 8 | 9 | print(response.text) 10 | -------------------------------------------------------------------------------- /cloning_a_list.py: -------------------------------------------------------------------------------- 1 | # Python program to copy or clone a list 2 | # Using the Slice Operator 3 | def Cloning(li1): 4 | return li1[:] 5 | 6 | # Driver Code 7 | li1 = [ 8 | 4, 9 | 8, 10 | 2, 11 | 10, 12 | 15, 13 | 18 14 | ] 15 | li2 = Cloning(li1) 16 | print("Original List:", li1) 17 | print("After Cloning:", li2) 18 | -------------------------------------------------------------------------------- /colorma_as_color.py: -------------------------------------------------------------------------------- 1 | import colorama as color 2 | 3 | 4 | from colorama import Fore, Back, Style 5 | 6 | print(Fore.RED + "some red text") 7 | print(Back.GREEN + "and with a green background") 8 | print("So any text will be in green background?") 9 | 10 | print("So is it a wrapper of some sort?") 11 | print("dark_angel wasn't using it in her code.") 12 | print("she was just being using direct ANSI codes.") 13 | print(Style.RESET_ALL) 14 | print(Fore.BRIGHT_RED + "some bright red text") 15 | print(Back.WHITE + "and with a white background") 16 | print("Will need to study about what is ANSI codes.") 17 | print(Style.DIM + "and in dim text") 18 | print(Style.RESET_ALL) 19 | print("back to normal now") 20 | 21 | 22 | # …or, Colorama can be used in conjunction with existing ANSI libraries such as the venerable Termcolor the fabulous Blessings, or the incredible _Rich. -------------------------------------------------------------------------------- /compass_code.py: -------------------------------------------------------------------------------- 1 | def degree_to_direction(deg): 2 | directions = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] 3 | 4 | deg = deg% 360 5 | deg = int(deg//45) 6 | print(directions[deg]) 7 | 8 | degree_to_direction(45) -------------------------------------------------------------------------------- /consonant.py: -------------------------------------------------------------------------------- 1 | my_string = input("Enter a string to count number of consonants: ") 2 | string_check = [ 3 | "a", 4 | "e", 5 | "i", 6 | "o", 7 | "u", 8 | "A", 9 | "E", 10 | "I", 11 | "O", 12 | "U", 13 | ] # list for checking vowels 14 | 15 | 16 | def count_con(string): 17 | c = 0 18 | for i in range(len(string)): 19 | if ( 20 | string[i] not in string_check 21 | ): # counter increases if the character is not vowel 22 | c += 1 23 | return c 24 | 25 | 26 | counter = count_con(my_string) 27 | print(f"Number of consonants in {my_string} is {counter}.") 28 | -------------------------------------------------------------------------------- /contribution.txt: -------------------------------------------------------------------------------- 1 | Add a dark mode toggle for better UX 2 | -------------------------------------------------------------------------------- /convert celsius into fahrenheit.py: -------------------------------------------------------------------------------- 1 | cels= float(input("enter temp in celsius")) 2 | print("temprature in celsius is :",cels) 3 | fahr = cels*9/5+32 4 | print("temprature in fahrenhite is :",fahr) 5 | -------------------------------------------------------------------------------- /convert_wind_direction_to_degrees.py: -------------------------------------------------------------------------------- 1 | def degrees_to_compass(degrees): 2 | directions = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] 3 | index = round(degrees / 45) % 8 4 | return directions[index] 5 | 6 | # Taking input from the user 7 | while True: 8 | try: 9 | degrees = float(input("Enter the wind direction in degrees (0-359): ")) 10 | if degrees < 0 or degrees >= 360: 11 | raise ValueError("Degrees must be between 0 and 359") 12 | break 13 | except ValueError as ve: 14 | print(f"Error: {ve}") 15 | continue 16 | 17 | 18 | compass_direction = degrees_to_compass(degrees) 19 | print(f"{degrees} degrees is {compass_direction}") 20 | -------------------------------------------------------------------------------- /count the numbers of two vovels.py: -------------------------------------------------------------------------------- 1 | # Program to count the number of each vowels 2 | 3 | # string of vowels 4 | vowels = 'aeiou' 5 | 6 | ip_str = 'Hello, have you tried our tutorial section yet?' 7 | 8 | # make it suitable for caseless comparisions 9 | ip_str = ip_str.casefold() 10 | 11 | # make a dictionary with each vowel a key and value 0 12 | count = {}.fromkeys(vowels,0) 13 | 14 | # count the vowels 15 | for char in ip_str: 16 | if char in count: 17 | count[char] += 1 18 | 19 | print(count) 20 | -------------------------------------------------------------------------------- /create password validity in python.py: -------------------------------------------------------------------------------- 1 | import time 2 | pwd=input("Enter your password: ") #any password u want to set 3 | 4 | def IInd_func(): 5 | count1=0 6 | for j in range(5): 7 | a=0 8 | count=0 9 | user_pwd = input("Enter remember password: ") #password you remember 10 | for i in range(len(pwd)): 11 | if user_pwd[i] == pwd[a]: #comparing remembered pwd with fixed pwd 12 | a +=1 13 | count+=1 14 | if count==len(pwd): 15 | print("correct pwd") 16 | break 17 | else: 18 | count1 += 1 19 | print("not correct") 20 | if count1==5: 21 | time.sleep(30) 22 | IInd_func() 23 | 24 | IInd_func() -------------------------------------------------------------------------------- /cricket_live_score.py: -------------------------------------------------------------------------------- 1 | from urllib.request import urlopen as uReq 2 | 3 | from bs4 import BeautifulSoup as soup 4 | 5 | my_url = "http://www.cricbuzz.com/" 6 | Client = uReq(my_url) 7 | 8 | html_page = Client.read() 9 | Client.close() 10 | 11 | soup_page = soup(html_page, "html.parser") 12 | 13 | score_box = soup_page.findAll("div", {"class": "cb-col cb-col-25 cb-mtch-blk"}) 14 | score_box_len = len(score_box) 15 | print(score_box_len) 16 | for i in range(score_box_len): 17 | print(score_box[i].a["title"]) 18 | print(score_box[i].a.text) 19 | print() 20 | -------------------------------------------------------------------------------- /cricket_news.py: -------------------------------------------------------------------------------- 1 | from bs4 import BeautifulSoup 2 | import requests 3 | import pyttsx3 4 | 5 | engine = pyttsx3.init() 6 | voices = engine.getProperty("voices") 7 | engine.setProperty("voice", voices[0].id) 8 | 9 | 10 | def speak(audio): 11 | engine.say(audio) 12 | engine.runAndWait() 13 | 14 | 15 | url = "https://www.cricbuzz.com/cricket-news/latest-news" 16 | 17 | ans = requests.get(url) 18 | 19 | soup = BeautifulSoup(ans.content, "html.parser") 20 | 21 | anchors = soup.find_all("a", class_="cb-nws-hdln-ancr text-hvr-underline") 22 | i = 1 23 | speak("Welcome to sports news headlines!") 24 | for anchor in anchors: 25 | speak(anchor.get_text()) 26 | i += 1 27 | if i == 11: 28 | break 29 | speak("Moving on next sports headline..") 30 | speak("These all are major headlines, have a nice day SIR") 31 | -------------------------------------------------------------------------------- /currency converter/README.md: -------------------------------------------------------------------------------- 1 | # Currency-Calculator-Dynamic 2 | Currency calculator which will fetch the latest and tell you the exact. 3 | 4 | pip installations:- 5 | 6 | pip install bs4 7 | pip install requests 8 | pip install pyqt5 9 | 10 | thank you for using our currency calculator ! 11 | :) 12 | -------------------------------------------------------------------------------- /data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/data.db -------------------------------------------------------------------------------- /date-timeclient.py: -------------------------------------------------------------------------------- 1 | import socket 2 | 3 | soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 4 | soc.connect((socket.gethostname(), 2905)) 5 | recmsg = soc.recv(1024) 6 | soc.close() 7 | print("The time got from the server is %s" % recmsg.decode("ascii")) 8 | -------------------------------------------------------------------------------- /date-timeserver.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import time 3 | 4 | soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 5 | soc.bind((socket.gethostname(), 2905)) 6 | soc.listen(5) 7 | while True: 8 | 9 | clientsocket, addr = soc.accept() 10 | 11 | print("estavlishes a connection from %s" % str(addr)) 12 | currentTime = time.ctime(time.time()) + "\r\n" 13 | clientsocket.send(currentTime.encode("ascii")) 14 | clientsocket.close() 15 | -------------------------------------------------------------------------------- /dec_to_hex.py: -------------------------------------------------------------------------------- 1 | dec_num = input("Enter the decimal number\n") 2 | print(hex(int(dec_num))) 3 | -------------------------------------------------------------------------------- /decimal to binary.py: -------------------------------------------------------------------------------- 1 | def decimalToBinary(num): 2 | """This function converts decimal number 3 | to binary and prints it""" 4 | if num > 1: 5 | decimalToBinary(num // 2) 6 | print(num % 2, end='') 7 | 8 | 9 | # decimal number 10 | number = int(input("Enter any decimal number: ")) 11 | 12 | decimalToBinary(number) 13 | -------------------------------------------------------------------------------- /dialogs/README.md: -------------------------------------------------------------------------------- 1 | [Quo](https://pypi.org/project/quo) ships with a high level API for displaying dialog boxes to the user for informational purposes, or get input from the user. 2 | -------------------------------------------------------------------------------- /dialogs/messagebox.py: -------------------------------------------------------------------------------- 1 | # Use the MessageBox() function to display a simple message box. 2 | 3 | from quo.dialog import MessageBox 4 | 5 | MessageBox( 6 | title='Example dialog window', 7 | text='Do you want to continue?') 8 | -------------------------------------------------------------------------------- /dialogs/requirements.txt: -------------------------------------------------------------------------------- 1 | quo>=2022.4 2 | -------------------------------------------------------------------------------- /diamond.py: -------------------------------------------------------------------------------- 1 | def draw_diamond(n): 2 | if n % 2 != 0: 3 | k = 1 4 | while k <= n: 5 | print(" " * int((n - k) / 2) + "*" * k + " " * int((n - k) / 2)) 6 | k += 2 7 | 8 | j = 1 9 | while (n - 2 * j) >= 1: 10 | print(" " * j + "*" * (n - 2 * j) + " " * (j)) 11 | j += 1 12 | else: 13 | print("Not an odd number. Can't draw a diamond :(") 14 | 15 | 16 | n = int(input("Enter an odd number: ")) 17 | draw_diamond(n) 18 | -------------------------------------------------------------------------------- /different model output: -------------------------------------------------------------------------------- 1 | Model Output 2 | 3 | Decision tree : 4 | Mean: 4.207225187158817 5 | Standard deviation: 0.8745567547159991 6 | 7 | linear Regression : 8 | Mean: 5.030437102767307 9 | Standard deviation: 1.0607661158294834 10 | 11 | Random forest regressor: 12 | Mean: 3.3009631251857217 13 | Standard deviation: 0.7076841067486248 -------------------------------------------------------------------------------- /divisors_of_a_number.py: -------------------------------------------------------------------------------- 1 | a = 0 2 | while a<= 0 : 3 | number_to_divide = input("choose the number to divide -->") 4 | try : 5 | a = int(number_to_divide) 6 | except ValueError : 7 | a = 0 8 | if a <= 0 : 9 | print('choose a number grether than 0') 10 | list_number_divided = [] 11 | 12 | for number in range(1,a + 1) : 13 | b = a % number 14 | if b == 0 : 15 | list_number_divided.append(number) 16 | print('\nthe number ' + number_to_divide + ' can be divided by:') 17 | for item in list_number_divided : 18 | print(f'{item}') 19 | if len(list_number_divided) <= 2 : 20 | print(number_to_divide + ' is a prime number') -------------------------------------------------------------------------------- /email id dictionary/README.md: -------------------------------------------------------------------------------- 1 | Write a program to read through the mbox-short.txt and figure out who has sent the greatest number of mail messages. The program looks for 'From ' lines and takes the second word of those lines as the person who sent the mail. The program creates a Python dictionary that maps the sender's mail address to a count of the number of times they appear in the file. After the dictionary is produced, the program reads through the dictionary using a maximum loop to find the most prolific committer. -------------------------------------------------------------------------------- /email id dictionary/dict1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | counts = dict() 4 | mails = list() 5 | fname = input("Enter file name:") 6 | fh = open(fname) 7 | for line in fh: 8 | if not line.startswith("From "): 9 | continue 10 | # if line.startswith('From:'): 11 | # continue 12 | id = line.split() 13 | mail = id[1] 14 | mails.append(mail) 15 | 16 | freq_mail = max(mails, key=mails.count) # To find frequent mail 17 | print(freq_mail, mails.count(freq_mail)) # To find countof frequent mail 18 | 19 | 20 | """ 21 | for x in mails: 22 | counts[x]=counts.get(x,0)+1 23 | bigmail=None 24 | bigvalue=None 25 | for key,value in counts.items(): 26 | if bigvalue==None or bigvalue None: 7 | # fetching a list of articles in json format 8 | bbc_news_page = requests.get(_NEWS_API + bbc_news_api_key).json() 9 | # each article in the list is a dict 10 | for news, article in enumerate(bbc_news_page["articles"], 1): 11 | print(f"{news}.) {article['title']}") 12 | 13 | 14 | if __name__ == "__main__": 15 | fetch_bbc_news(bbc_news_api_key="") 16 | -------------------------------------------------------------------------------- /fibonacci_SIMPLIFIED: -------------------------------------------------------------------------------- 1 | 2 | #printing fibonnaci series till nth element - simplified version for begginers 3 | def print_fibonacci(n): 4 | current_no = 1 5 | prev_no = 0 6 | for i in range(n): 7 | print(current_no, end = " ") 8 | prev_no,current_no = current_no, current_no + prev_no 9 | 10 | print_fibonacci(10) 11 | -------------------------------------------------------------------------------- /fibonici series.py: -------------------------------------------------------------------------------- 1 | nterms = int(input("How many terms? ")) 2 | 3 | # first two terms 4 | n1, n2 = 0, 1 5 | count = 0 6 | 7 | # check if the number of terms is valid 8 | if nterms <= 0: 9 | print("Please enter a positive integer") 10 | elif nterms == 1: 11 | print("Fibonacci sequence upto",nterms,":") 12 | print(n1) 13 | else: 14 | print("Fibonacci sequence:") 15 | while count < nterms: 16 | print(n1) 17 | nth = n1 + n2 18 | # update values 19 | n1 = n2 20 | n2 = nth 21 | count += 1 22 | -------------------------------------------------------------------------------- /finding LCM.py: -------------------------------------------------------------------------------- 1 | 2 | # Python Program to find the L.C.M. of two input number 3 | 4 | def compute_lcm(x, y): 5 | 6 | # choose the greater number 7 | if x > y: 8 | greater = x 9 | else: 10 | greater = y 11 | 12 | while(True): 13 | if((greater % x == 0) and (greater % y == 0)): 14 | lcm = greater 15 | break 16 | greater += 1 17 | 18 | return lcm 19 | 20 | num1 = 54 21 | num2 = 24 22 | 23 | print("The L.C.M. is", compute_lcm(num1, num2)) 24 | -------------------------------------------------------------------------------- /findlargestno.md: -------------------------------------------------------------------------------- 1 | # Python program to find the largest number among the three input numbers 2 | 3 | # change the values of num1, num2 and num3 4 | # for a different result 5 | num1 = 10 6 | num2 = 14 7 | num3 = 12 8 | 9 | # uncomment following lines to take three numbers from user 10 | #num1 = float(input("Enter first number: ")) 11 | #num2 = float(input("Enter second number: ")) 12 | #num3 = float(input("Enter third number: ")) 13 | 14 | if (num1 >= num2) and (num1 >= num3): 15 | largest = num1 16 | elif (num2 >= num1) and (num2 >= num3): 17 | largest = num2 18 | else: 19 | largest = num3 20 | 21 | print("The largest number is", largest) 22 | -------------------------------------------------------------------------------- /flappyBird_pygame/README.md: -------------------------------------------------------------------------------- 1 | Flappy Bird Game in Python 2 | -------------------------------------------------------------------------------- /flappyBird_pygame/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/background.png -------------------------------------------------------------------------------- /flappyBird_pygame/images/bird.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/bird.gif -------------------------------------------------------------------------------- /flappyBird_pygame/images/bird_wing_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/bird_wing_down.png -------------------------------------------------------------------------------- /flappyBird_pygame/images/bird_wing_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/bird_wing_up.png -------------------------------------------------------------------------------- /flappyBird_pygame/images/ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/ground.png -------------------------------------------------------------------------------- /flappyBird_pygame/images/pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/pipe.png -------------------------------------------------------------------------------- /flappyBird_pygame/images/pipe_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/pipe_body.png -------------------------------------------------------------------------------- /flappyBird_pygame/images/pipe_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/flappyBird_pygame/images/pipe_end.png -------------------------------------------------------------------------------- /floodfill/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/floodfill/demo.gif -------------------------------------------------------------------------------- /four_digit_num_combination.py: -------------------------------------------------------------------------------- 1 | """ small script to learn how to print out all 4-digit num""" 2 | 3 | 4 | # ALL the combinations of 4 digit combo 5 | def four_digit_combinations(): 6 | """print out all 4-digit numbers in old way""" 7 | numbers = [] 8 | for code in range(10000): 9 | code = str(code).zfill(4) 10 | print(code) 11 | numbers.append(code) 12 | 13 | 14 | # Same as above but more pythonic 15 | def one_line_combinations(): 16 | """print out all 4-digit numbers""" 17 | numbers = [str(i).zfill(4) for i in range(10000)] 18 | print(numbers) 19 | -------------------------------------------------------------------------------- /friday.py: -------------------------------------------------------------------------------- 1 | import pyttsx3 2 | import os 3 | 4 | var = 1 5 | 6 | while var > 0: 7 | pyttsx3.speak("How can I help you Sir") 8 | print("How can I help you Sir : ", end="") 9 | x = input() 10 | if (("notepad" in x) or ("Notepad" in x)) and ( 11 | ("open" in x) or ("run" in x) or ("Open" in x) or ("Run" in x) 12 | ): 13 | pyttsx3.speak("Here it is , sir") 14 | os.system("notepad") 15 | print("anything more") 16 | -------------------------------------------------------------------------------- /gambler.py: -------------------------------------------------------------------------------- 1 | import random 2 | from sys import argv 3 | 4 | stake = int(argv[1]) 5 | goals = int(argv[2]) 6 | trials = int(argv[3]) 7 | 8 | wins = 0 9 | bets = 0 10 | 11 | for i in range(trials): 12 | cash = stake 13 | while cash > 0 and cash < goals: 14 | bets += 1 15 | if random.randrange(0, 2) == 0: 16 | cash += 1 17 | else: 18 | cash -= 1 19 | if cash == goals: 20 | wins += 1 21 | print("Your won: " + str(100 * wins // trials) + "$") 22 | print("Your bets: " + str(bets // trials)) 23 | -------------------------------------------------------------------------------- /game_of_life/sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/game_of_life/sample.gif -------------------------------------------------------------------------------- /gcd.py: -------------------------------------------------------------------------------- 1 | """ 2 | although there is function to find gcd in python but this is the code which 3 | takes two inputs and prints gcd of the two. 4 | """ 5 | a = int(input("Enter number 1 (a): ")) 6 | b = int(input("Enter number 2 (b): ")) 7 | 8 | i = 1 9 | gcd=-1 10 | while i <= a and i <= b: 11 | if a % i == 0 and b % i == 0: 12 | gcd = i 13 | i = i + 1 14 | 15 | print("\nGCD of {0} and {1} = {2}".format(a, b, gcd)) 16 | -------------------------------------------------------------------------------- /generate_permutations.py: -------------------------------------------------------------------------------- 1 | def generate(A,k): 2 | if k ==1: 3 | print(A) 4 | return 5 | else: 6 | for i in range(k): 7 | generate(A,k-1) 8 | if(i= num2) and (num1 >= num3): 15 | largest = num1 16 | elif (num2 >= num1) and (num2 >= num3): 17 | largest = num2 18 | else: 19 | largest = num3 20 | 21 | print("The largest number is", largest) 22 | -------------------------------------------------------------------------------- /greattwono: -------------------------------------------------------------------------------- 1 | # Python Program to find the largest of two numbers using an arithmetic operator 2 | a = int(input("Enter the first number: ")) 3 | b = int(input("Enter the second number: ")) 4 | if(a - b > 0): 5 | print(a, "is greater") 6 | else: 7 | print(b, "is greater") 8 | -------------------------------------------------------------------------------- /how to add three numbers and find type in python.py: -------------------------------------------------------------------------------- 1 | #python program for adding three no. 2 | x=45 3 | y=75 4 | z=25 5 | t=x+y+z 6 | print(t) 7 | #type of output 8 | print(type(t)) 9 | -------------------------------------------------------------------------------- /how to display the fibonacci sequence up to n-.py: -------------------------------------------------------------------------------- 1 | # Program to display the Fibonacci sequence up to n-th term 2 | 3 | nterms = int(input("How many terms? ")) 4 | 5 | # first two terms 6 | n1, n2 = 0, 1 7 | count = 0 8 | 9 | # check if the number of terms is valid 10 | if nterms <= 0: 11 | print("Please enter a positive integer") 12 | elif nterms == 1: 13 | print("Fibonacci sequence upto",nterms,":") 14 | print(n1) 15 | else: 16 | print("Fibonacci sequence:") 17 | while count < nterms: 18 | print(n1) 19 | nth = n1 + n2 20 | # update values 21 | n1 = n2 22 | n2 = nth 23 | count += 1 24 | -------------------------------------------------------------------------------- /image2pdf/requirements.txt: -------------------------------------------------------------------------------- 1 | pillow 2 | -------------------------------------------------------------------------------- /img/hand1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/img/hand1.jpg -------------------------------------------------------------------------------- /importerror.txt: -------------------------------------------------------------------------------- 1 | In a normal python: 2 | 3 | pip install pywin32 4 | In anaconda: 5 | 6 | conda install pywin32 7 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /index.py: -------------------------------------------------------------------------------- 1 | num = 11 2 | #Negative numbers, 0 and 1 are not primes 3 | if num > 1: 4 | 5 | # Iterate from 2 to n // 2 6 | for i in range(2, (num//2)+1): 7 | 8 | # If num is divisible by any number between 9 | #2 and n / 2, it is not prime 10 | if (num % i) == 0: 11 | print(num, "is not a prime number") 12 | break 13 | else: 14 | print(num, "is a prime number") 15 | else: 16 | print(num, "is not a prime number") 17 | -------------------------------------------------------------------------------- /insta_image_saving/driver/driver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/insta_image_saving/driver/driver.exe -------------------------------------------------------------------------------- /insta_image_saving/driver/file: -------------------------------------------------------------------------------- 1 | this is the chrome driver folder. 2 | -------------------------------------------------------------------------------- /insta_image_saving/instructions.txt: -------------------------------------------------------------------------------- 1 | INSTRUCTIONS FOR SUCCESSFUL OPERATION : 2 | 3 | --> hardcode variable "instaccountlink" with desired instagram URL 4 | --> hardcode variable "instaaccountname" with desired name 5 | --> hardcode variable "file" with desired output name 6 | --> set condition for scrolling, i.e. variable "i" which is by default set to 300 7 | --> you may need to redefine HTML tags used, as these are regularly changed as per INSTAGRAM security concerns, the HTML tags used here is latest as per best of my knowledge. -------------------------------------------------------------------------------- /insta_image_saving/output/file: -------------------------------------------------------------------------------- 1 | this is the output folder for saving images. 2 | -------------------------------------------------------------------------------- /insta_image_saving/readme.txt: -------------------------------------------------------------------------------- 1 | THIS A JUPYTER NOTEBOOK FILE THAT CAN SAVE ALL OR SOME IMAGES FROM A PUBLIC INSTAGRAM URL AS PER USER'S DIRECTIVES. 2 | -------------------------------------------------------------------------------- /insta_monitering/con_file.py: -------------------------------------------------------------------------------- 1 | host = "localhost" 2 | mongoPort = 27017 3 | SOCKS5_PROXY_PORT = 1080 4 | auth = "" 5 | passcode = "" 6 | 7 | # if proxy is not working please update the auth and passcode 8 | -------------------------------------------------------------------------------- /insta_monitering/ipList.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/insta_monitering/ipList.txt -------------------------------------------------------------------------------- /insta_monitering/subpinsta.py: -------------------------------------------------------------------------------- 1 | # trggering the process 2 | import os 3 | import subprocess 4 | import sys 5 | 6 | 7 | def instasubprocess(user, tags, type, productId): 8 | try: 9 | child_env = sys.executable 10 | file_pocessing = ( 11 | os.getcwd() 12 | + "/insta_datafetcher.py " 13 | + user 14 | + " " 15 | + tags 16 | + " " 17 | + type 18 | + " " 19 | + productId 20 | ) 21 | command = child_env + " " + file_pocessing 22 | result = subprocess.Popen(command, shell=True) 23 | result.wait() 24 | except: 25 | print("error::instasubprocess>>", sys.exc_info()[1]) 26 | 27 | 28 | if __name__ == "__main__": 29 | instasubprocess(user="u2", tags="food", type="hashtags", productId="abc") 30 | -------------------------------------------------------------------------------- /iprint.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | 3 | txt = input("") 4 | 5 | ap = "" 6 | 7 | for let in range(len(txt) - 1): 8 | ap += txt[let] 9 | print(ap, end="\r") 10 | sleep(0.1) 11 | 12 | print(txt, end="") 13 | -------------------------------------------------------------------------------- /kilo_to_miles.py: -------------------------------------------------------------------------------- 1 | user= float(input("enter kilometers here.. ")) 2 | miles= user*0.621371 3 | print(f"{user} kilometers equals to {miles:.2f} miles") 4 | 5 | -------------------------------------------------------------------------------- /large_files_reading.py: -------------------------------------------------------------------------------- 1 | with open("new_project.txt", "r" , encoding="utf-8") as file: # replace "largefile.text" with your actual file name or with absoulte path 2 | # encoding = "utf-8" is especially used when the file contains special characters.... 3 | for f in file: 4 | print(f.strip()) 5 | -------------------------------------------------------------------------------- /largestno.py: -------------------------------------------------------------------------------- 1 | # Python Program to find Largest of two Numbers using if-else statements 2 | a = int(input("Enter the first number: ")) 3 | b = int(input("Enter the second number: ")) 4 | if(a >= b): 5 | print(a, "is greater") 6 | else: 7 | print(b, "is greater") 8 | -------------------------------------------------------------------------------- /leap year.py: -------------------------------------------------------------------------------- 1 | # Python program to check if year is a leap year or not 2 | 3 | year = 2000 4 | 5 | # To get year (integer input) from the user 6 | # year = int(input("Enter a year: ")) 7 | 8 | if (year % 4) == 0: 9 | if (year % 100) == 0: 10 | if (year % 400) == 0: 11 | print("{0} is a leap year".format(year)) 12 | else: 13 | print("{0} is not a leap year".format(year)) 14 | else: 15 | print("{0} is a leap year".format(year)) 16 | else: 17 | print("{0} is not a leap year".format(year)) 18 | -------------------------------------------------------------------------------- /length.py: -------------------------------------------------------------------------------- 1 | # User inputs the string and it gets stored in variable str 2 | str = input("Enter a string: ") 3 | 4 | # counter variable to count the character in a string 5 | counter = 0 6 | for s in str: 7 | counter = counter + 1 8 | print("Length of the input string is:", counter) 9 | -------------------------------------------------------------------------------- /letter_frequency.py: -------------------------------------------------------------------------------- 1 | # counting the number of occurrences of a letter in a string using defaultdict 2 | # left space in starting for clarity 3 | from collections import defaultdict 4 | 5 | s = "mississippi" 6 | d = defaultdict(int) 7 | for k in s: 8 | d[k] += 1 9 | sorted(d.items()) 10 | print(d) 11 | 12 | # OUTPUT --- [('i', 4), ('m', 1), ('p', 2), ('s', 4)] 13 | -------------------------------------------------------------------------------- /linear search.py: -------------------------------------------------------------------------------- 1 | #Author : ShankRoy 2 | 3 | def linearsearch(arr, x): 4 | for i in range(len(arr)): 5 | if arr[i] == x: 6 | return i 7 | return -1 8 | arr = ['t','u','t','o','r','i','a','l'] 9 | x = 'a' 10 | print("element found at index "+str(linearsearch(arr,x))) 11 | -------------------------------------------------------------------------------- /linear-algebra-python/src/lib.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/linear-algebra-python/src/lib.pyc -------------------------------------------------------------------------------- /linear_search.py: -------------------------------------------------------------------------------- 1 | num = int(input("Enter size of list: \t")) 2 | list = [int(input("Enter any number: \t")) for _ in range(num)] 3 | 4 | x = int(input("\nEnter number to search: \t")) 5 | 6 | for position, number in enumerate(list): 7 | if number == x: 8 | print(f"\n{x} found at position {position}") 9 | else: 10 | print(f"list: {list}") 11 | print(f"{x} is not in list") -------------------------------------------------------------------------------- /live_sketch.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | 4 | def sketch(image): 5 | img_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 6 | img_gray_blur = cv2.GaussianBlur(img_gray, (5, 5), 0) 7 | canny_edges = cv2.Canny(img_gray_blur, 10, 70) 8 | ret, mask = cv2.threshold(canny_edges, 70, 255, cv2.THRESH_BINARY_INV) 9 | return mask 10 | 11 | 12 | cap = cv2.VideoCapture(0) 13 | 14 | while True: 15 | ret, frame = cap.read() 16 | cv2.imshow("Our Live Sketcher", sketch(frame)) 17 | if cv2.waitKey(1) == 13: 18 | break 19 | 20 | cap.release() 21 | cv2.destroyAllWindows() 22 | -------------------------------------------------------------------------------- /longest_increasing_subsequence_length.py: -------------------------------------------------------------------------------- 1 | """ 2 | Author- DIWAKAR JAISWAL 3 | find lenth Longest increasing subsequence of given array. 4 | """ 5 | 6 | 7 | def lis(a): 8 | n = len(a) 9 | # initialize ans array same lenth as 1 10 | ans = [1] * n 11 | for i in range(1, n): 12 | # now compare with first index to that index 13 | for j in range(i): 14 | if a[i] > a[j] and ans[i] < ans[j] + 1: 15 | ans[i] = ans[j] + 1 16 | return max(ans) 17 | 18 | 19 | a = [1, 3, 2, 6, 4] 20 | 21 | # longest increasing subsequence=[{1<3<6},{1<3<4},{1<2<6},{1<2<4}] length is 3 22 | 23 | print("Maximum Length of longest increasing subsequence ", lis(a)) 24 | -------------------------------------------------------------------------------- /love_turtle.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | 4 | def heart_red(): 5 | t = turtle.Turtle() 6 | turtle.title("I Love You") 7 | screen = turtle.Screen() 8 | screen.bgcolor("white") 9 | t.color("red") 10 | t.begin_fill() 11 | t.fillcolor("red") 12 | 13 | t.left(140) 14 | t.forward(180) 15 | t.circle(-90, 200) 16 | 17 | t.setheading(60) # t.left 18 | t.circle(-90, 200) 19 | t.forward(180) 20 | 21 | t.end_fill() 22 | t.hideturtle() 23 | 24 | turtle.done() 25 | 26 | 27 | if __name__ == "__main__": 28 | heart_red() 29 | -------------------------------------------------------------------------------- /mapit.py: -------------------------------------------------------------------------------- 1 | import sys, webbrowser, pyperclip 2 | 3 | if len(sys.argv) > 1: 4 | address = " ".join(sys.argv[1:]) 5 | 6 | elif len(pyperclip.paste()) > 2: 7 | address = pyperclip.paste() 8 | else: 9 | address = input("enter your palce") 10 | webbrowser.open("https://www.google.com/maps/place/" + address) 11 | -------------------------------------------------------------------------------- /mathfunctions: -------------------------------------------------------------------------------- 1 | x = min(65, 90, 65) 2 | y = max(2, 8, 10) 3 | 4 | print(x) 5 | print(y) 6 | -------------------------------------------------------------------------------- /missing number from list.py: -------------------------------------------------------------------------------- 1 | # program to find a missing number from a list. 2 | 3 | 4 | def missing_number(num_list): 5 | return sum(range(num_list[0], num_list[-1] + 1)) - sum(num_list) 6 | 7 | 8 | print(missing_number([1, 2, 3, 4, 6, 7, 8])) 9 | 10 | print(missing_number([10, 11, 12, 14, 15, 16, 17])) 11 | -------------------------------------------------------------------------------- /multiplication_table.py: -------------------------------------------------------------------------------- 1 | """ 2 | The 'multiplication table' Implemented in Python 3 3 | 4 | Syntax: 5 | python3 multiplication_table.py [rows columns] 6 | Separate filenames with spaces as usual. 7 | 8 | Updated by Borys Baczewski (BB_arbuz on GitHub) - 06/03/2022 9 | """ 10 | 11 | from sys import argv # import argument variable 12 | 13 | ( 14 | script, 15 | rows, 16 | columns, 17 | ) = argv # define rows and columns for the table and assign them to the argument variable 18 | 19 | 20 | def table(rows, columns): 21 | columns = int(columns) 22 | rows = int(rows) 23 | for r in range(1, rows+1): 24 | c = r 25 | print(r, end='\t') 26 | i = 0 27 | while columns-1 > i: 28 | print(c+r, end='\t') 29 | c = c+r 30 | i += 1 31 | print('\n') 32 | 33 | 34 | table(rows, columns) 35 | -------------------------------------------------------------------------------- /nDigitNumberCombinations.py: -------------------------------------------------------------------------------- 1 | # ALL the combinations of n digit combo 2 | def nDigitCombinations(n): 3 | try: 4 | npow = 10 ** n 5 | numbers = [] 6 | for code in range(npow): 7 | code = str(code).zfill(n) 8 | numbers.append(code) 9 | except Exception: 10 | # handle all other exceptions 11 | pass 12 | return numbers 13 | 14 | 15 | # An alternate solution: 16 | # from itertools import product 17 | # from string import digits 18 | # list("".join(x) for x in product(digits, repeat=n)) 19 | -------------------------------------------------------------------------------- /nasa_apod_with_requests/README.md: -------------------------------------------------------------------------------- 1 | you need to get your key at https://api.nasa.gov/ and put it in settings.py as a string with the name of key 2 | 3 | it will save the image inside a folder named img inside the project folder 4 | have fun! -------------------------------------------------------------------------------- /nasa_apod_with_requests/settings.py: -------------------------------------------------------------------------------- 1 | key = "" 2 | -------------------------------------------------------------------------------- /new.py: -------------------------------------------------------------------------------- 1 | def hello_world(): 2 | """ 3 | Prints a greeting message. 4 | """ 5 | print("Hello, world!") 6 | 7 | 8 | if __name__ == "__main__": 9 | hello_world() 10 | -------------------------------------------------------------------------------- /new_pattern.py: -------------------------------------------------------------------------------- 1 | #pattern 2 | #@@@@@@@@ $ 3 | #@@@@@@@ $$ 4 | #@@@@@@ $$$ 5 | #@@@@@ $$$$ 6 | #@@@@ $$$$$ 7 | #@@@ $$$$$$ 8 | #@@ $$$$$$$ 9 | #@ $$$$$$$$ 10 | 11 | def main(): 12 | lines = int(input("Enter no.of lines: ")) 13 | pattern(lines) 14 | 15 | def pattern(lines): 16 | t = 1 17 | for i in range(lines,0,-1): 18 | nxt_pattern = "$"*t 19 | pattern = "@"*(i) 20 | final_pattern = pattern + " " + nxt_pattern 21 | print(final_pattern) 22 | t = t +1 23 | 24 | if __name__ == "__main__": 25 | main() 26 | -------------------------------------------------------------------------------- /next_number.py: -------------------------------------------------------------------------------- 1 | x, li, small, maxx, c = input(), list(), 0, 0, 1 2 | for i in range(len(x)): 3 | li.append(int(x[i])) 4 | for i in range(len(li) - 1, -1, -1): 5 | if i == 0: 6 | print("No Number Possible") 7 | c = 0 8 | break 9 | if li[i] > li[i - 1]: 10 | small = i - 1 11 | maxx = i 12 | break 13 | for i in range(small + 1, len(li)): 14 | if li[i] > li[small] and li[i] < li[maxx]: 15 | maxx = i 16 | li[small], li[maxx] = li[maxx], li[small] 17 | li = li[: small + 1] + sorted(li[small + 1 :]) 18 | if c: 19 | for i in range(len(li)): 20 | print(li[i], end="") 21 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/JARVIS_python_bot/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "extention", 4 | "gtts", 5 | "initialisation", 6 | "mspaint", 7 | "myobj", 8 | "openai", 9 | "playsound", 10 | "pynput", 11 | "pyttsx", 12 | "stickynot", 13 | "Stiky", 14 | "stikynot", 15 | "takecommand", 16 | "whenver", 17 | "wishme", 18 | "yourr" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/JARVIS_python_bot/README.md: -------------------------------------------------------------------------------- 1 | # JARVIS 2 | patch-5
3 | It can Control windows programs with your voice.
4 | What can it do: 5 | 1. It can tell you time.
6 | 2. It can open, These of the following:-
a.) Notepad
7 | b.) Calculator
8 | c.) Sticky Note
9 | d.) PowerShell
10 | e.) MS Paint
11 | f.) cmd
12 | g.) Browser (Internet Explorer)
13 | 14 | It will make your experience better while using the Windows computer. 15 | =========================================================================== 16 | It demonstrates Controlling windows programs with your voice. 17 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/JARVIS_python_bot/features_to_add.py: -------------------------------------------------------------------------------- 1 | # imports modules 2 | import sys 3 | import time 4 | from getpass import getuser 5 | 6 | # user puts in their name 7 | name = getuser() 8 | name_check = input("Is your name " + name + "? → ") 9 | if name_check.lower().startswith("y"): 10 | print("Okay.") 11 | time.sleep(1) 12 | 13 | if name_check.lower().startswith("n"): 14 | name = input("Then what is it? → ") 15 | 16 | # Can add this feature to the Jarvis. 17 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/JARVIS_python_bot/requirements.txt: -------------------------------------------------------------------------------- 1 | datetime 2 | pyjokes 3 | requests 4 | Pillow 5 | Image 6 | ImageGrab 7 | gTTS 8 | keyboard 9 | key 10 | playsound 11 | pyttsx3 12 | SpeechRecognition 13 | openai 14 | pynput 15 | pyaudio 16 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/ToDo_webapp_Screenshot_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nitkarshchourasia/to_sort/django_projects/ToDo_webapp/ToDo_webapp_Screenshot_demo.png -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nitkarshchourasia/to_sort/django_projects/ToDo_webapp/db.sqlite3 -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todo_site.settings") 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == "__main__": 22 | main() 23 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/__init__.py -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Todo 3 | 4 | # Register your models here. 5 | 6 | admin.site.register(Todo) 7 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class TodoConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "todo" 7 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from .models import Todo 3 | 4 | 5 | class TodoForm(forms.ModelForm): 6 | class Meta: 7 | model = Todo 8 | fields = "__all__" 9 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/migrations/__init__.py -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/models.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from django.db import models 3 | from django.utils import timezone 4 | 5 | # Create your models here. 6 | 7 | 8 | class Todo(models.Model): 9 | title = models.CharField(max_length=100) 10 | details = models.TextField() 11 | date = models.DateTimeField(default=timezone.now) 12 | 13 | def __str__(self) -> str: 14 | return self.title 15 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo_site/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo_site/__init__.py -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo_site/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for todo_site project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todo_site.settings") 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/django_projects/ToDo_webapp/todo_site/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for todo_site project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todo_site.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /nitkarshchourasia/to_sort/pdf_to_docx_converter/requirements.txt: -------------------------------------------------------------------------------- 1 | python-docx==0.8.11 2 | PyMuPDF==1.18.17 3 | pytesseract==0.3.8 4 | Pillow==8.4.0 -------------------------------------------------------------------------------- /nodepad/bin/notepad.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nodepad/bin/notepad.pyc -------------------------------------------------------------------------------- /nodepad/bin/notepad_support.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nodepad/bin/notepad_support.pyc -------------------------------------------------------------------------------- /nodepad/img/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/nodepad/img/screenshot.png -------------------------------------------------------------------------------- /nslookup_check.py: -------------------------------------------------------------------------------- 1 | # Script Name : nslookup_check.py 2 | # Author : Craig Richards 3 | # Created : 5th January 2012 4 | # Last Modified : 5 | # Version : 1.0 6 | 7 | # Modifications : 8 | 9 | # Description : This very simple script opens the file server_list.txt and then does a nslookup for each one to check the DNS entry 10 | 11 | import subprocess # Import the subprocess module 12 | 13 | for server in open("server_list.txt"): # Open the file and read each line 14 | subprocess.Popen( 15 | ("nslookup " + server) 16 | ) # Run the nslookup command for each server in the list 17 | -------------------------------------------------------------------------------- /num-py.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | # to check if shape are equal and find there power 4 | def get_array(x, y): 5 | a = np.shape(x) 6 | b = np.shape(y) 7 | 8 | if a == b: 9 | np_pow_array = x ** y 10 | print("Array of powers without using np.power: ", np_pow_array) 11 | 12 | print("Array of powers using np.power: ", np.power(x, y)) 13 | else: 14 | print("Error : Shape of the given arrays is not equal.") 15 | 16 | 17 | # 0d array 18 | np_arr1 = np.array(3) 19 | np_arr2 = np.array(4) 20 | # 1d array 21 | np_arr3 = np.array([1, 2]) 22 | np_arr4 = np.array([3, 4]) 23 | # 2d array 24 | np_arr5 = np.array([[1, 2], [3, 4]]) 25 | np_arr6 = np.array([[5, 6], [7, 8]]) 26 | 27 | get_array(np_arr1, np_arr2) 28 | print() 29 | get_array(np_arr3, np_arr4) 30 | print() 31 | get_array(np_arr5, np_arr6) 32 | -------------------------------------------------------------------------------- /oneeven.py: -------------------------------------------------------------------------------- 1 | # Python Program to Print Even Numbers from 1 to N 2 | 3 | maximum = int(input(" Please Enter the Maximum Value : ")) 4 | 5 | number = 1 6 | 7 | while number <= maximum: 8 | if number % 2 == 0: 9 | print("{0}".format(number)) 10 | number = number + 1 11 | -------------------------------------------------------------------------------- /oryx-build-commands.txt: -------------------------------------------------------------------------------- 1 | PlatformWithVersion=Python 2 | BuildCommands=conda env create --file environment.yml --prefix ./venv --quiet 3 | -------------------------------------------------------------------------------- /output.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/output.pdf -------------------------------------------------------------------------------- /password_checker.py: -------------------------------------------------------------------------------- 1 | import time 2 | pwd="AKS2608" #any password u want to set 3 | 4 | def IInd_func(): 5 | count1=0 6 | for j in range(5): 7 | a=0 8 | count=0 9 | user_pwd = input("") #password you remember 10 | for i in range(len(pwd)): 11 | if user_pwd[i] == pwd[a]: #comparing remembered pwd with fixed pwd 12 | a +=1 13 | count+=1 14 | if count==len(pwd): 15 | print("correct pwd") 16 | break 17 | else: 18 | count1 += 1 19 | print("not correct") 20 | if count1==5: 21 | time.sleep(30) 22 | IInd_func() 23 | 24 | IInd_func() 25 | -------------------------------------------------------------------------------- /polygon.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import sys 3 | from pygame.locals import * 4 | 5 | pygame.init() 6 | window = pygame.display.set_mode((400, 300), 0, 32) 7 | pygame.display.set_caption("Shape") 8 | 9 | WHITE = (255, 255, 255) 10 | GREEN = (0, 255, 0) 11 | 12 | window.fill(WHITE) 13 | pygame.draw.polygon(window, GREEN, ((146, 0), (236, 277), (56, 277))) 14 | 15 | # Game logic 16 | while True: 17 | for event in pygame.event.get(): 18 | if event.type == QUIT: 19 | pygame.quit() 20 | sys.exit() 21 | pygame.display.update() 22 | -------------------------------------------------------------------------------- /positiveNegetive.py: -------------------------------------------------------------------------------- 1 | n = int(input("Enter number: ")) 2 | if n > 0: 3 | print("Number is positive") 4 | else: 5 | print("Number is negative") 6 | -------------------------------------------------------------------------------- /power_of_two.py: -------------------------------------------------------------------------------- 1 | # Simple and efficient python program to check whether a number is series of power of two 2 | # Example: 3 | # Input: 4 | # 8 5 | # Output: 6 | # It comes in power series of 2 7 | a = int(input("Enter a number")) 8 | if a & (a - 1) == 0: 9 | print("It comes in power series of 2") 10 | else: 11 | print("It does not come in power series of 2") 12 | -------------------------------------------------------------------------------- /powers of 2.py: -------------------------------------------------------------------------------- 1 | # Display the powers of 2 using anonymous function 2 | 3 | terms = 10 4 | 5 | # Uncomment code below to take input from the user 6 | # terms = int(input("How many terms? ")) 7 | 8 | # use anonymous function 9 | result = list(map(lambda x: 2 ** x, range(terms))) 10 | 11 | print("The total terms are:",terms) 12 | for i in range(terms): 13 | print("2 raised to power",i,"is",result[i]) 14 | -------------------------------------------------------------------------------- /primelib/Prime.txt: -------------------------------------------------------------------------------- 1 | # Program to check if a number is prime or not 2 | 3 | num = 407 4 | 5 | # To take input from the user 6 | #num = int(input("Enter a number: ")) 7 | 8 | # prime numbers are greater than 1 9 | if num > 1: 10 | # check for factors 11 | for i in range(2,num): 12 | if (num % i) == 0: 13 | print(num,"is not a prime number") 14 | print(i,"times",num//i,"is",num) 15 | break 16 | else: 17 | print(num,"is a prime number") 18 | 19 | # if input number is less than 20 | # or equal to 1, it is not prime 21 | else: 22 | print(num,"is not a prime number") 23 | -------------------------------------------------------------------------------- /print hello world.py: -------------------------------------------------------------------------------- 1 | # This program prints Hello, world! 2 | 3 | print('Hello, world!') 4 | -------------------------------------------------------------------------------- /pyauto.py: -------------------------------------------------------------------------------- 1 | # Author-Slayking1965 2 | # email-kingslayer8509@gmail.com 3 | import random 4 | import pyautogui 5 | import string 6 | 7 | 8 | chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" 9 | 10 | chars = string.printable 11 | chars_list = list(chars) 12 | 13 | 14 | password = pyautogui.password("Enter a password : ") 15 | 16 | guess_password = "" 17 | 18 | while guess_password != password: 19 | guess_password = random.choices(chars_list, k=len(password)) 20 | 21 | print("<==================" + str(guess_password) + "==================>") 22 | 23 | if guess_password == list(password): 24 | print("Your password is : " + "".join(guess_password)) 25 | break 26 | -------------------------------------------------------------------------------- /pyhton_array.py: -------------------------------------------------------------------------------- 1 | from array import * 2 | 3 | array1 = array("i", [10, 20, 30, 40, 50]) 4 | 5 | array1[2] = 80 6 | 7 | for x in array1: 8 | print(x) 9 | -------------------------------------------------------------------------------- /pythagoreanTriplets.py: -------------------------------------------------------------------------------- 1 | limit = int(input("Enter upper limit:")) 2 | c = 0 3 | m = 2 4 | while c < limit: 5 | for n in range(1, m + 1): 6 | a = m * m - n * n 7 | b = 2 * m * n 8 | c = m * m + n * n 9 | if c > limit: 10 | break 11 | if a == 0 or b == 0 or c == 0: 12 | break 13 | print(a, b, c) 14 | m = m + 1 15 | -------------------------------------------------------------------------------- /python program for finding square root for positive number.py: -------------------------------------------------------------------------------- 1 | # Python Program to calculate the square root 2 | 3 | # Note: change this value for a different result 4 | num = 8 5 | 6 | # To take the input from the user 7 | #num = float(input('Enter a number: ')) 8 | 9 | num_sqrt = num ** 0.5 10 | print('The square root of %0.3f is %0.3f'%(num ,num_sqrt)) 11 | -------------------------------------------------------------------------------- /python_codes: -------------------------------------------------------------------------------- 1 | python_codes 2 | print("Python") 3 | -------------------------------------------------------------------------------- /python_webscraper.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | # Make a request on to your website 4 | page = requests.get("Paste your Website Domain here") 5 | soup = BeautifulSoup(page.content, 'html.parser') 6 | 7 | # Create all_h1_tags as empty list 8 | all_h1_tags = [] 9 | 10 | # Set all_h1_tags to all h1 tags of the soup 11 | for element in soup.select('h1'): 12 | all_h1_tags.append(element.text) 13 | 14 | # Create seventh_p_text and set it to 7th p element text of the page 15 | seventh_p_text = soup.select('p')[6].text 16 | 17 | print(all_h1_tags, seventh_p_text) 18 | 19 | # print all h1 elements and the text of the website on your console 20 | -------------------------------------------------------------------------------- /qrcode.py: -------------------------------------------------------------------------------- 1 | 2 | import qrcode 3 | import cv2 4 | 5 | qr= qrcode.QRCode(version=1, box_size=10, border=5) 6 | 7 | data = input() 8 | qr.add_data(data) 9 | qr.make(fit=True) 10 | img = qr.make_image(fill_color="blue", back_color="white") 11 | path=data+".png" 12 | img.save(path) 13 | cv2.imshow("QRCode",img) 14 | cv2.waitKey(0) 15 | cv2.destroyAllWindows() 16 | -------------------------------------------------------------------------------- /qrdecoder.py: -------------------------------------------------------------------------------- 1 | # Importing Required Modules 2 | import cv2 3 | 4 | # QR Code Decoder 5 | 6 | filename = input() 7 | image = cv2.imread(filename) # Enter name of the image 8 | detector = cv2.QRCodeDetector() 9 | data, vertices_array, binary_qrcode = detector.detectAndDecode(image) 10 | if vertices_array is not None: 11 | print(data) 12 | -------------------------------------------------------------------------------- /quote.py: -------------------------------------------------------------------------------- 1 | # Sends inspirational quotes to the user using Zen Quotes API 2 | 3 | # Format 4 | """ 5 | example quote -Quote Author Name 6 | """ 7 | 8 | import requests 9 | from json import loads 10 | 11 | 12 | def return_quote(): 13 | response = requests.get("https://zenquotes.io/api/random") 14 | json_data = loads(response.text) 15 | quote = ( 16 | json_data[0]["q"] + " -" + json_data[0]["a"] 17 | ) # aligning the quote and it's author name in one string 18 | return quote 19 | 20 | 21 | quote = return_quote() 22 | print(quote) 23 | -------------------------------------------------------------------------------- /read_excel_file.py: -------------------------------------------------------------------------------- 1 | # extract number of rows using Python 2 | import xlrd 3 | 4 | # Give the location of the file 5 | loc = "sample.xlsx" 6 | wb = xlrd.open_workbook(loc) 7 | sheet = wb.sheet_by_index(0) 8 | sheet.cell_value(0, 0) 9 | # Extracting number of rows 10 | print(sheet.nrows) 11 | 12 | # extract number of columns in Python 13 | print(sheet.ncols) 14 | 15 | # extracting all columns name in Python 16 | for i in range(sheet.ncols): 17 | print(sheet.cell_value(0, i)) 18 | 19 | # extracting first column 20 | sheet = wb.sheet_by_index(0) 21 | for i in range(sheet.nrows): 22 | print(sheet.cell_value(i, 0)) 23 | 24 | # extract a particular row value 25 | sheet = wb.sheet_by_index(0) 26 | print(sheet.row_values(1)) 27 | -------------------------------------------------------------------------------- /reading_csv.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | # reading csv file into python 4 | df= pd.read_csv("c:\PROJECT\Drug_Recommendation_System\drug_recommendation_system\Drugs_Review_Datasets.csv") # Replace the path with your own file path 5 | 6 | print(df) 7 | 8 | # Basic functions 9 | print(df.info()) # Provides a short summary of the DataFrame 10 | print(df.head()) # prints first 5 rows 11 | print(df.tail()) # prints last 5 rows 12 | print(df.describe()) #statistical summary of numeric columns 13 | print(df.columns) # Returns column names 14 | print(df.shape) # Returns the number of rows and columnsrr 15 | 16 | print(help(pd)) # Use help(pd) to explore and understand the available functions and attributes in the pandas (pd) lib -------------------------------------------------------------------------------- /recursive-fibonacci.py: -------------------------------------------------------------------------------- 1 | def fib(n): 2 | if n == 0 or n == 1: 3 | return n 4 | else: 5 | return fib(n - 1) + fib(n - 2) 6 | -------------------------------------------------------------------------------- /repeat.py: -------------------------------------------------------------------------------- 1 | def Repeat(x): 2 | _size = len(x) 3 | repeated = [] 4 | for i in range(_size): 5 | k = i + 1 6 | for j in range(k, _size): 7 | if x[i] == x[j] and x[i] not in repeated: 8 | repeated.append(x[i]) 9 | return repeated 10 | 11 | 12 | list1 = [10, 20, 30, 20, 20, 30, 40, 50, -20, 60, 60, -20, -20] 13 | print(Repeat(list1)) 14 | -------------------------------------------------------------------------------- /replacetext.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # program to replace all the spaces in an entered string with a hyphen"-" 4 | def replacetext(string): 5 | string = string.replace(" ", "-") 6 | return string 7 | 8 | 9 | S = input("Enter a text to replace all its spaces with hyphens: ") 10 | N = replacetext(S) 11 | print("The changed text is: ", N) 12 | -------------------------------------------------------------------------------- /repo_website/docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/repo_website/docs/img/favicon.ico -------------------------------------------------------------------------------- /reversed_pattern3.py: -------------------------------------------------------------------------------- 1 | #Simple inverted number triangle piramid 2 | #11111 3 | #2222 4 | #333 5 | #44 6 | #5 7 | 8 | def main(): 9 | lines = int(input("Enter no.of lines: ")) 10 | pattern(lines) 11 | 12 | def pattern(lines): 13 | t = 1 14 | for i in reversed(range(1, (lines +1))): 15 | format = str(t)*i 16 | print(format) 17 | t = t + 1 18 | 19 | if __name__ == "__main__": 20 | main() 21 | -------------------------------------------------------------------------------- /rotate_string.py: -------------------------------------------------------------------------------- 1 | def left_rotate(s, val): 2 | s1 = s[0:val] 3 | s2 = s[val:] 4 | return s2 + s1 5 | 6 | 7 | def right_rotate(s, val): 8 | s1 = s[0 : len(s) - val] 9 | s2 = s[len(s) - val :] 10 | return s2 + s1 11 | 12 | 13 | def circular_rotate(s): 14 | s = list(s) 15 | idx = 0 16 | mid = len(s) // 2 17 | for i in reversed(range(mid, len(s))): 18 | s[idx], s[i] = s[i], s[idx] 19 | idx += 1 20 | return s 21 | 22 | 23 | s = "aditya" 24 | print("".join(circular_rotate(s))) 25 | -------------------------------------------------------------------------------- /rotatelist.py: -------------------------------------------------------------------------------- 1 | N = int(input("Enter The Size Of Array")) 2 | list = [] 3 | for i in range(0, N): 4 | temp = int(input("Enter The Intger Numbers")) 5 | list.append(temp) 6 | 7 | 8 | # Rotating Arrays Using Best Way: 9 | # Left Rotation Of The List. 10 | # Let's say we want to print list after its d number of rotations. 11 | 12 | finalList = [] 13 | d = int(input("Enter The Number Of Times You Want To Rotate The Array")) 14 | 15 | for i in range(0, N): 16 | finalList.append(list[(i + d) % N]) 17 | 18 | print(finalList) 19 | 20 | # This Method holds the timeComplexity of O(N) and Space Complexity of O(N) 21 | -------------------------------------------------------------------------------- /sample.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/sample.xlsx -------------------------------------------------------------------------------- /saving_input_into_list.py: -------------------------------------------------------------------------------- 1 | ran= int(input("Enter the range of elements you want to store / insert ")) 2 | l1=[] 3 | for i in range(ran): 4 | l1.append(input("Enter here ")) 5 | 6 | print(l1) 7 | 8 | 9 | """ 10 | program first asks the user how many values they want to enter. Then, using a loop, it lets the user enter that many values one by one. 11 | Each entered value is saved into a list called l1. Once all the values are entered, the program prints the complete list, showing 12 | everything the user typed. It's a beginner-friendly way to learn how to collect multiple inputs and store them for later use. 13 | """ -------------------------------------------------------------------------------- /send_message_automation/README.md: -------------------------------------------------------------------------------- 1 | # Send message automation 2 | 3 | 4 | sources used: 5 | 6 | 7 | Gif image creation credit goes to: 8 | - ezgif.com used to make gif images. -------------------------------------------------------------------------------- /send_message_automation/author_name_NC.txt: -------------------------------------------------------------------------------- 1 | 2 | __ _ _ _ _ ___ _ _ 3 | /\ \ \(_)| |_ | | __ __ _ _ __ ___ | |__ / __\| |__ ___ _ _ _ __ __ _ ___ (_) __ _ 4 | / \/ /| || __|| |/ / / _` || '__|/ __|| '_ \ / / | '_ \ / _ \ | | | || '__| / _` |/ __|| | / _` | 5 | / /\ / | || |_ | < | (_| || | \__ \| | | | / /___ | | | || (_) || |_| || | | (_| |\__ \| || (_| | 6 | \_\ \/ |_| \__||_|\_\ \__,_||_| |___/|_| |_| \____/ |_| |_| \___/ \__,_||_| \__,_||___/|_| \__,_| 7 | 8 | -------------------------------------------------------------------------------- /send_message_automation/automatic_send-message_demo_video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/send_message_automation/automatic_send-message_demo_video.mp4 -------------------------------------------------------------------------------- /send_message_automation/send_message_automation_demo_gif_image.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/send_message_automation/send_message_automation_demo_gif_image.gif -------------------------------------------------------------------------------- /send_message_automation/send_message_automation_demo_video_2.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/send_message_automation/send_message_automation_demo_video_2.mp4 -------------------------------------------------------------------------------- /simpleInterest.py: -------------------------------------------------------------------------------- 1 | principle = float(input("Enter the principle amount:")) 2 | time = int(input("Enter the time(years):")) 3 | rate = float(input("Enter the rate:")) 4 | simple_interest = (principle * time * rate) / 100 5 | print("The simple interest is:", simple_interest) 6 | -------------------------------------------------------------------------------- /simple_calcu.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print(int(input("enter first number..")) + int(input("enter second number.."))) 3 | q= input("press q to quit or press anu key to continue").lower() 4 | if q==" q": 5 | break -------------------------------------------------------------------------------- /size(resolution)image.py: -------------------------------------------------------------------------------- 1 | def jpeg_res(filename): 2 | """ "This function prints the resolution of the jpeg image file passed into it""" 3 | 4 | # open image for reading in binary mode 5 | with open(filename, "rb") as img_file: 6 | 7 | # height of image (in 2 bytes) is at 164th position 8 | img_file.seek(163) 9 | 10 | # read the 2 bytes 11 | a = img_file.read(2) 12 | 13 | # calculate height 14 | height = (a[0] << 8) + a[1] 15 | 16 | # next 2 bytes is width 17 | a = img_file.read(2) 18 | 19 | # calculate width 20 | width = (a[0] << 8) + a[1] 21 | 22 | print("The resolution of the image is", width, "x", height) 23 | 24 | 25 | jpeg_res("img1.jpg") 26 | -------------------------------------------------------------------------------- /slack_message.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | # Created by sarathkaul on 11/11/19 4 | 5 | import json 6 | import urllib.request 7 | 8 | # Set the webhook_url to the one provided by Slack when you create the webhook at https://my.slack.com/services/new/incoming-webhook/ 9 | webhook_url = ( 10 | "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" 11 | ) 12 | slack_data = {"text": "Hi Sarath Kaul"} 13 | 14 | response = urllib.request.Request( 15 | webhook_url, 16 | data=json.dumps(slack_data), 17 | headers={"Content-Type": "application/json"}, 18 | ) 19 | print(response) 20 | # if response.status_code != 200: 21 | # raise ValueError( 22 | # 'Request to slack returned an error %s, the response is:\n%s' 23 | # % (response.status_code, response.text) 24 | # ) 25 | -------------------------------------------------------------------------------- /socket-programming/README.md: -------------------------------------------------------------------------------- 1 | # socket-programming-python 2 | Socket programming in python with client-server with duplex alternate chat(client-server-client-server-....) 3 | 4 | # Client view 5 | 6 | ![client](https://user-images.githubusercontent.com/29729380/55186437-8e9f0b00-51bc-11e9-86fa-5641143db32e.png) 7 | 8 | 9 | # Server view 10 | 11 | ![server](https://user-images.githubusercontent.com/29729380/55186445-92cb2880-51bc-11e9-9e67-40a9368cc6c7.png) 12 | -------------------------------------------------------------------------------- /socket-programming/client.py: -------------------------------------------------------------------------------- 1 | # Note :- Client and Server Must be connected to same Network 2 | # import socket modules 3 | import socket 4 | 5 | # create TCP/IP socket 6 | s = socket.socket() 7 | # take user input ip of server 8 | server = input("Enter Server IP: ") 9 | # bind the socket to the port 12345, and connect 10 | s.connect((server, 12345)) 11 | # receive message from server connection successfully established 12 | data = s.recv(1024).decode("utf-8") 13 | print(server + ": " + data) 14 | 15 | while True: 16 | # send message to server 17 | new_data = str(input("You: ")).encode("utf-8") 18 | s.sendall(new_data) 19 | # receive message from server 20 | data = s.recv(1024).decode("utf-8") 21 | print(server + ": " + data) 22 | 23 | # close connection 24 | s.close() 25 | -------------------------------------------------------------------------------- /socket-programming/requirements.txt: -------------------------------------------------------------------------------- 1 | socket 2 | -------------------------------------------------------------------------------- /square_root.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | def square_root(number): 4 | if number >=0: 5 | print(f"Square root {math.sqrt(number)}") 6 | else: 7 | print("Cannot find square root for the negative numbers..") 8 | while True: 9 | square_root(int(input("enter any number"))) -------------------------------------------------------------------------------- /stone_paper_scissor/utils.py: -------------------------------------------------------------------------------- 1 | def validate(hand): 2 | if hand < 0 or hand > 2: 3 | return False 4 | return True 5 | 6 | 7 | def print_hand(hand, name="Guest"): 8 | hands = ["Rock", "Paper", "Scissors"] 9 | print(name + " picked: " + hands[hand]) 10 | 11 | 12 | def judge(player, computer): 13 | if player == computer: 14 | return "Draw" 15 | elif player == 0 and computer == 1: 16 | return "Lose" 17 | elif player == 1 and computer == 2: 18 | return "Lose" 19 | elif player == 2 and computer == 0: 20 | return "Lose" 21 | else: 22 | return "Win" 23 | -------------------------------------------------------------------------------- /string_palin.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # With slicing -> Reverses the string using string[::-1] 4 | 5 | 6 | string= input("enter a word to check.. ") 7 | copy=string[::-1] 8 | if string == copy: 9 | print("Plaindrome") 10 | else: 11 | print("!") 12 | 13 | # Without slicing –> Reverses the string manually using a loop 14 | reverse_string="" 15 | for i in string: 16 | reverse_string=i+reverse_string 17 | if string == reverse_string: 18 | print(reverse_string) 19 | else: 20 | print("!") -------------------------------------------------------------------------------- /string_rotation.py: -------------------------------------------------------------------------------- 1 | # This program rotates a given string letters by letters 2 | # for example: 3 | # input: "Tie" 4 | # Output: ["ieT", "eTi"] 5 | 6 | 7 | def rotate(n): 8 | a = list(n) 9 | if len(a) == 0: 10 | return print([]) 11 | l = [] 12 | for i in range(1, len(a) + 1): 13 | a = [a[(i + 1) % (len(a))] for i in range(0, len(a))] 14 | l += ["".join(a)] 15 | print(l) 16 | 17 | 18 | string = str(input()) 19 | print("Your input is :", string) 20 | print("The rotation is :") 21 | rotate(string) 22 | 23 | 24 | # Input : Python 25 | # output : 26 | # The rotation is : 27 | # ['ythonp', 'thonpy', 'honpyt', 'onpyth', 'npytho', 'python'] 28 | -------------------------------------------------------------------------------- /sum_of_digits_of_a_number.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | def get_integer_input(prompt, attempts): 4 | for i in range(attempts, 0, -1): 5 | try: 6 | n = int(input(prompt)) 7 | return n 8 | except ValueError: 9 | print("Enter an integer only") 10 | print(f"{i-1} {'chance' if i-1 == 1 else 'chances'} left") 11 | return None 12 | 13 | def sum_of_digits(n): 14 | total = 0 15 | while n > 0: 16 | total += n % 10 17 | n //= 10 18 | return total 19 | 20 | chances = 3 21 | number = get_integer_input("Enter a number: ", chances) 22 | 23 | if number is None: 24 | print("You've used all your chances.") 25 | sys.exit() 26 | 27 | result = sum_of_digits(number) 28 | print(f"The sum of the digits of {number} is: {result}") 29 | -------------------------------------------------------------------------------- /swapping of two numbers: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test.cpp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testlines.py: -------------------------------------------------------------------------------- 1 | # Script Name : testlines.py 2 | # Author : Craig Richards 3 | # Created : 08th December 2011 4 | # Last Modified : 5 | # Version : 1.0 6 | 7 | # Modifications : beven nyamande 8 | 9 | # Description : This is a very simple script that opens up a file and writes whatever is set " 10 | 11 | 12 | def write_to_file(filename, txt): 13 | with open(filename, "w") as file_object: 14 | s = file_object.write(txt) 15 | 16 | 17 | if __name__ == "__main__": 18 | write_to_file("test.txt", "I am beven") 19 | -------------------------------------------------------------------------------- /text to speech: -------------------------------------------------------------------------------- 1 | pip install gTTS 2 | #importing the gTTS library 3 | from gtts import gTTS 4 | #Asking the user for the required text 5 | mt = input("Enter the required text:\t") 6 | #Setting the output language 7 | language = ‘en’ 8 | #Converting text to speech and choosing speed as fast 9 | voice = gTTS(text=mt, lang=language, slow=False) 10 | #Saving the speech as mp3 file 11 | voice.save(“conv.mp3”) 12 | -------------------------------------------------------------------------------- /text-to-audio/hello.txt: -------------------------------------------------------------------------------- 1 | Hello world, this audio was created using GTTS module. 2 | -------------------------------------------------------------------------------- /text-to-audio/hello_world.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/text-to-audio/hello_world.mp3 -------------------------------------------------------------------------------- /text-to-audio/main.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | import os 3 | 4 | # Enter the text in string format which you want to convert to audio 5 | mytext = "Hello World!, this audio is created using GTTS module." 6 | 7 | # Specify the language in which you want your audio 8 | language = "en" 9 | 10 | # Create an instance of gTTS class 11 | myobj = gTTS(text=mytext, lang=language, slow=False) 12 | 13 | # Method to create your audio file in mp3 format 14 | myobj.save("hello_world.mp3") 15 | print("Audio Saved") 16 | 17 | # This will play your audio file 18 | os.system("mpg321 welcome.mp3") 19 | -------------------------------------------------------------------------------- /text-to-audio/requirements.txt: -------------------------------------------------------------------------------- 1 | os 2 | gTTS 3 | -------------------------------------------------------------------------------- /text-to-audio/text-file-to-audio.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | import os 3 | 4 | # Enter the name of your text file 5 | mytextfile = "hello.txt" 6 | 7 | # Specify the language in which you want your audio 8 | language = "en" 9 | 10 | # Get the contents of your file 11 | with open(mytextfile, 'r') as f: 12 | mytext = f.read() 13 | f.close() 14 | 15 | # Create an instance of gTTS class 16 | myobj = gTTS(text=mytext, lang=language, slow=False) 17 | 18 | # Method to create your audio file in mp3 format 19 | myobj.save("hello.mp3") 20 | print("Audio Saved") 21 | 22 | # This will play your audio file 23 | os.system("mpg321 hello.mp3") 24 | -------------------------------------------------------------------------------- /text_to_audio/README.md: -------------------------------------------------------------------------------- 1 | Improvement: Nitkarsh Chourasia 2 | 3 | Improvement made: 4 | Used class 5 | implemented lazy loading 6 | optimised memory by selective importing of modules and it's methods 7 | uses effective exception handling 8 | tested on windows and linux 9 | gui is to be made 10 | Memory optimised 11 | PEP8 compliant 12 | linter friendly : -------------------------------------------------------------------------------- /text_to_audio/author_name_NC.txt: -------------------------------------------------------------------------------- 1 | 2 | __ _ _ _ _ ___ _ _ 3 | /\ \ \(_)| |_ | | __ __ _ _ __ ___ | |__ / __\| |__ ___ _ _ _ __ __ _ ___ (_) __ _ 4 | / \/ /| || __|| |/ / / _` || '__|/ __|| '_ \ / / | '_ \ / _ \ | | | || '__| / _` |/ __|| | / _` | 5 | / /\ / | || |_ | < | (_| || | \__ \| | | | / /___ | | | || (_) || |_| || | | (_| |\__ \| || (_| | 6 | \_\ \/ |_| \__||_|\_\ \__,_||_| |___/|_| |_| \____/ |_| |_| \___/ \__,_||_| \__,_||___/|_| \__,_| 7 | 8 | -------------------------------------------------------------------------------- /text_to_audio/requirements.txt: -------------------------------------------------------------------------------- 1 | gTTS==2.5.4 2 | pygame==2.6.1 3 | -------------------------------------------------------------------------------- /text_to_audio/special_file.txt: -------------------------------------------------------------------------------- 1 | T 2 | e 3 | r 4 | i 5 | 6 | m 7 | a 8 | a 9 | 10 | k 11 | i 12 | 13 | c 14 | h 15 | u 16 | t 17 | , 18 | 19 | b 20 | h 21 | o 22 | s 23 | d 24 | i 25 | k 26 | e 27 | 28 | j 29 | a 30 | k 31 | a 32 | r 33 | 34 | g 35 | a 36 | a 37 | a 38 | n 39 | d 40 | 41 | m 42 | a 43 | a 44 | r 45 | a 46 | a 47 | n 48 | a 49 | a 50 | 51 | c 52 | h 53 | u 54 | t 55 | 56 | m 57 | a 58 | a 59 | a 60 | r 61 | a 62 | a 63 | n 64 | i 65 | 66 | k 67 | e 68 | -------------------------------------------------------------------------------- /thired-party-haarcascade-mustache-on-face/image/avee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/thired-party-haarcascade-mustache-on-face/image/avee.png -------------------------------------------------------------------------------- /thired-party-haarcascade-mustache-on-face/image/mustache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Python/cebd93e7a255490b4e26db2cb249effc32c689c0/thired-party-haarcascade-mustache-on-face/image/mustache.png -------------------------------------------------------------------------------- /to check leap year: -------------------------------------------------------------------------------- 1 | # Python program to check if year is a leap year or not 2 | 3 | year = 2000 4 | 5 | # To get year (integer input) from the user 6 | # year = int(input("Enter a year: ")) 7 | 8 | if (year % 4) == 0: 9 | if (year % 100) == 0: 10 | if (year % 400) == 0: 11 | print("{0} is a leap year".format(year)) 12 | else: 13 | print("{0} is not a leap year".format(year)) 14 | else: 15 | print("{0} is a leap year".format(year)) 16 | else: 17 | print("{0} is not a leap year".format(year)) 18 | -------------------------------------------------------------------------------- /totaldigits.py: -------------------------------------------------------------------------------- 1 | # To Find The Total Number Of Digits In A Number 2 | 3 | N = int(input("Enter The number")) # To remove zeros before the number 4 | count = len(str(N)) 5 | 6 | print(count) 7 | -------------------------------------------------------------------------------- /triangles.py: -------------------------------------------------------------------------------- 1 | max_size = 10 2 | 3 | print( 4 | "(a)" 5 | + " " * (max_size) 6 | + "(b)" 7 | + " " * (max_size) 8 | + "(c)" 9 | + " " * (max_size) 10 | + "(d)" 11 | + " " * (max_size) 12 | ) 13 | 14 | for i in range(1, max_size + 1): 15 | 16 | print("*" * i, end=" " * (max_size - i + 3)) 17 | 18 | print("*" * (max_size - i + 1), end=" " * (i - 1 + 3)) 19 | 20 | print(" " * (i - 1) + "*" * (max_size - i + 1), end=" " * 3) 21 | 22 | print(" " * (max_size - i) + "*" * i) 23 | -------------------------------------------------------------------------------- /tuple.py: -------------------------------------------------------------------------------- 1 | a=(1,2,3,4,5) 2 | print('Individual elements of Tuple are') 3 | for i in a: 4 | print(i,end=' ') 5 | print() 6 | print('Value at index number 3 is:',a[3]) 7 | print('Values from index no 2 are',a[2:]) 8 | print('Length of tuple is',len(a)) 9 | print('Maximum value from tuple is ',max(a)) 10 | print('Minimum value from tuple is ',min(a)) 11 | del a #delete the whole tuple 12 | -------------------------------------------------------------------------------- /ultimate-phone-book/readme.md: -------------------------------------------------------------------------------- 1 | #### THIS PROGRAM USES [GPL V3 LICENSE](../../LICENSE) 2 | 3 | ## contacts 4 | it's an simple phonebook allowing you to add name, contact number and email. 5 | it's just for fun there is no use in real life. 6 | 7 | #### Requirenments 8 | a python interpretor in Windows, terminal will work in Mac & Linux. 9 | 10 | #### How to run? 11 | as a **python3** program 12 | 13 | #### Contributers 14 | created by 15 | [**@JymPatel**](https://github.com/JymPatel) 16 | edited by 17 | (editors can put their names here) 18 | -------------------------------------------------------------------------------- /url_shortner.py: -------------------------------------------------------------------------------- 1 | # Importing the required libraries. 2 | import pyshorteners 3 | 4 | # Taking input from the user. 5 | url = input("Enter URL: ") 6 | 7 | # Creating an instance of the pyshorteners library. 8 | shortener = pyshorteners.Shortener() 9 | 10 | # Shortening the URL using TinyURL. 11 | shortened_URL = shortener.tinyurl.short(url) 12 | 13 | # Displaying the shortened URL. 14 | print(f"Shortened URL: {shortened_URL}") 15 | -------------------------------------------------------------------------------- /video-operations/slow-motion.py: -------------------------------------------------------------------------------- 1 | # author : Avee Chakraborty 2 | # Department of software engineering, Diu 3 | # Bangladesh 4 | 5 | import cv2 6 | 7 | capture = cv2.VideoCapture(0) 8 | fourcc = cv2.VideoWriter_fourcc(*"XVID") 9 | output = cv2.VideoWriter("slowmotion.mp4", fourcc, 5, (640, 480)) 10 | 11 | while True: 12 | ret, frame = capture.read() 13 | output.write(frame) 14 | cv2.imshow("frame", frame) 15 | if cv2.waitKey(1) & 0xFF == ord("x"): 16 | break 17 | 18 | capture.release() 19 | output.release() 20 | cv2.destroyAllWindows() 21 | -------------------------------------------------------------------------------- /video-operations/timelapse.py: -------------------------------------------------------------------------------- 1 | # author : Avee Chakraborty 2 | # Department of software engineering, Diu 3 | # Bangladesh 4 | 5 | 6 | import cv2 7 | 8 | capture = cv2.VideoCapture(0) 9 | fourcc = cv2.VideoWriter_fourcc(*"XVID") 10 | output = cv2.VideoWriter("timelapse.mp4", fourcc, 30, (640, 480)) 11 | 12 | while True: 13 | ret, frame = capture.read() 14 | output.write(frame) 15 | cv2.imshow("frame", frame) 16 | if cv2.waitKey(1) & 0xFF == ord("x"): 17 | break 18 | 19 | capture.release() 20 | output.release() 21 | cv2.destroyAllWindows() 22 | -------------------------------------------------------------------------------- /videodownloder.py: -------------------------------------------------------------------------------- 1 | from pytube import YouTube 2 | 3 | #location where you save. 4 | PATH = "E:/" #to_do 5 | 6 | #link of video. 7 | link=["https://www.youtube.com/watch?v=p8FuTenSWPI", 8 | "https://www.youtube.com/watch?v=JWbnEt3xuos" 9 | ]#list of video links. 10 | for i in link: 11 | try: 12 | yt = YouTube(i) 13 | except: 14 | print("Connection Error") #to handle exception 15 | 16 | #check files with "mp4" extension 17 | mp4files = yt.filter('mp4') 18 | 19 | d_video = yt.get(mp4files[-1].extension,mp4files[-1].resolution) 20 | try: 21 | d_video.download(PATH) 22 | except: 23 | print("Some Error!") 24 | print('Task Completed!') 25 | -------------------------------------------------------------------------------- /voice.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | import os 3 | 4 | # Define the text you want to convert to speech 5 | text = "Hello! This is a sample text to convert to speech." 6 | 7 | # Create a gTTS object 8 | tts = gTTS(text=text, lang='en') 9 | 10 | # Save the audio file 11 | tts.save("output.mp3") 12 | 13 | # Play the audio file 14 | os.system("start output.mp3") 15 | -------------------------------------------------------------------------------- /vowel remover function.py: -------------------------------------------------------------------------------- 1 | def vowel_remover(text): 2 | string = "" 3 | for l in text: 4 | if l.lower() not in "aeiou": 5 | string += l 6 | return string 7 | print(vowel_remover("hello world!")) 8 | -------------------------------------------------------------------------------- /wiki/requirements.txt: -------------------------------------------------------------------------------- 1 | wikipedia 2 | tkinter 3 | -------------------------------------------------------------------------------- /wikipedia.py: -------------------------------------------------------------------------------- 1 | import wikipedia 2 | from tkinter import * 3 | from tkinter.messagebox import showinfo 4 | 5 | win = Tk() # objek 6 | win.title("WIKIPEDIA") 7 | win.geometry("200x70") # function 8 | 9 | # function 10 | def search_wiki(): 11 | search = entry.get() 12 | Hasil = wikipedia.summary(search) 13 | showinfo("Hasil Pencarian", Hasil) 14 | 15 | 16 | label = Label(win, text="Wikipedia Search :") 17 | label.grid(row=0, column=0) 18 | 19 | entry = Entry(win) 20 | entry.grid(row=1, column=0) 21 | 22 | button = Button(win, text="Search", command=search_wiki) 23 | button.grid(row=1, column=1, padx=10) 24 | 25 | win.mainloop() 26 | --------------------------------------------------------------------------------