I am creating a calculator using the turtle module of Python. I need the user to input information inside the window, as opposed to entering info inside the command line interface that pops up when you run a program, and then the information printing to screen sort of like how you can input information inside of Command Prompt without having to put the information inside a secondary window.
import turtle
import pyglet
import time
def pen_message(message = "", font = "", font_size = 0, loc_x = 0, loc_y = 0):
pen = turtle.Turtle()
pen.speed(0)
pen.penup()
pen.color("sky blue")
pen.goto(loc_x, loc_y)
pen.write(message, align = "center", font = (font, font_size, "normal"))
def main():
# Main program window
win = turtle.Screen()
win.cv._rootwindow.resizable(False, False)
win.screensize()
win.setup(width = 1.0, height = 1.0)
win.title("Geometric & Algabraic Calculator by @_c0d3_x_")
win.bgcolor("black")
win.setup(width = 800, height = 600)
win.tracer(0)
# Pen for text
title = pen_message("Geometric & Algabraic Calculator", "Tech Noir", 15, 0, 200)
msg = pen_message("Welcome User", "Courier", 15, 0, 150)
userInput = pen_message(input("Your name: "), "Courier", 15, 0, 100)
main()
This is what im trying to avoid
The program makes the user input data on the right screen rather than having them input the data within the actual window itself.
How would I go about achieving this?