- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 Basic Python Learning--Polymorphism
class DataBaseInterface: def __init__(self, db_name, db_path, tables): self.db_name = db_name self.db_path = db_path self.tables = tables def Init_Database(self): pass def Search_Database(self, column, conditi.
2020-12-07 22:52:36 96
原创 Basic Python Learning--Read Json Config
import json import os DEMO_JSON_EXIST = 1 DEMO_JSON_GENERATED = 2 PATH_CONF_KEY = "YourDir" DEFAULT_DEMO_PATH = r"/Users/aimery/Documents/projects/python/py_training" class ListFiles: def __init__(self, path): self.path = path def sho.
2020-12-07 22:40:32 95 1
原创 Basic Python Learning--class and exception
class Cat: def __init__(self, name): print("__init__") self.gender = "male" self.age = 2 self.color = "orange" self.name = name def __enter__(self): print("__enter__") return self de...
2020-11-26 22:16:12 92 1
原创 Basic Python Learning--JSON
import json car = { 'links': ["www.cars.net", "www.tesla.com"], # "links": "xx", 'type': "battery car", 'brand': "tesla", 'mode': "model S", 'color': "red", 'recharge mileage': '500kms', 'price': { "Area": "China",.
2020-10-29 22:36:57 68
原创 Basic Python Learning--Dict
sys_conf = {} sys_conf["type"] = "charts" sys_conf["client"] = "GWM" print(sys_conf) # sys_conf["conf"] error conf = sys_conf.get("conf", "no conf key in dict") print(conf) # ! conf = sys_conf.get("conf") print(conf) print("test point1") if not sys_con.
2020-10-19 15:24:38 80
原创 Basic Python Learning--List&tuple
li1 = [] li = ["ABC", 1, [li1]] # li1[0] = 2 li.append("2") print(li) li.insert(0, 3) print(li) li.pop() print(li) li.pop(1) print(li) del li[-1] print(li) li = ["a", "b", "c", "d", "c"] li.remove("c") print(li) li = ["a", "b", "c", "d", "c"] li.sort.
2020-10-13 19:50:26 148
原创 Basic Python Learning--Print
Print: import datetime import random print("hello Python") print("hello ", end="") print("Python") name = "Aimery" num = 0 print(f"Hello {name}'s Python sharing number {num}") s1 = "Hello {1}'s Python sharing number {0}".format(num, name) print(s1) de
2020-10-10 15:12:26 115
responsibilities of all departments
2012-05-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人