I am trying, in Python 3, to append some data to a file, like this:
prueba = open(streamingResultFile, "a")
... when I previously declare:
streamingResultFile = time.asctime().replace(' ', ' ').replace(' ', '_') + '.txt'
... to get a file whose name will be the current time and date, in this format:
Tue_Apr_4_03:08:55_2017.txt
But I run it, and I get the message in the title complaining about the name of my file not being correct. But if I put something else, like "hello.txt" it works. Why can't I put that text as the name of my output file?