Skip to content
Advertisement

How do I save the previous input in the text document in tkinter python

I am new to GUI programming and I’m trying to create a graph that takes in user input simultaneously while plotting the points given. I am still at the start, I am taking double entries and turning them into a list of tuples, and saving the entries in a text document. I have worked this all out but as I keep giving new input, the text document is erasing the previous input. Can you tell me how to save the previous inputs so I can use them to plot graphs?

here is my code till now, I’m working on y=mx+c graph for now:

JavaScript

Advertisement

Answer

A better way to implement this program is to ask the user for values m and c, where x can span a range. For this example, make sure that the text file is in the same folder as the program.

Here is my adapted example:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement