记录学习中的代码
os
import os
# os.mkdir("newdir")
os.chdir("f:/codingTests")
os.mkdir("1")
import os
print(os.getcwd())
os.chdir(r"F:\CodingTests\python\TensorFlow\python_learn")
# os.mkdir("1")
# os.chdir(r"F:\CodingTests\python\TensorFlow\python_learn\1")
# os.mkdir("2")
# os.chdir(r"F:\CodingTests\python\TensorFlow\python_learn")
os.rmdir("1")
类
http://www.runoob.com/python3/python3-class.html
##定义、继承
# -*- coding:UTF-8 -*-
class people:
def __init__(self, n, a, w):
self.name = n
self.age = a
self.__weight = w
def speak(self):
print("{}说:我{}岁".format(self.name, self.age))
print(self.__weight)
mm = people("mm", 24, 140)
mm.speak()
print(mm.name)
print(mm.age)
class student(people):
grade =