1

So, i have a command line program that i am using for an assignment, and a UI that i have built using Tkinter

Do you know how i would push the inputs from Tkinter, out to the command line program?

import math
import decimal
paperprice = [0, 3, 35]
mincount = 10
count = int(input("How many posters do you want, above 10  :"))
iterationcount = 1
while count < 10:
    {
print (count),
count := int(input("Must be above 10, how many do you need :"))
    }
areaW = int(input("How Width are your posters?"))
areaH = int(input("How High are your posters"))
paperchoice =int(input("what material do you want, paper is 1, 2 is laminated, and 3 is pvc:"))
paperchoice -= 1
area = decimal
price = decimal
area = 0
price = 0
while iterationcount < count:

    while iterationcount <= 10:
        price = price + (((areaH+areaW)*0.03)+paperprice[paperchoice])
        iterationcount += 1
    if count >= 9:
        price = price + (((areaH+areaW)*0.0075)+paperprice[paperchoice])
        iterationcount += 1


print ("the price in total is", (round(price, 1)))

here is my CMD program

tkinter program frame

Here is the program frame i have created

How would i integrate these. I'm very new to python and programming in general so please keep things simple

AdaThaCat
  • 11
  • 1
  • 1
    You have to choose between `os.system()` and `subprocess.call()`. Check out [this thread](https://stackoverflow.com/questions/204017/how-do-i-execute-a-program-from-python-os-system-fails-due-to-spaces-in-path), if your command line call would be `process_wood.bat 10`, in python you could do: `wood = 10` and call via `os.system(f"process_wood.bat {wood}")`, for example. – mnikley May 16 '22 at 12:37

0 Answers0