-6

what variable is being plotted and where should modify my code to store the data in a text file.

there are so many def function that I could not find the line that prints the variable.

the code in the link: https://drive.google.com/file/d/1P82abYvA-yv_oAGLrzhlkD8vEuqippWM/view?usp=sharing

Anwer Ak
  • 33
  • 7
  • 2
    Please provide minimal code where code is not working or any doubtful statement. Rather then attach full document. Please learn how to ask question https://stackoverflow.com/help/how-to-ask – Shivam Seth Sep 26 '18 at 05:03
  • Possible duplicate of [Correct way to write line to file?](https://stackoverflow.com/questions/6159900/correct-way-to-write-line-to-file) – error Sep 26 '18 at 07:03
  • it is not a duplicate and the I think a person will to need to see the whole code to find the line to plot the variable.Thanks – Anwer Ak Sep 26 '18 at 09:35

2 Answers2

0

To write some data in a text file it would go something like this:

f = open("guru99.txt", "a")
data = "some data"
f.write(data)
FlyingZipper
  • 701
  • 6
  • 26
  • I know how to save the data, but were in my code those lines need to be? – Anwer Ak Sep 26 '18 at 09:36
  • the data of the function is contained add by the function `read_frame()`, more specifically `frame=np.array(d.data)` so I would suggest to add d.data to your file – FlyingZipper Sep 26 '18 at 12:52
0

To add on to the answer contributed by @FlyingZipper, if you're looking to write multiple elements from an array into your text file, you can do this using a loop:

f = open("guru99.txt", "a")
data = ["1", "2", "3"]
for x in data:
    f.write(x)

Hope this helps! :)

Cedric
  • 209
  • 4
  • 13