# !/usr/bin/env python
# -*- coding: utf-8 -*-
import cx_Oracle
from pprint import pprint
import csv
import time
import re
import binascii

conn = cx_Oracle.connect('tlcbuser/tlcbuser@10.5.100.232/tlyy')
cursor = conn.cursor()
xsql="select * from tlcb_mon_device a where a.ipaddr='10.3.244.1'"
r = cursor.execute(xsql)
print r
arr=[]
for x in r:
 print x

C:\Python27\python.exe C:/Users/tlcb/PycharmProjects/untitled/a6.py
<cx_Oracle.Cursor on <cx_Oracle.Connection to tlcbuser@10.5.100.232/tlyy>>
('DP_244.1', 'IBM AIX', '10.3.244.1', 'UTF-8', '\xb5\xe7\xc6\xb1\xc7\xb0\xd6\xc3\xd6\xf7\xbb\xfa', 'ECDS', '\xc2\xde\xba\xaf', '1', 'FTP')

# !/usr/bin/env python
# -*- coding: utf-8 -*-
import cx_Oracle
from pprint import pprint
import csv
import time
import re
import binascii

conn = cx_Oracle.connect('tlcbuser/tlcbuser@10.5.100.232/tlyy')
cursor = conn.cursor()
xsql="select * from tlcb_mon_device a where a.ipaddr='10.3.244.1'"
r = cursor.execute(xsql)
print r
arr=[]
for x in r:
 print x
 print x[6]
 print len(x[6])



C:\Python27\python.exe C:/Users/tlcb/PycharmProjects/untitled/a6.py
<cx_Oracle.Cursor on <cx_Oracle.Connection to tlcbuser@10.5.100.232/tlyy>>
('DP_244.1', 'IBM AIX', '10.3.244.1', 'UTF-8', '\xb5\xe7\xc6\xb1\xc7\xb0\xd6\xc3\xd6\xf7\xbb\xfa', 'ECDS', '\xc2\xde\xba\xaf', '1', 'FTP')
???
4

# !/usr/bin/env python
# -*- coding: utf-8 -*-
import cx_Oracle
from pprint import pprint
import csv
import time
import re
import binascii

conn = cx_Oracle.connect('tlcbuser/tlcbuser@10.5.100.232/tlyy')
cursor = conn.cursor()
xsql="select * from tlcb_mon_device a where a.ipaddr='10.3.244.1'"
r = cursor.execute(xsql)
print r
arr=[]
for x in r:
 print x
 print x[6]
 print len(x[6])
 print type(x[6])
 print x[6].decode('gbk')
 print len(x[6].decode('gbk'))
 print  x[6].decode('gbk').encode('utf-8')
 print len(x[6].decode('gbk').encode('utf-8') )

C:\Python27\python.exe C:/Users/tlcb/PycharmProjects/untitled/a6.py
<cx_Oracle.Cursor on <cx_Oracle.Connection to tlcbuser@10.5.100.232/tlyy>>
('DP_244.1', 'IBM AIX', '10.3.244.1', 'UTF-8', '\xb5\xe7\xc6\xb1\xc7\xb0\xd6\xc3\xd6\xf7\xbb\xfa', 'ECDS', '\xc2\xde\xba\xaf', '1', 'FTP')
???
4
<type 'str'>
测试
2
测试
6

Process finished with exit code 0