Python v3 using idle with Tkinter and Gui

Post here if you need help with creating a Graphical User Interface in Python.

Python v3 using idle with Tkinter and Gui

Postby ellellell1 » Wed Sep 21, 2016 5:59 am

Hi There

I am having some trouble with my code and was wondering if anyone could help me?

I have made a program with two classes that ae designed to act as a phone ordering system. This is based on the company Subway.
You can see the gui this code produces here:

Capture.PNG
Capture.PNG (117.07 KiB) Viewed 1138 times


I have also uploaded the python file, which contains all the code.
My question is, can I get the button on line 176 "Save and order another sub", to be pressed so the user can add 5 more subs, while being able to save variables for the costs, so they can all be added up at the end. So essentially repeating the code 5 times while holding 5 variables for costs to be added at the end.

Sorry this is so broad, but I hope this makes sense when you can see what my code is trying to do. What code can I put on line 318 that will help me with this?

Thanks
Last edited by micseydel on Wed Sep 21, 2016 4:21 pm, edited 1 time in total.
Reason: Initial post lock. Fixed image inlining.
ellellell1
 
Posts: 4
Joined: Wed Sep 21, 2016 5:46 am

Re: Python v3 using idle with Tkinter and Gui

Postby Ofnuts » Wed Sep 21, 2016 5:49 pm

Can't see the code. For me "Save and order more" would create some aggregate (list/tuple/class) with data of that order and add it to a list. The final "save" adds the last order to the list and then iterates the list or orders to compute the total price.
This forum has been moved to http://python-forum.io/. See you there.
User avatar
Ofnuts
 
Posts: 2659
Joined: Thu May 14, 2015 9:46 am
Location: Paris, France, EU, Earth, Solar system, Milky Way, Local Cluster, Universe #32987440940987

Re: Python v3 using idle with Tkinter and Gui

Postby ellellell1 » Wed Sep 21, 2016 8:58 pm

Ofnuts wrote:Can't see the code. For me "Save and order more" would create some aggregate (list/tuple/class) with data of that order and add it to a list. The final "save" adds the last order to the list and then iterates the list or orders to compute the total price.


Ah ok, sounds interesting.

Sorry here is the code: https://drive.google.com/file/d/0BydTFZ ... sp=sharing

Also the data doesn't need to be carried over, only the costs and then calculate to the final cost.
ellellell1
 
Posts: 4
Joined: Wed Sep 21, 2016 5:46 am

Re: Python v3 using idle with Tkinter and Gui

Postby LavaCreeperKing » Wed Sep 21, 2016 9:52 pm

Well something you could do is when the order a new sub button is pressed you create a list then add the new order info to that list. Then you can have it display all the info from that list and do this over for as many subs as you can get. So what you could do is because you have a max order of 5 at the start of your program create 5 lists. Then every time you click the order new sub button check to see what order you are on and next time you hit the save button save all the info to that list: order 1 list 1, order 2 list 2. Then have it display or print the items in each list and you can also check to see how many orders there are so you don't try to print an order from a list if that order has not been placed.
LavaCreeperKing
 
Posts: 103
Joined: Wed Sep 02, 2015 11:31 pm

Re: Python v3 using idle with Tkinter and Gui

Postby ellellell1 » Wed Sep 21, 2016 10:44 pm

LavaCreeperKing wrote:Well something you could do is when the order a new sub button is pressed you create a list then add the new order info to that list. Then you can have it display all the info from that list and do this over for as many subs as you can get. So what you could do is because you have a max order of 5 at the start of your program create 5 lists. Then every time you click the order new sub button check to see what order you are on and next time you hit the save button save all the info to that list: order 1 list 1, order 2 list 2. Then have it display or print the items in each list and you can also check to see how many orders there are so you don't try to print an order from a list if that order has not been placed.


Hi there, thanks for that.

I plan to do something along those lines, but what I need help with what the actual code would look like to repeat the gui. (i.e calling self.clear_variables) but this doesn't seems to repeat the whole program.

If someone could reply with the code I need to repeat my program with, I would be very grateful.
ellellell1
 
Posts: 4
Joined: Wed Sep 21, 2016 5:46 am

Re: Python v3 using idle with Tkinter and Gui

Postby ellellell1 » Thu Sep 22, 2016 2:10 pm

Problem Solved! Thanks
ellellell1
 
Posts: 4
Joined: Wed Sep 21, 2016 5:46 am


Return to GUI

Who is online

Users browsing this forum: No registered users and 2 guests