python部分内容总结(持续更新)
import json
class Person:
def __init__(self,name='',age=1):
self.name=name;
self.age=age;
def getName(self):
return self.name
class student(Person):
def __init__(self,grade=1,school=''):
super.__init__()
self.grade=grade
self.school=school
n=input("")
with open("","w") as f:
f.write("")
with open('',"a") as f:
f.write('')
with open('','r') as f:
content=f.read()
content=f.readlines()
content=f.readline()
with open("") as f:
for line in f:
line.rstrip()
try:
f=open("")
except Exception as e:
print(e)
else:
a=1
a_dic={
'name':'1',2:2,3:3}
with open('','w') as f:
json.dump(a_dic,f)
with open('') as f:
content=json.load(f)