I am using twint for web crawling data form twitter. For that reason whenever I save my output file as csv, I want to name current timestamp but it is giving me an error
inport twint
c = twint.Config()
c.Search = "NationBehindState"
c.Limit = 10
c.Store_csv = True
c.Output =str(dt_string)+"g.csv"
However if I simply name any file with string in c.Output, file is created without any issue
Try this:
This will give you accuracy down the second and includes the year so will never risk repeating. If you need other formatting, look here: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes