Rf+sublime Framework Test Interface:
Python initially encountered an output return value problem, cannot be hit;
def getbaseinfo (self, recordrelatednumber):
Ret=self.comlib.getbaseinfo (Recordrelatednumber)
return ret
#直接返回数据ret, Problem solving
# if Ret==0:
# return 0
# Else:
# Return to self. GetLastError ()
Direct return, problem, error
Format problems; Unicodeencodeerror: ' ASCII ' codec can ' t encode character U ' \u7537 ' in position 119:ordinal not in range (128)
After the file is introduced,
Import Sys
Reload (SYS)
Sys.setdefaultencoding (' Utf-8 ')
Problem solving;
<?xml version= "1.0" encoding= "GBK"?>
<ClinicalBaseDocElement>
<LocationCode>12345678</LocationCode>
<patientSex> Men </patientSex>
<HosptializationCount>1</HosptializationCount>
<EncompassingEncounterType> Outpatient </EncompassingEncounterType>
<patientId>110911199901010000</patientId>
<PatientId>110911199901010000</PatientId>
<PatientNo>201606070011201</PatientNo>
<PerformerId>1</PerformerId>
<patientBirthday>19990101</patientBirthday>
<EncompassingEncounterDate>20160607</EncompassingEncounterDate>
<OutPatientNo>20160607001101</OutPatientNo>
<recordRelatedNumber>999#9999#99999</recordRelatedNumber>
<patientName> Zhang San </patientName>
</ClinicalBaseDocElement>
Python print output XML data issues