savoirfairelinux / num2words

Modules to convert numbers to words. 42 --> forty-two
GNU Lesser General Public License v2.1
820 stars 497 forks source link

Need assistance please #526

Open PlinkoKlinko opened 1 year ago

PlinkoKlinko commented 1 year ago

Expected Behaviour

I am learning python and one of the "beginner projects" I was told to try to learn how things work is to work with this script in conjunction with another one, but no matter what i do with pip install or looking in pycharm settings it doesnt work and shows up as grey. I know this isnt really a good "issue" but i figured if anyone would know how this works it would be you O.o

Actual Behaviour

here ill just give the full context. if this isnt something you guys want to be bothered with thats 100% understandable i jsut dont really know where to go for help :/

so the script they want me to try is: " """ Number Names - Show how to spell out a number in English.You can use a preexisting implementation or roll your own, but you should support inputs up to at least one million (or the maximum value of your language's default bounded integer type, if that's less). Optional: Support for inputs other than positive integers (like zero, negative integers, and floating-point numbers). """ import num2words as n2w from tkinter import *

def num_to_words(): given_num = float(num.get()) num_in_word = n2w.num2words(given_num) display.config(text=str(num_in_word).capitalize())

root = Tk() root.title("Numbers to Words") root.geometry("650x400")

num = StringVar()

Adding title

title = Label(root, text="Number to Words converter", fg="Blue", font=("Arial", 20, 'bold')).place(x=220, y=10)

Options

formats_lable = Label(root, text="Formats supported : ", fg="green", font=("Arial", 10, 'bold')).place(x=100, y=70) pos_format_lable = Label(root, text="1. Positives : ", fg="green", font=("Arial", 10, 'bold')).place(x=200, y=90) neg_format_lable = Label(root, text="2. Negatives ", fg="green", font=("Arial", 10, 'bold')).place(x=200, y=110) float_format_lable = Label(root, text="3. Zeros ", fg="green", font=("Arial", 10, 'bold')).place(x=200, y=130) zero_format_lable = Label(root, text="4. Floating points/decimals/fractions ", fg="green", font=("Arial", 10, 'bold')).place(x=200, y=150)

num_entry_lable = Label(root, text="Enter a number :", fg="Blue", font=("Arial", 15, 'bold')).place(x=50, y=200) num_entry = Entry(root,textvariable=num,width=30).place(x=220, y=200)

btn = Button(master=root, text="calculate",fg="green", font=("Arial", 10, 'bold') ,command=num_to_words).place(x=280,y=230)

display = Label(root, text="",fg="black", font=("Arial", 10, 'bold')) display.place(x=10, y=300)

photo = PhotoImage(file = "Num2Words/number.png") root.iconphoto(False, photo)

root.mainloop() "

but when I did pips install and it said confirmed it still didnt work. having no python experts near me i turned to chat gpt which guided me to go into python interpreter settings and make sure it was downloaded there as well which i did, but then the import line was still grey. then chat gpt said maybe n2w is out of date but it doesnt look to be the case. I tried downloading all the files and putting it into a notepad to try and run it somehow which didnt work and i tried to open the source code in visual studio code which output a jumbled mess that cht gpt said would only be viewable in the interpreter. but it doesnt work in pycharm!!! holy its been like 2 hours ive been trying to figure this out. if you guys could lend any assitance or direct me to some place i can get help that would be super super super apreciated. idk if im allowed to share infor but if you want to reach out to me directly you can send me an email plinkoinvest@gmail.com works for that. sorry for wasting your time on a tech support issue lol, i know you guys got bigger things to worry about. anyways hope you have a good day! <3

Steps to reproduce