凌的博客

您现在的位置是: 首页 > 学无止境 > python > 

python

python 析构方法__init__和__del__

2021-05-25 python 1119
# ! /usr/bin/python
# -*- coding: utf-8 -*-
# author:凌
# datetime:2021/05/25 08:06
# software:PyCharm


class Test:

    def __init__(self):
        print("__init__")

    def run(self):
        print("run")

    def __del__(self):
        print("__del__")



t = Test()
t.run()

1.jpg

文章评论

0条评论