Jun-19-2022, 09:05 PM
Thanks, this looks more like what I need.
Question - how do I remove the hardcoded values in this bit :
f1 = io.StringIO("""
20220617 14:30:00, 1.1
20220617 14:40:00, 1.3
20220617 14:50:00, 1.7
20220617 15:00:00, 1.4
""")
...and instead, specify a filename on my directory. For example, I'd love to say
f1 = io.StringIO(filename)
but of course this does not work. I've read up on the online documentation for StringIO and couldn't find an example
of reading an actual file.
Question - how do I remove the hardcoded values in this bit :
f1 = io.StringIO("""
20220617 14:30:00, 1.1
20220617 14:40:00, 1.3
20220617 14:50:00, 1.7
20220617 15:00:00, 1.4
""")
...and instead, specify a filename on my directory. For example, I'd love to say
f1 = io.StringIO(filename)
but of course this does not work. I've read up on the online documentation for StringIO and couldn't find an example
of reading an actual file.