python缩进可以嵌套吗_嵌套类Python和缩进错误

在Python中,我创建了几个嵌套类,但是不断出现缩进错误。我看不出压痕有什么问题,也没什么想法了。在

目前的错误是[error]SyntaxError(!!导入时!!输入'self'不匹配,需要缩进(病人.py,第69行)

从sikuli进口*

类患者():firstname = ""

middlename

Surname = ""

title = ""

ppsno = ""

gender = ""

testID = ""

birthDate = ""

address1 = ""

address2 = ""

address3 = ""

address4 = ""

town = ""

county = ""

country = ""

email = ""

mobile = ""

#Default Constructor for the class patient

def __init__(

self,

testID,

firstname = None,

surname = None,

gender = None,

birthDate = None):

self.testID = testID

if (firstname is None):

firstname = "Test"

self.firstname = firstname

if (surname is None):

surname = "Patient"

self.surname = surname

if (gender is None):

gender = "Male"

self.gender = gender

if (birthDate is None):

birthDate = "08081988"

self.birthDate = birthDatename

#Use this to create a patient with more detailed information

def __init__(

self,

testID,

firstname = None,

middlename = None,

surname = None,

gender = None,

birthDate = None,

title = None,

ppsno = None,

address1 = None,

address2 = None,

address3 = None,

address4 = None,

town = None,

county = None,

country = None,

email = None,

mobile = None):

self.testID = testID

if (firstname is None):

firstname = "Sample"

self.firstname = firstname

if (surname is None):

surname = "Patient"

self.surname = surname

if (middlename is None):

middlename = "Mary"

self.middlename = middlename

if (gender is None):

gender = "Female"

self.gender = gender

if (birthDate is None):

birthDate = "03091959"

self.birthDate = birthDatename

if (title is None):

title = "Mrs"

self.title = title

if (ppsno is None):

ppsno = "7445213P"

self.ppsno = ppsno

if (address1 is None):

address1 = "100"

self.address1 = address1

if (address2 is None):

address2 = "Green Glade"

self.address1 = address1

if (address3 is None):

address3 = "Pleasent Way"

self.address3 = address3

if (address4 is None):

address4 = "Ballybehy"

self.address4 = address4

if (town is None):

town = "Abbeyfeale"

self.town = town

if (county is None):

county = "Limerick"

self.county = county

if (country is None):

country = "Ireland"

self.country = country

if (email is None):

email = "supertest69@freewebmail.ie"

self.email = email

if (mobile is None):

mobile = "0870563229"

self.mobile = mobile

def getStuff(self):

#return self.stuff

class schemeDetails():

cardNumber = ""

scheme = ""

cardNumber = ""

month = ""

year = ""

setSchemeAsDefault = ""

def __init__(

self,

scheme = None,

cardNumber = None,

month = None,

year = None,

setSchemeAsDefault = None ):

if (scheme is None):

scheme = "GM"

self.scheme = scheme

if (cardNumber is None):

month = "1231456A"

self.cardNumber = cardNumber

if (month is None):

month = "September"

self.month = month

if (year is None):

year = "2015"

self.year = year

if (setSchemeAsDefault is None):

setSchemeAsDefault = "true"

self.setSchemeAsDefault = setSchemeAsDefault

def getStuff(self):

#return self.stuff

#Inner class for creating basic dispenses

class basicDispense():

drug = ""

packSize = ""

dosageSystem = ""

scheme = ""

#Constructor for the class basicDispense

def __init__(

self,

drug = None,

packSize = None,

dosageSystem = None,

scheme = None):

if (drug is None):

drug = "ABBOTT THIN LANCET TYPE C GMS"

self.drug = drug

if (packSize is None):

packSize = "28"

self.packSize = packSize

if (dosageSystem is None):

dosageSystem = "MD"

self.dosageSystem = dosageSystem

if (scheme is None):

scheme = "GM"

self.scheme = scheme

def getStuff(self):

#return self.stuff

#Inner class of basicDispenses for printing Labels

#Constructor for the class Labels

class labels():

def __init__(

self,

testID,

printBagLabel = None,

printDrugLabel = None):

self.testID = testID

if (printBagLabel is None):

printBagLabel = "false"

self.drug = drug

if (printDrugLabel is None):

printDrugLabel = "false"

self.printDrugLabel = printDrugLabel

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值