-
Notifications
You must be signed in to change notification settings - Fork 0
/
class-sample.py
30 lines (23 loc) · 753 Bytes
/
class-sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hoge
class CLASSNAME:
## define some class variables
__variable1 = ''
## define function when the class instance is created
def __init__(self,var1,var2,var3=None):
self.__variable1 = var1
self.__variable1 = var2
self.__variable1 = var3
## dfine function when the class instance is closed
def __del__(self):
print("class was closed")
## "__" means the funciton is called by only internal function
def __INTFUNC(self,var):
return var
## The funciton enabled external
def FUNC(self,var):
return var
## The process if this was inplemented directly
if __name__ == '__main__':
print("Implemented directly")