Showing posts with label Full Details. Show all posts
Showing posts with label Full Details. Show all posts

Friday, September 25, 2020

Currency Convertor Using Python | Source Code | LIbararies to Install | Other Details

Macstock

In this post, I have managed to Build an Amazing Currency Convertor Using Python Tkinter. The App has an Fallback that is not big problem, that Zimbabwe Dollar cannot be Used. We are Working On it and Soon it Will be Used.

I have Used Only Two Modules in this Projects and One Pre Installed Module Named TKinter. So If you want to Download this Program, you can download to and the Downloaded File WIll be Installed in your Computer.

For Better Understanding You Should Watch the Videos[Explained in Hindi Language]Step-By-Step By Clicking the Video Buttons Given Below


Part 1

Part 2

Part 3

Want to Install It without Python, Download from these links :-

Python Libararies To Install Before Copying Codes

Simply Open Your Terminal [You can Use 'Command Prompt' Or 'Windows Powershell' also. And Run These Commands there to Install These Packages.

pip install google-currency

pip install json


I have Used One File Named "ind.txt" in My Code, Here is the Link to Download the File :

Souce Code Here :-


from tkinter import *
from tkinter import messagebox
from tkinter.ttk import Combobox
from google_currency import convert
import json


root = Tk()
root.geometry("600x400")
root.title("Currency Convertor By Kunal")
# root.iconbitmap("Your Icon.ico")
root.config(bg="lightgreen")
root.resizable(False, False)

with open('ind.txt') as k:
    lines = k.readlines()


currencyDict = {}
for line in lines:
    parsed = line.split("\t")
    currencyDict[parsed[1]] = parsed[2]
    
def funtiol():
    try:
        lan = currentbox.get()
        paol = currencyDict[lan]
        lap = currentbox2.get()
        olop = currencyDict[lap]
        serial = varb.get()
        rider = convert(paol, olop, serial)
        json_dict = json.loads(rider)
        semibox = json_dict["amount"]
        var1.set(semibox)
    except:
        semiboss = messagebox.askretrycancel('A Problem Has Been Occured', 'Please Check Your Internet Connection, Change Your Currency or Amount you Have Entered')  
        if (semiboss==True):
            return "None"


Title = Label(root, text="Currency Convertor By You", font=('ubuntu', 20, "italic"), bg="lightgreen", fg="red")
Title.place(x=120, y=10)

Lable1 = Label(root, text="Enter the Amount to Convert :- ", font=('ubuntu', 15, "bold"), bg="lightgreen", fg="brown")
Lable1.place(x=10, y=70)

varb = IntVar()
MainBox = Entry(root, textvar=varb, bg="grey", fg="lightblue", width=25, font=('ubuntu', 15, "bold"))
MainBox.place(x=315, y=70)

Label2 = Label(root, text="Select the Currency to Convert Your Amount From :-",  font=('ubuntu', 10, "bold"), bg="lightgreen", fg="blue")
Label2.place(x=10, y=140)

Label3 = Label(root, text="Select the Currency to Convert Your Amount to :-",  font=('ubuntu', 10, "bold"), bg="lightgreen", fg="blue")
Label3.place(x=10, y=180)

Lable4 = Label(root, text="Converted Amount Here :- ", font=('ubuntu', 15, "bold"), bg="lightgreen", fg="brown")
Lable4.place(x=10, y=300)

btn1 = Button(root, text="Convert", font=('ubuntu', 15, "bold"),  command=funtiol,  bg="lightblue", fg="orange", relief=RAISED,\
                         cursor="hand2")
btn1.place(x=250, y=230)

var1 = IntVar() 
mainint = Entry(root, textvariable=var1, fg="orange", width=28, font=('ubuntu', 15, "bold"), state="readonly")
mainint.place(x=270, y=300)

footer = Label(root, text="Build and Developed By You", font=('ubuntu', 15, "italic"), bg="lightgreen", fg="grey")
footer.place(x=120, y=360)

#Combobox 1 
currentbox = StringVar()
combo_box = Combobox(root, width=30, textvar=currentbox, state="readonly")
combo_box['values'] = [item for item in currencyDict.keys()]
combo_box.current(4)
combo_box.place(x=360, y=140)

#Combobox 2
currentbox2 = StringVar()
combotake = Combobox(root, width=30, textvar=currentbox2, state="readonly")
combotake['values'] = [item for item in currencyDict.keys()]
combotake.current(0)
combotake.place(x=360, y=180)


root.mainloop()
    

Friday, September 18, 2020

Text Translator Using Python | Source Code | Libaries to Install | Other Details | Full Details

Macstock

In This Post, I Have Managed to Build an Amazing Translator Tool Using Python Tkinter, If You Like it the please Comment down below.

It Supports All Languages Translation, So do not Worry if you not Want to Translate In Hindi or You are not an Indian.

Want to Install It without Python, Download from these links :-

Python Libararies To Install Before Copying Codes

Simply Open Your Terminal [You can Use 'Command Prompt' Or 'Windows Powershell' also. And Run These Commands there to Install These Packages.

pip install playsound

pip install tkinter

pip install pygame

pip install textblob

Souce Code Here :-



# Libraries Imported
from playsound import playsound
from tkinter import *
from tkinter import messagebox
import winsound
from tkinter.ttk import Combobox
import pygame
from textblob import *

# Main Configurations
root = Tk()
root.geometry("800x400")
root.title("Kunal Translator")
root.resizable(False, False)
root.configure(bg="grey")
# root.iconbitmap("Your Icon.ico")
lan_dict = {'afrikaans': 'af', 'albanian': 'sq', 'amharic': 'am', 'arabic': 'ar', 'armenian': 'hy', 'azerbaijani': 'az', 'basque': 'eu', 'belarusian': 'be', 
'bengali': 'bn', 'bosnian': 'bs', 'bulgarian': 'bg', 'catalan': 'ca', 'cebuano': 'ceb', 'chichewa': 'ny', 'chinese (simplified)': 'zh-cn', 'chinese (traditional)': 'zh-tw', 'corsican': 'co', 'croatian': 'hr', 'czech': 'cs', 'danish': 'da', 'dutch': 'nl', 'english': 'en', 'esperanto': 'eo', 'estonian': 'et', 'filipino': 'tl', 'finnish': 'fi', 'french': 'fr', 'frisian': 'fy', 'galician': 'gl', 'georgian': 'ka', 'german': 'de', 'greek': 
'el', 'gujarati': 'gu', 'haitian creole': 'ht', 'hausa': 'ha', 'hawaiian': 'haw', 'hebrew': 'he', 'hindi': 'hi', 'hmong': 'hmn', 'hungarian': 'hu', 'icelandic': 'is', 'igbo': 'ig', 'indonesian': 'id', 'irish': 'ga', 'italian': 'it', 'japanese': 'ja', 'javanese': 'jw', 'kannada': 'kn', 'kazakh': 'kk', 'khmer': 'km', 'korean': 'ko', 'kurdish (kurmanji)': 'ku', 'kyrgyz': 'ky', 'lao': 'lo', 'latin': 'la', 'latvian': 'lv', 'lithuanian': 'lt', 'luxembourgish': 'lb', 'macedonian': 'mk', 'malagasy': 'mg', 'malay': 'ms', 'malayalam': 'ml', 'maltese': 'mt', 'maori': 'mi', 'marathi': 'mr', 'mongolian': 'mn', 'myanmar (burmese)': 'my', 'nepali': 'ne', 'norwegian': 'no', 'odia': 'or', 'pashto': 'ps', 'persian': 'fa', 'polish': 'pl', 
'portuguese': 'pt', 'punjabi': 'pa', 'romanian': 'ro', 'russian': 'ru', 'samoan': 'sm', 'scots gaelic': 'gd', 'serbian': 'sr', 'sesotho': 'st', 'shona': 'sn', 'sindhi': 'sd', 'sinhala': 'si', 'slovak': 'sk', 'slovenian': 'sl', 'somali': 'so', 'spanish': 'es', 'sundanese': 'su', 'swahili': 'sw', 'swedish': 'sv', 'tajik': 'tg', 'tamil': 'ta', 'telugu': 'te', 'thai': 'th', 'turkish': 'tr', 'ukrainian': 'uk', 'urdu': 'ur', 'uyghur': 'ug', 'uzbek': 'uz', 'vietnamese': 'vi', 'welsh': 'cy', 'xhosa': 'xh', 'yiddish': 'yi', 'yoruba': 'yo', 'zulu': 'zu'}

# Functions to Run
pygame.mixer.init()
def sound(event=None):
    try:
        pygame.mixer.music.load("Your Song.mp3")
        pygame.mixer.music.play()
        word3 = TextBlob(varname1.get())
        lan = word3.detect_language()
        lan_todict = language.get()
        lan_to = lan_dict[lan_todict]
        word3 = word3.translate(from_lang=lan, to=lan_to)
        varname2.set(word3)
    except:
        varname2.set("A Problem Has Been Occured")    
def mainexit():
    rr = messagebox.askyesnocancel('Exit Your Translator', 'Are You Want to Exit Kunal Translator Machine', parent= root)
    if (rr==True):
        root.destroy()

    # Binding [Hover] Functions 
def on_entry1click(e):
    entry1['bg'] = "lightblue"
def on_entry1leave(e):
    entry1['bg'] = "lightgreen"

def on_click(e):
    btn1['bg'] =  "green"
    btn1['foreground'] =  "black"
def on_leave(e):
    btn1['bg'] =  "pink"
    btn1['foreground'] =  "red" 
def on_2click(e):
    btn2['bg'] =  "black"  
    btn2['foreground'] =  "blue"  
def on_2leave(e):
    btn2['bg'] =  "red" 
    btn2['foreground'] =  "white"   

# Combo Box

language = StringVar()
font_box = Combobox(root, width=30, textvariable = language, state="readonly")
font_box['values'] = [e for e in lan_dict.keys()]
font_box.current(37)
font_box.place(x=130, y=147)
# Title Of My Program
label1 = Label(root,foreground="aqua", text="Your Translator Machine", font=('Arial', 15, 'italic bold'), bg="grey")
label1.place(x=278, y=10)

# Translator Boxes

    #Text Feeder
varname1 = StringVar()
entry1 = Entry(root, width=30, bg="lightgreen", textvariable=varname1, font=('ubuntu', 15, 'bold'))
entry1.place(x=400, y=70)

    #Text Output
varname2 = StringVar()
entry2 = Entry(root, width=30, bg="purple", textvariable=varname2, font=('ubuntu', 15, 'bold'), state="readonly")
entry2.place(x=400, y=220)

# # Labels 

    #Translate To 
label4 = Label(root,foreground="white",  text="Translate To :-", font=('ubuntu', 8, 'bold'), bg="grey")
label4.place(x=34, y=147)    
    #Text Feeder Label
label1 = Label(root,foreground="yellow",  text="Enter The Word to Translate :-", font=('ubuntu', 15, 'bold'), bg="grey")
label1.place(x=38, y=70)
    #Text Output Label
label2 = Label(root,foreground="orange", text="Translated Word Here :-", font=('ubuntu', 15, 'bold'), bg="grey")
label2.place(x=56, y=220)

#Buttons Here

    # Translater Button

btn1 = Button(root, text="Translate",  bg="pink", foreground="red",command= sound, font=('ubuntu', 15, 'bold'),relief=RAISED,\
                         cursor="hand2")
btn1.place(x=350, y=140)
root.bind('<Return>, sound)

    # Exit Button

btn2 = Button(root, text="Exit", bg="red",command= mainexit, foreground="white", padx=18, pady=8, font=('ubuntu', 15, 'bold'),relief=RAISED,\
                         cursor="hand2")
btn2.place(x=350, y=350)

#Binding 

    #Text Feeder Binding
entry1.bind('<Enter>', on_entry1click)
entry1.bind('<Leave>', on_entry1leave)


    #Translate Button Binding
btn1.bind('<Enter>', on_click)
btn1.bind('<Leave>', on_leave)

    #Exit Button Binding
btn2.bind('<Enter>', on_2click)
btn2.bind('<Leave>', on_2leave)



root.mainloop()
    

You can Edit these Codes to Make it Your Personal Translator

Friday, September 11, 2020

Addition Mini Calculator Using Java | Source Code | Full Details | More Information

Macstock

Simple Calculator Using Java

In this Java Program, I have managed to build a Mini Adding Calculator Using Java, So If you want then Copy the Codes from Below.

If You are a Advanced Java Programmer, Then It is Not For You. This Program Is Only For Beginners Or InterMediate Java Programmers Because It is Not GUI(Graphical User Interface) Program.

Things to Do Before Copying Codes

1. Make Sure You have Installed Java and Its JDK

2. Create A New Folder WhereEver You Want

3. Create a New File in The Folder Name "Anything.bat"

4. Right Click On the File and Click Edit And Paste the Given Text There.

java -jar JavaCalculator.jar


    import java.util.Scanner;
              
public class Main {
              
                  public static void main(String[] args) throws InterruptedException {
                      for (int i = 0; i < 2000; i++) {
                          Scanner scanner = new Scanner(System.in);
                          double a, b;
                          System.out.print("Enter The First Number to add : ");
                          a = scanner.nextDouble();
                          System.out.print("Enter the Second Number to add: ");
                          b = scanner.nextDouble();
                          System.out.println();
                          System.out.println();
                          System.out.println(a+b);
                          }
                         }
                        }
    

Make Sure To Build This in .jar Format and Save the File Name As "JavaCalculator.jar"

You can Use This As Much As You Want Coz This is In A Loop

Monday, September 7, 2020

Repeating Sum Calculator Using Python | Full Details | Source Code | All About | Simple Code

Macstock

Repeating Sum Calculator Using Python

In This Python Program, You can easily Add Numbers Just By Entering Number and Pressing Enter, You Can Do It As Much as You Want, Coz this is in a While Loop.

You Do not Have To Install any Python Library to Run this Program, Very Simple and Short Codes are Given, Just Copy them and Paste In Your IDE or Python Official IDLE.


sum = 0
while (True):
    userInput = int(input("Enter the Price : \n"))
    if (userInput!='q'):
        sum = sum + int(userInput)
        print("Your Order Total So far : ", sum)
        

    else:
        print("Thanks For Using Our Calculator")
        print("The Total Sum : ", sum )
        break