Skip to content

Commit 278330d

Browse files
committed
Signed-off-by: twowater <347073565@qq.com>
Python 9 代码
1 parent e5face5 commit 278330d

17 files changed

Lines changed: 952 additions & 0 deletions

File tree

Code/Python9Code/.idea/Python9Code.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code/Python9Code/.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code/Python9Code/.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code/Python9Code/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code/Python9Code/.idea/workspace.xml

Lines changed: 680 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code/Python9Code/com/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env python
2+
# -*- coding: UTF-8 -*-
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env python
2+
# -*- coding: UTF-8 -*-
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: UTF-8 -*-
3+
4+
class Test:
5+
def prt(self):
6+
print(self)
7+
print(self.__class__)
8+
9+
t = Test()
10+
t.prt()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
# -*- coding: UTF-8 -*-
3+
4+
# 旧式类
5+
class OldClass:
6+
def __init__(self, account, name):
7+
self.account = account;
8+
self.name = name;
9+
10+
11+
# 新式类
12+
class NewClass(object):
13+
def __init__(self, account, name):
14+
self.account = account;
15+
self.name = name;
16+
17+
18+
if __name__ == '__main__':
19+
old_class = OldClass(111111, 'OldClass')
20+
print(old_class)
21+
print(type(old_class))
22+
print(dir(old_class))
23+
print('\n')
24+
new_class=NewClass(222222,'NewClass')
25+
print(new_class)
26+
print(type(new_class))
27+
print(dir(new_class))
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python
2+
# -*- coding: UTF-8 -*-
3+
4+
class UserInfo(object):
5+
name = '两点水'
6+
7+
8+
class UserInfo(object):
9+
def __init__(self, name):
10+
self.name = name
11+
12+
13+
class UserInfo(object):
14+
def __init__(self, name, age, account):
15+
self.name = name
16+
self._age = age
17+
self.__account = account

0 commit comments

Comments
 (0)