#🔒 Trying to create a GUI for text entry to calculate hourly pay per month

38 messages · Page 1 of 1 (latest)

drowsy belfry
#

I am trying to make my current code work with a text entry box. I have
I am trying to make my current code work with a text entry box. I have

# Welcome Message
print('Welcome To Your Monthly Gross Income Calculator')

# Variables
money_per_hour = int(input('Enter How Much Per Hour:'))
hours_week_1 = int(input('Enter Hours for Week 1:'))
hours_week_2 = int(input('Enter Hours for Week 2:'))
hours_week_3 = int(input('Enter Hours for Week 3:'))
hours_week_4 = int(input('Enter Hours for Week 4:'))

# Calculator
gross_pay = int(hours_week_1*money_per_hour+hours_week_2*money_per_hour+hours_week_3*money_per_hour+hours_week_4*money_per_hour)
net_pay = int(gross_pay)

# Print Final Numbers
print('Your Gross Pay For This Month Is:', gross_pay, 'Dollars')
print('Your Net Pay For This Month Is:', net_pay, 'Dollars')

i want to make it so that I can open it in it's own window and have text boxes for the inputs. I am very beginner, and not experienced.
Any help is appreciated
I had this post earlier, but had to go and it closed, so im redoing it.

tender sequoiaBOT
#

@drowsy belfry

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

somber sparrow
#

!d tkinter

tender sequoiaBOT
#

Source code: Lib/tkinter/__init__.py

The tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as well as on Windows systems.

Running python -m tkinter from the command line should open a window demonstrating a simple Tk interface, letting you know that tkinter is properly installed on your system, and also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that version.

somber sparrow
#

this might help

drowsy belfry
#

I have used that, but can't figure out exaclty how to do it

somber sparrow
drowsy belfry
#

I have

#

I am not a good reader for learning, i do better being taught physically by a person or something. That's why i struggled learning python in the beginning on my own. I only yesterday had a class in person

#

I read a bunch of stuff of tkinter

somber sparrow
#

found this on youtube, would someth like this be helpful?
https://www.youtube.com/watch?v=ibf5cx221hk

In this video course we learn the basics of GUI development in Python using Tkinter.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: https://www.neuralnine.com/books/
💻 The Algorithm Bible Book: https://www.neuralnine.com/books/
👕 Programming Merch: https://www.neuralnine...

▶ Play video
drowsy belfry
#

maybe, i didnt think of that

#

ill try it

bright swallow
#

and you need to use functions

#

all UI is done through events and functions

drowsy belfry
#

ok

somber sparrow
#

forgot to mention that

drowsy belfry
#

so how will i make my thing work

somber sparrow
#

input() is only for the terminal

drowsy belfry
#

ok

#

how do i change it to make it work

somber sparrow
bright swallow
drowsy belfry
#

ok

#

am i able to dm or something if i have questions? or should i open a new ticket.

bright swallow
#

Please don't dm. You can keep any related questions to this thread or open a new one

drowsy belfry
#

ok

#

got it

bright swallow
#

.rp tkinter

#

.rp tkinter

cloud inletBOT
#

Here are the top 5 results:

Python GUI Programming: Your Tkinter Tutorial
Build a Tic-Tac-Toe Game With Python and Tkinter
Bypassing the GIL for Parallel Processing in Python
Python sleep(): How to Add Time Delays to Your Code
Arduino With Python: How to Get Started
bright swallow
#

The first link here is a great intro to tkinter

drowsy belfry
#

Thanks, im watching a viedo now, ill check out some more vids if i need

bright swallow
#

Make sure you code along. Don't just watch

drowsy belfry
#

yea, i am

tender sequoiaBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.