0
之前,我插入我的數據到sqlite3的DB我插入的符號的一些數據(如name (vlan name)
)刪除符號
我跑我的返回指令功能我的程序後,它打印出:
x="create vlan"
y="global"
#
def readswitch():
conn = sqlite3.connect('server.db')
cur = conn.cursor()
cur.execute("SELECT DISTINCT command FROM switch WHERE function =? or type = ? ORDER BY key ASC",(x, y))
read = cur.fetchall()
return read;
import database
print (database.readswitch())
結果:
`[('enable',), ('configure terminal',), ('vlan (number)',), ('name (vlan name)',)]`
我預期的結果是
enable configure terminal vlan (number) name (vlan name)
更完美的結果:
enable
configure terminal
vlan (number)
name (vlan name)
如何解決這個問題?
是的!這就是我需要的! – 2015-02-10 07:42:22
你可以upvote/mark是否正確,然後@tommy – 2015-02-10 07:44:49