How to create a simplex algorithm table

117 Views Asked by At

I am trying to create a table that can have user input. I want to have a table with boxes instead of asking the user for a list of numbers, they can just input a lot of numbers into the table. Right now I have a list of variables and it is asking for user input for all of the variables.

I want it to look a bit like this with some sort of way to input the numbers. https://i.stack.imgur.com/wNz4I.jpg

Here is my code so far. It isn't very good. There is probably a much easier way to do it.

row1X1=input("what is row1X1?: ")
 
row1X2=input("What is row1X2: ")
 
row1X3=input("what is row1X3?: ")
 
row1S1=input("What is row1S1: ")
 
row1S2=input("what is row1S2?: ")
 
row1Z=input("What is row1Z: ")
 
row1Equal=input("What is the equals: ")
 
 
 
row2X1=input("what is row2X1?: ")
 
row2X2=input("What is row2X2: ")
 
row2X3=input("what is row2X3?: ")
 
row2S1=input("What is row2S1: ")
 
row2S2=input("what is row2S2?: ")
 
row2Z=input("What is row2Z: ")
 
row2Equal=input("What is the equals: ")
 
 
row3X1=input("what is row3X1?: ")
 
row3X2=input("What is row3X2: ")
 
row3X3=input("what is row3X3?: ")
 
row3S1=input("What is row3S1: ")
 
row3S2=input("what is row3S2?: ")
 
row3Z=input("What is row3Z: ")
 
row3Equal=input("What is the equals: ")
 
 
{
 
 
print(row1X1, row1X2, row1X3, row1S1, row1S2, row1Z, row1Equal)
 
print(row2X1, row2X2, row2X3, row2S1, row2S2, row2Z, row2Equal)
 
print(row3X1, row3X2, row3X3, row3S1, row3S2, row3Z, row3Equal)
}

I eventually want to be able to input numbers and then have the program pivot the table based on the most negative number in the bottom row. I am not sure how to go about doing this, however.

1

There are 1 best solutions below

0
On

What you've asked for here is a GUI. In Python, that's done with tools like Tkinter or Qt or wxWidgets, but that's a huge problem. Surely, for now, the best plan is you have your users enter their data in a text file with a simple text editor, then have your program read that file. Then you can concentrate on the math.