博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
#python#面向对象练手+模仿Amazon的物流追踪显示
阅读量:7206 次
发布时间:2019-06-29

本文共 1189 字,大约阅读时间需要 3 分钟。

hot3.png

查询类:

class Trace():    def Lookup(self):        #查询其子类设置的内容        self.HeadFormat = "%-*s%*s"        self.Bwidth = len(self.Booktime);self.Awidth = len(self.Arrivetime)        self.Swidth = len(self.Status);self.Lwidth = len(self.Location)        self.Hwidth = self.Bwidth + self.Awidth + self.Swidth + self.Lwidth        self.Hvar = self.Hwidth + 10                print self.Hvar * '-'        print self.HeadFormat % (4,'Item',self.Hvar-4,'Info')        print self.Hvar * '='        print self.HeadFormat % (8,'Booktime:',self.Hvar-8,self.Booktime)        print self.HeadFormat % (10,'Arrivetime:',self.Hvar-10,self.Arrivetime)        print self.HeadFormat % (6,'Status:',self.Hvar-6,self.Status)        print self.HeadFormat % (8,'Location:',self.Hvar-8,self.Location)        print self.Hvar * '-'

设置类:

class Set(Trace):    def SetVar(self):         #设置相关信息        self.Booktime = str(raw_input("Please input the Booktime:"))               self.Arrivetime = str(raw_input("Please input the Arrivetime:"))        self.Status = str(raw_input("Please input the Status:"))        self.Location = str(raw_input("Please input the Location:"))

转载于:https://my.oschina.net/hochikong/blog/300120

你可能感兴趣的文章
Python--关于连接符+
查看>>
office 所有后缀对应的 content-type
查看>>
Linux 第十四天
查看>>
第4章 基本TCP套接口编程
查看>>
Android Studio 1.1 使用介绍及导入 jar 包和第三方依赖库
查看>>
Mysql主键、外键和索引的区别
查看>>
struts基础
查看>>
块状链表 codevs 2333弹飞绵羊
查看>>
(九)jsMath
查看>>
CE_现金模组基本概念(概念)
查看>>
饭后一题
查看>>
Zynq-7000 FreeRTOS(一)系统移植配置
查看>>
[笔记][朝花夕拾][Multisim基础电路范例].第一章 RLC电路,第七、八节 米勒定理...
查看>>
免费论文查重
查看>>
【GPRS】GSM和GPRS模块的应用
查看>>
第一章 Docker简介和基本概念
查看>>
java代码-----实现打印三角形
查看>>
python(4) 小程序-异步加载
查看>>
20190327(练手感)
查看>>
modelform动态显示select标签的对象范围
查看>>