开发者社区> 问答> 正文

python什么语句清除变量

python什么语句清除变量

展开
收起
云计算小粉 2018-05-10 20:09:57 2193 0
2 条回答
写回答
取消 提交回答
  • del 变量

    2019-11-14 10:54:05
    赞同 展开评论 打赏
  • 阿里云ping https://ping.gaomeluo.com/aliyun/

    def __clear_env():
    for key in globals().keys():

       if not key.startswith("__"):
           globals().pop(key)
    2019-07-17 22:19:52
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载