모듈 pypxlib를 사용하여 Paradox 데이터베이스 파일 (.DB)에서 데이터 파일을 읽습니다.Python 'None'값은 -2147483648로 표시됩니다.
각 행을 읽는 동안 CSV에 씁니다.
'None'으로 예상되는 값은 -2147483648로 표시됩니다.
누구든지이 번호의 중요성을 알고 있습니까? 이 오류가 나타나는 이유는 무엇입니까? 아래
코드 :
for idx in range(0,len(matches)): #for each file found
print "processing %s" % matches[idx]['file']
#outputfile = path.join('./output/' + form_file_name(dbfile) + '.csv')
try:
myTable = Table(matches[idx]['file']) #class from pypxlib that takes a filepath
cols = [] #and creates a 'table' that can be read
for col in myTable.fields: #gets fields from the table
cols.append(col)
pTable = []
with open(output_folder +"/myoutput_" + matches[idx]['f'] + ".csv", "wb") as f:
writer = csv.writer(f)
writer.writerow(cols)
rowcount = 0
for row in myTable: # for every row in table
myRow = []
for fld in cols: # for every cell in the row
myRow.append(row[fld]) #append cell to the row
writer.writerow(myRow) #then write the row to the csv
rowcount = rowcount + 1
if rowcount >= 100:
break #just testing on the first 1000 records
해당 숫자의 중요성에 대해 : -2147483648은 서명 된 int32가 가질 수있는 가장 작은 값입니다 (-2.147.483.648에서 2.147.483.647까지). 그 대신에 None을 반환하는 이유는 무엇입니까? 모르겠습니다. 'pypxlib'에 대해서는 아무 것도 없지만 당신이 무언가를 찾을 수 있는지 확인하기 위해 그들의 문서를 점검 할 것입니다. – orangeInk
이 값을받는 열의 유형을 확인 했습니까? – Srgrn