Automatically expiring variable

后端 未结 6 2060
栀梦
栀梦 2021-01-13 08:21

How to implement an automatically expiring variable in python? For example, Let the program running For one hour. I want implement an array of 6 variables, each variable in

6条回答
  •  余生分开走
    2021-01-13 09:05

    You can use the time module to clear the "array" every 10 minutes, by checking the time interval from when the script starts.

    The last example on http://effbot.org/librarybook/time.htm point you in the right direction.

提交回复
热议问题