diff --git a/README.md b/README.md deleted file mode 100644 index 8a0b832a7..000000000 --- a/README.md +++ /dev/null @@ -1,198 +0,0 @@ - -[![forthebadge](https://forthebadge.com/images/badges/built-by-developers.svg)](https://forthebadge.com) -[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) -[![forthebadge](https://forthebadge.com/images/badges/built-with-swag.svg)](https://forthebadge.com) -[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) - -# Python-Mini-Projects - -[![All Contributors](https://img.shields.io/badge/all_contributors-72-blue.svg?style=flat-square)](#contributors-) -![Issues](https://img.shields.io/github/issues/chavarera/python-mini-projects) -![Pull Requests](https://img.shields.io/github/issues-pr/chavarera/python-mini-projects?) -![Forks](https://img.shields.io/github/forks/chavarera/python-mini-projects) -![Stars](https://img.shields.io/github/stars/chavarera/python-mini-projects) -![License](https://img.shields.io/github/license/chavarera/python-mini-projects) - -A collection of simple python mini projects to enhance your Python skills. - -If you want to learn about python, visit [here.](https://github.com/Python-World/PythonScript) - -If you are new to Github and open source then, visit [here.](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6) - -## Steps To Follow - -- Select an issue and ask to be _assigned_ to it. -- Check existing scripts in the [projects](/projects/) directory. -- **Star** this repository. -- On the [python-mini-projects](https://github.com/Python-World/python-mini-projects) repo page, click the **Fork** button. -
-- **Clone** your forked repository to your local machine. This button will show you the URL to run. -
- - For example, run this command inside your terminal: - - ```bash - git clone https://github.com//python-mini-projects.git - ``` - - **Replace \!** - - Learn more about [forking](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and [cloning a repo](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository). -- Before you make any changes, [keep your fork in sync](https://www.freecodecamp.org/news/how-to-sync-your-fork-with-the-original-git-repository/) to avoid merge conflicts: - - ```bash - git remote add upstream https://github.com/Python-World/python-mini-projects.git - git fetch upstream - git pull upstream master - git push - ``` - - Alternatively, GitHub also provides syncing now - click "Fetch upstream" at the top of your repo below "Code" button. - -- If you run into a **merge conflict**, you have to resolve the conflict. There are a lot of guides online, or you can try this one by [opensource.com](https://opensource.com/article/20/4/git-merge-conflict). - -- Checkout to development branch (*name your branch according to the issue name*). - - ```bash - git checkout -b - ``` - -- Create a folder in - [projects directory](https://github.com/Python-World/python-mini-projects/tree/master/projects) - according to issue name. -- Write your code and add to the respective folder in the projects directory, locally. -- Don't forget to add a `README.md` in your folder, according to the - [README_TEMPLATE.](https://github.com/Python-World/python-mini-projects/blob/master/README_TEMPLATE.md) -- Add the changes with `git add`, `git commit` ([write a good commit message](https://chris.beams.io/posts/git-commit/), if possible): - - ```bash - git add -A - git commit -m "" - ``` - -- Push the code _to your repository_. - - ```bash - git push origin - ``` - -- Go to the GitHub page of _your fork_, and **make a pull request**: - - ![pull request image](https://help.github.com/assets/images/help/pull_requests/choose-base-and-compare-branches.png) - - Read more about pull requests on the [GitHub help pages](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request). -- Now wait, until one of us *reviews your Pull Request*! If there are any conflicts, you will get a notification. - -## README Template for scripts - -[README Template](https://github.com/Python-World/python-mini-projects/blob/master/README_TEMPLATE.md) - -## Connect On Social media - -[Join WhatsApp group](https://chat.whatsapp.com/Ghp25kidWLaGrAVA0G0GAa) - -## Contributors ✨ - -SR No | Project | Author ---- | --- | --- -1 | [Hello World](https://github.com/Python-World/python-mini-projects/tree/master/projects/Hello) | [Ravi Chavare](https://github.com/chavarera) -2 | [JSON to CSV](https://github.com/Python-World/python-mini-projects/tree/master/projects/Convert_JSON_to_CSV)| [Murilo Pagliuso](https://github.com/DarkCeptor44) -3 | [Random Password Generator](https://github.com/Python-World/python-mini-projects/tree/master/projects/Random_password_generator) | [Mitesh](https://github.com/Mitesh2499) -4 | [Instagram Profile Info](https://github.com/Python-World/python-mini-projects/tree/master/projects/Instagram_profile) | [Ravi Chavare](https://github.com/chavarera) -5 | [Search string in Files](https://github.com/Python-World/python-mini-projects/tree/master/projects/String_search_from_multiple_files) | [Mitesh](https://github.com/Mitesh2499) -6 | [Fetch links from Webpage](https://github.com/Python-World/python-mini-projects/tree/master/projects/All_links_from_given_webpage) | [Mitesh](https://github.com/Mitesh2499) & [Michael Mba](https://github.com/mikeysan) -7 | [Todo App With Flask](https://github.com/Python-World/python-mini-projects/tree/master/projects/Todo_app) | [Mitesh](https://github.com/Mitesh2499) -8 | [Add Watermark on Images](https://github.com/Python-World/python-mini-projects/tree/master/projects/Image_watermark) | [Mitesh](https://github.com/Mitesh2499) -9 | [WishList App Using Django](https://github.com/Python-World/python-mini-projects/tree/master/projects/WishList) | [Ravi Chavare](https://github.com/chavarera) -10 | [Split Folders into Subfolders](https://github.com/Python-World/python-mini-projects/tree/master/projects/Split_folder_into_subfolders) | [Ravi Chavare](https://github.com/chavarera) -11 | [Download bulk images](https://github.com/Python-World/python-mini-projects/tree/master/projects/Download_images_from_website) | [Mitesh](https://github.com/Mitesh2499) -12 | [Random word from file](https://github.com/Python-World/python-mini-projects/tree/master/projects/Random_word_from_list) | [Ravi Chavare](https://github.com/chavarera) -13 | [Battery notification](https://github.com/Python-World/python-mini-projects/tree/master/projects/Battery_notification) | [Mitesh](https://github.com/Mitesh2499) -14 | [Calculate age](https://github.com/Python-World/python-mini-projects/tree/master/projects/Calculate_age) | [Gaodong](https://github.com/xlgd) -15 | [Text file analysis](https://github.com/Python-World/python-mini-projects/tree/master/projects/Textfile_analysis) | [m044de](https://github.com/m044de/) -16 | [Generate image snipets](https://github.com/Python-World/python-mini-projects/tree/master/projects/Py_carbon_clips) | [ravi chavare](https://github.com/Python-World/) -17 | [Organize file system](https://github.com/Python-World/python-mini-projects/tree/master/projects/Organized_download_folder_with_different_categories) | [Mitesh](https://github.com/Mitesh2499) -18 | [Send emails](https://github.com/Python-World/python-mini-projects/tree/master/projects/Send_email_from_csv) | [Mitesh](https://github.com/Mitesh2499) -19 | [Get Ipaddress and Hostname of Website](https://github.com/Python-World/python-mini-projects/tree/master/projects/Find_out_hostname_and_ip_address) | [Nuh Mohammed](https://github.com/NuhMohammed)| -20 | [Progressbar using tqdm](https://github.com/Python-World/python-mini-projects/tree/master/projects/Terminal_progress_bar_with_images_resizing) | [Mitesh](https://github.com/Mitesh2499) -21 | [Get meta information of images](https://github.com/Python-World/python-mini-projects/tree/master/projects/Get_meta_information_of_images) | [Gaodong](https://github.com/xlgd) -22 | [Captures Frames from video](https://github.com/Python-World/python-mini-projects/tree/master/projects/Capture_Video_Frames) | [phileinSophos](https://github.com/phileinSophos/) -23 | [Fetch Wifi Saved Password Windows](https://github.com/Python-World/python-mini-projects/tree/master/projects/Get_wifi_password) | [Mitesh](https://github.com/Mitesh2499) -24 | [Save Screenshot of given Website](https://github.com/Python-World/python-mini-projects/tree/master/projects/Snapshot_of_given_website) | [m044de](https://github.com/m044de/) -25 | [Split files using no of lines](https://github.com/Python-World/python-mini-projects/tree/master/projects/Split_File) | [phileinSophos](https://github.com/phileinSophos/) -26 | [Encrypt and decrypt text](https://github.com/Python-World/python-mini-projects/tree/master/projects/Encrypt_and_decrypt_text) | [Gaodong](https://github.com/xlgd) -27 | [Captures screenshot at regular interval of time](https://github.com/Python-World/python-mini-projects/tree/master/projects/capture_screenshot) | [d33pc](https://github.com/d33pc/) -28 | [Create password hash](https://github.com/Python-World/python-mini-projects/tree/master/projects/Hashing_passwords) | [m044de](https://github.com/m044de/) -29 | [Encrypt file and folders](https://github.com/Python-World/python-mini-projects/tree/master/projects/Create_a_script_to_encrypt_files_and_folder) | [Gaodong](https://github.com/xlgd) -30 | [Decimal to binary and vice versa](https://github.com/Python-World/python-mini-projects/tree/master/projects/Decimal_to_binary_convertor_and_vice_versa) | [Alan Anaya](https://github.com/alananayaa/) -31 | [Cli Based Todo Application](https://github.com/Python-World/python-mini-projects/tree/master/projects/Cli_todo) | [Audrey Yang](https://github.com/audrey-yang) -32 | [Currency Convertor cli app](https://github.com/Python-World/python-mini-projects/tree/master/projects/Currency_converter) | [github-of-wone](https://github.com/github-of-wone/) -33 | [Stopwatch Application](https://github.com/Python-World/python-mini-projects/tree/master/projects/Create_a_simple_stopwatch) | [Gaodong](https://github.com/xlgd) -34 | [CLI Proxy Tester](https://github.com/Python-World/python-mini-projects/tree/master/projects/cli_proxy_tester) | [Ingo Kleiber](https://github.com/IngoKl) -35 | [XML to JSON file Convertor](https://github.com/Python-World/python-mini-projects/tree/master/projects/Convert_XML_to_JSON) | [John Kirtley](https://github.com/johnkirtley) -36 | [Compress file and folders](https://github.com/Python-World/python-mini-projects/tree/master/projects/Write_script_to_compress_folder_and_files) | [Gaodong](https://github.com/xlgd) -37 | [Find IMDB movie ratings](https://github.com/Python-World/python-mini-projects/tree/master/projects/Find_imdb_rating) | [ShivSt](https://github.com/ShivSt) -38 | [Convert dictionary to python object](https://github.com/Python-World/python-mini-projects/tree/master/projects/convert_dictionary_to_python_object) | [Varun-22](https://github.com/Varun-22) -39 | [Move files to alphabetically arranged folders](https://github.com/Python-World/python-mini-projects/tree/master/projects/Write_script_to_move_files_into_alphabetically_ordered_folder) | [Chathura Nimesh](https://github.com/kana800/) -40 | [Scrape Youtube video comment](https://github.com/Python-World/python-mini-projects/tree/master/projects/Web_scraping_a_youtube_comment) | [Saicharan67](https://github.com/Saicharan67) -41 | [Website Summerization](https://github.com/Python-World/python-mini-projects/tree/master/projects/Web_page_summation) | [Believe Ohiozua](https://github.com/believeohiozua) -42 | [Text To speech(mp3)](https://github.com/Python-World/python-mini-projects/tree/master/projects/Text_to_speech) | [Sergej Dikun](https://github.com/Serhazor) -43 | [Image format conversion](https://github.com/Python-World/python-mini-projects/tree/master/projects/convert_Imgs) | [Ramon Ferreira](https://github.com/ramonfsk) -44 | [Save random article from wikipedia](https://github.com/Python-World/python-mini-projects/tree/master/projects/Random_Wikipedia_Article) | [Rakshit Puri](https://github.com/skate1512) -45 | [Check website connectivity](https://github.com/Python-World/python-mini-projects/tree/master/projects/Check_website_connectivity) | [Shiv Thakur](https://github.com/ShivSt) -46 | [Fetch city weather information](https://github.com/Python-World/python-mini-projects/tree/master/projects/Fetch_current_weather) | [Kushal Agrawal](https://github.com/kushal98) -47 | [Calculator App](https://github.com/Python-World/python-mini-projects/tree/master/projects/Create_calculator_app) | [Gaodong](https://github.com/xlgd) -48 | [Merge Csv files](https://github.com/Python-World/python-mini-projects/tree/master/projects/Merge_csv_files) | [Kushal Agrawal](https://github.com/kushal98) -49 | [Fetch tweets and save in csv](https://github.com/Python-World/python-mini-projects/tree/master/projects/Fetch_and_store_tweets) | [Kushal Agrawal](https://github.com/kushal98) -50 | [Language Translator using googletrans](https://github.com/Python-World/python-mini-projects/tree/master/projects/Language_translator) | [Ashiqur Rahman Tusher](https://github.com/ashikurt77) -51 | [Split video using timeperiod](https://github.com/Python-World/python-mini-projects/tree/master/projects/Split_a_video_file_by_given_time_period) | [Chathura Nimesh](https://github.com/kana800/) -52 | [Fetch unique words from file](https://github.com/Python-World/python-mini-projects/tree/master/projects/Unique_words_in_a_file) | [Rakshit Puri](https://github.com/skate1512) -53 | [Speech to text converter](https://github.com/Python-World/python-mini-projects/tree/master/projects/Speech_to_text) | [Paulo Henrique](https://github.com/Python-World/python-mini-projects/tree/master/projects/Speech%20to%20text) -54 | [Set Random Wallpaper](https://github.com/Python-World/python-mini-projects/tree/master/projects/Write_a_script_to_download_a_random_image_from_unsplash_and_set_it_as_wallpaper) | [Chathura Nimesh](https://github.com/kana800/) -55 | [Find Dominant color from image](https://github.com/Python-World/python-mini-projects/tree/master/projects/Dominant_color) | [Mitesh](https://github.com/Mitesh2499) -56 | [Ascii art](https://github.com/Python-World/python-mini-projects/tree/master/projects/Ascii_art) | [Shiny Akash](https://github.com/Shiny-Akash) -57 | [Merge Pdf Files](https://github.com/Python-World/python-mini-projects/tree/master/projects/Merge_pdfs) | [ShivSt](https://github.com/ShivSt) -58 | [Fetch Open Port](https://github.com/Python-World/python-mini-projects/tree/master/projects/Fetch_open_ports) | [Kushal Agrawal](https://github.com/kushal98) -59 | [Convert Numbers To Words](https://github.com/Python-World/python-mini-projects/tree/master/projects/Convert_numbers_to_word) | [Niraj Shrestha](https://github.com/CrestNiraj12) -60 | [Restart and Shutdown System](https://github.com/Python-World/python-mini-projects/tree/master/projects/Shutdown_or_restart_your_device) | [Phillibob55](https://github.com/Phillibob55) -61 | [Check website connectivity](https://github.com/Python-World/python-mini-projects/tree/master/projects/Check_website_connectivity) | [Shiv Thakur](https://github.com/ShivSt) -62 | [Digital clock using tkinter](https://github.com/Python-World/python-mini-projects/tree/master/projects/Digital_clock) | [Aditya Jetely](https://github.com/adityaj7) -63 | [Covert Image To Pdf](https://github.com/Python-World/python-mini-projects/tree/master/projects/Convert_a_image_to_pdf) | [Gaodong](https://github.com/xlgd) -64 | [Store emails in csv file](https://github.com/Python-World/python-mini-projects/tree/master/projects/Store_emails_in_csv) | [Shiv Thakur](https://github.com/ShivSt) -65 | [Test Internet Connection](https://github.com/Python-World/python-mini-projects/tree/master/projects/Internet_connection_check) | [Jacob Ogle](https://github.com/Jakeogle94) -66 | [XKCD Comics Downloader](https://github.com/Python-World/python-mini-projects/tree/master/projects/XKCD_downloader)| [Aditya Jetely](https://github.com/AdityaJ7) -67 | [Website Blocker And Unblocker](https://github.com/Python-World/python-mini-projects/tree/master/projects/Website_blocker)| [Phillibob55](https://github.com/Phillibob55) -68 | [Fetch Domain Dns Record](https://github.com/Python-World/python-mini-projects/tree/master/projects/Dns_record)| [Aditya Jetely](https://github.com/AdityaJ7) -69 | [Python-Auto-Draw](https://github.com/Python-World/python-mini-projects/tree/master/projects/Python_auto_draw)| [Tushar Nankani](https://github.com/tusharnankani) -70 | [News Website Scraper](https://github.com/Python-World/python-mini-projects/tree/master/projects/News_website_scraper)| [pratik-choudhari](https://github.com/pratik-choudhari) -71 | [Rock Paper Scissors Game](https://github.com/Python-World/python-mini-projects/tree/master/projects/RockPaperScissors_Game)| [Tushar Nankani](https://github.com/tusharnankani) -72 | [Zip File Extractor](https://github.com/Python-World/python-mini-projects/tree/master/projects/Extract_zip_files)| [Aditya Jetely](https://github.com/AdityaJ7) -73 | [Random Password Generator](https://github.com/Python-World/python-mini-projects/blob/master/projects/Random_password_generator)| [Tushar Nankani](https://github.com/tusharnankani) -74 | [Script to perform Geocoding](https://github.com/Python-World/python-mini-projects/tree/master/projects/Geocoding)| [Aditya Jetely](https://github.com/AdityaJ7) -75 | [Python Carbon Clips](https://github.com/Python-World/python-mini-projects/tree/master/projects/Py_carbon_clips)| [Ravishankar Chavare](https://github.com/chavarera) -76 | [QR Code Generator](https://github.com/Python-World/python-mini-projects/tree/master/projects/Qr_code_generator)| [Shiv Thakur](https://github.com/ShivSt) -77 | [Recursive Password Generator](https://github.com/Python-World/python-mini-projects/tree/master/projects/Recursive_password_generator)| [Erfan Saberi](https://github.com/erfansaberi) -78 | [Tic Tac Toe](https://github.com/Python-World/python-mini-projects/tree/master/projects/Tic_tac_toe)| [Erfan Saberi](https://github.com/erfansaberi) -79 | [Tic Tac Toe with AI](https://github.com/Python-World/python-mini-projects/tree/master/projects/Tic_tac_toe_with_ai)| [Tushar Nankani](https://github.com/tusharnankani) -80 | [Cartoonify an Image](https://github.com/Python-World/python-mini-projects/tree/master/projects/Easy_cartoonify)| [Bartu Yaman](https://github.com/brtymn) -81 | [Quote Scrapper](https://github.com/Python-World/python-mini-projects/tree/master/projects/Scrape_quotes)| [Anandha Krishnan Aji](https://github.com/anandhakrishnanaji) -82 | [Time To Load Website](https://github.com/Python-World/python-mini-projects/tree/master/projects/Time_to_load_website)| [Aditya Jetely](https://github.com/AdityaJ7) -83 | [Customer Loan Repayment Prediction](https://github.com/Python-World/python-mini-projects/tree/master/Notebooks/Customer_loan_repayment_problem)| [ART](https://github.com/Tomyzon1728) -84 | [Generate Wordcloud from Wikipedia Article](https://github.com/Python-World/python-mini-projects/tree/master/projects/Wikipedia_search_wordcloud)| [Naman Shah](https://github.com/namanshah01) -85 | [Number Guessing Game](https://github.com/Python-World/python-mini-projects/tree/master/projects/Number_guessing_game)| [Javokhirbek](https://github.com/leader2one) -86 | [Convert JPEG to PNG](https://github.com/Python-World/python-mini-projects/tree/master/projects/Convert_JPEG_to_PNG)| [AnuragGupta](https://github.com/AnuragGupta806) -87 | [Movie Information Scrapper](https://github.com/Python-World/python-mini-projects/tree/master/projects/Movie%20Information%20Scraper)| [Anandha Krishnan Aji](https://github.com/anandhakrishnanaji) -88 | [Fetch HTTP Status Code](https://github.com/Python-World/python-mini-projects/tree/master/projects/Fetch%20HTTP%20status%20code)| [AkshataJ96](https://github.com/AkshataJ96) -89 | [Check Leap Year](https://github.com/Python-World/python-mini-projects/tree/master/projects/Leap_Year_Checker)| [Hariom Vyas](https://github.com/Hariom1509) -90 | [Scrape Medium Articles](https://github.com/Python-World/python-mini-projects/tree/master/projects/Scraping%20Medium%20Articles)| [Naman Shah](https://github.com/namanshah01) -91 | [HackerNews Scrapper](https://github.com/Python-World/python-mini-projects/tree/master/projects/Scrape_Hacker_News)| [Javokhirbek](https://github.com/leader2one) -92 | [Reduce Image Size](https://github.com/Python-World/python-mini-projects/tree/master/projects/Reduce_image_file_size)| [Vipul Verma](https://github.com/VIPverma01) -93 | [Easy Video Player](https://github.com/Python-World/python-mini-projects/tree/master/projects/EasyVideoPlayer)| [Bartu Yaman](https://github.com/brtymn) -94 | [GeeksforGeeks Article downloader](https://github.com/Python-World/python-mini-projects/tree/master/projects/download%20GeeksForGeeks%20articles)| [Shiv Thakur](https://github.com/ShivSt) -95 | [PDF to Text](https://github.com/Python-World/python-mini-projects/tree/master/projects/convert%20pdf%20to%20text)| [pi1814](https://github.com/pi1814) -96 | [Unstructured Supplemenrary Service Data](https://github.com/Python-World/python-mini-projects/tree/master/projects/Unstructured%20Supplemenrary%20%20Service%20Data)| [ART](https://github.com/Tomyzon1728) -97 | [Duplicate Files remover](https://github.com/Python-World/python-mini-projects/tree/master/projects/Duplicate%20files%20remover)| [Anandha Krishnan Aji](https://github.com/anandhakrishnanaji) -98 | [PNG to ICO converter](https://github.com/Python-World/python-mini-projects/tree/master/projects/convert_png_images_to_ico_format)| [weicheansoo](https://github.com/weicheansoo) -99 | [Find IMDB Ratings](https://github.com/Python-World/python-mini-projects/tree/master/projects/Find_imdb_rating)| [Utkarsh Bajaj](https://github.com/utkarshbajaj) -100 | [Terminal Based Hangman Game](https://github.com/Python-World/python-mini-projects/tree/master/projects/Terminal_Based_Hangman_Game)| [neohboonyee99](https://github.com/neohboonyee99) -101 | [Whatsapp Bot](https://github.com/Python-World/python-mini-projects/tree/master/projects/whatsapp_Bot)| [urmil89](https://github.com/urmil89) diff --git a/Screenshot_2021-09-19_19_48_47.png b/Screenshot_2021-09-19_19_48_47.png new file mode 100644 index 000000000..e3fa21563 Binary files /dev/null and b/Screenshot_2021-09-19_19_48_47.png differ diff --git a/cal.py b/cal.py new file mode 100644 index 000000000..a90dbb0ba --- /dev/null +++ b/cal.py @@ -0,0 +1,191 @@ +import math +# Python program to create a advance GUI +# calculator using Tkinter + +# import everything from tkinter module +from tkinter import * + +# globally declare the expression variable +expression = "" + + +# Function to update expressiom +# in the text entry box +def press(num): + # point out the global expression variable + global expression + + # concatenation of string + expression = expression + str(num) + + # update the expression by using set method + equation.set(expression) + + +# Function to evaluate the final expression +def equalpress(): + # Try and except statement is used + # for handling the errors like zero + # division error etc. + + # Put that code inside the try block + # which may generate the error + try: + + global expression + + # eval function evaluate the expression + # and str function convert the result + # into string + total = str(eval(expression)) + + equation.set(total) + + # initialze the expression variable + # by empty string + expression = "" + + # if error is generate then handle + # by the except block + except: + + equation.set(" error ") + expression = "" + + +# Function to clear the contents +# of text entry box +def clear(): + global expression + expression = "" + equation.set("") +#calculating the fac +def root(): + ans=float(equation.get())**(0.5) + + equation.set(str(ans)) + + + + +# Driver code +if __name__ == "__main__": + # create a GUI window + gui = Tk() + + # set the background colour of GUI window + gui.configure(background="white") + + # set the title of GUI window + gui.title("Simple Calculator") + + # set the configuration of GUI window + gui.geometry("300x290") + + # StringVar() is the variable class + # we create an instance of this class + equation = StringVar() + + # create the text entry box for + # showing the expression . + expression_field = Entry(gui,relief=RIDGE,textvariable=equation,bg="powderblue",bd=20) + + # grid method is used for placing + # the widgets at respective positions + # in table like structure . + expression_field.grid(columnspan=7, ipadx=50,ipady=20) + + equation.set(' ') + + # create a Buttons and place at a particular + # location inside the root window . + # when user press the button, the command or + # function affiliated to that button is executed . + button1 = Button(gui, text=' 1 ', fg='black', bg='white', + command=lambda: press(1), height=1, width=6).grid(row=3, column=0) + + button2 = Button(gui, text=' 2 ', fg='black', bg='white', + command=lambda: press(2), height=1, width=6) + button2.grid(row=3, column=1) + + button3 = Button(gui, text=' 3 ', fg='black', bg='white', + command=lambda: press(3), height=1, width=6) + button3.grid(row=3, column=2) + + button4 = Button(gui, text=' 4 ', fg='black', bg='white', + command=lambda: press(4), height=1, width=6) + button4.grid(row=4, column=0) + + button5 = Button(gui, text=' 5 ', fg='black', bg='white', + command=lambda: press(5), height=1, width=6) + button5.grid(row=4, column=1) + + button6 = Button(gui, text=' 6 ', fg='black', bg='white', + command=lambda: press(6), height=1, width=6) + button6.grid(row=4, column=2) + + button7 = Button(gui, text=' 7 ', fg='black', bg='white', + command=lambda: press(7), height=1, width=6) + button7.grid(row=5, column=0) + + button8 = Button(gui, text=' 8 ', fg='black', bg='white', + command=lambda: press(8), height=1, width=6) + button8.grid(row=5, column=1) + + button9 = Button(gui, text=' 9 ', fg='black', bg='white', + command=lambda: press(9), height=1, width=6) + button9.grid(row=5, column=2) + + button0 = Button(gui, text=' 0 ', fg='black', bg='white', + command=lambda: press(0), height=1, width=6) + button0.grid(row=6, column=0) + + plus = Button(gui, text=' + ', fg='black', bg='white', + command=lambda: press("+"), height=1, width=6) + plus.grid(row=7, column=3) + + minus = Button(gui, text=' - ', fg='black', bg='white', + command=lambda: press("-"), height=1, width=6) + minus.grid(row=6, column=3) + + multiply = Button(gui, text=' x ', fg='black', bg='white', + command=lambda: press("*"), height=1, width=6) + multiply.grid(row=5, column=3) + + divide = Button(gui, text=' / ', fg='black', bg='white', + command=lambda: press("/"), height=1, width=6) + divide.grid(row=4, column=3) + + equal = Button(gui, text=' = ', fg='black', bg='white', + command=equalpress, height=1, width=6) + equal.grid(row=6, column=2) + + clear = Button(gui, text='[X]', fg='black', bg='red', + command=clear, height=1, width=6) + clear.grid(row=3, column='3') + + Decimal= Button(gui, text='.', fg='black', bg='white', + command=lambda: press('.'), height=1, width=6) + Decimal.grid(row=7, column=0) + + squre=Button(gui,text="^",fg='black',bg='white',command=lambda: press('**'),height=1,width=6) + + squre.grid(row=7,column=2) + + coma=Button(gui,text=',',fg='black',bg='white',command=lambda: press(','),height=1,width=6) + + coma.grid(row=7,column=1) + + per=Button(gui,text='%',fg="black",bg='white',command=lambda: press('%'),height=1,width=6) + + per.grid(row=6,column=1) + + root=Button(gui,text=u"\u221A",fg="black",bg="white",command=root,height=1,width=6).grid(row=8,column=0) + + fact=Button(gui,text='!',fg='black',bg='white',command=lambda :press('!'),height=1,width=6).grid(row=8,column=1) + bracket=Button(gui,text='(',fg='black',bg='white',command=lambda: press('('),height=1,width=6).grid(row=8,column=2) + bracket1=Button(gui,text=')',fg='black',bg='white',command=lambda: press(')'),height=1,width=6).grid(row=8,column=3) + + # start the GUI + gui.mainloop() + diff --git a/projects/Calculator b/projects/Calculator new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/projects/Calculator @@ -0,0 +1 @@ +