Adding two variables to a QcomboBox pyqt5
up vote
1
down vote
favorite
Here's my code snippet:
self.cursor.execute("MATCH (n:Person) RETURN n.firstname, n.lastname")
for i in self.cursor:
self.cbPerson.addItem(str(i[0])
This gives me a list of the firstnames.
self.cbPerson.addItem(str(i[0:3])
This gives me the first and last name but like this ('firstname','lastname')
how do I get the desired output: firstname lastname
python python-3.x pyqt cypher pyqt5
add a comment |
up vote
1
down vote
favorite
Here's my code snippet:
self.cursor.execute("MATCH (n:Person) RETURN n.firstname, n.lastname")
for i in self.cursor:
self.cbPerson.addItem(str(i[0])
This gives me a list of the firstnames.
self.cbPerson.addItem(str(i[0:3])
This gives me the first and last name but like this ('firstname','lastname')
how do I get the desired output: firstname lastname
python python-3.x pyqt cypher pyqt5
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Here's my code snippet:
self.cursor.execute("MATCH (n:Person) RETURN n.firstname, n.lastname")
for i in self.cursor:
self.cbPerson.addItem(str(i[0])
This gives me a list of the firstnames.
self.cbPerson.addItem(str(i[0:3])
This gives me the first and last name but like this ('firstname','lastname')
how do I get the desired output: firstname lastname
python python-3.x pyqt cypher pyqt5
Here's my code snippet:
self.cursor.execute("MATCH (n:Person) RETURN n.firstname, n.lastname")
for i in self.cursor:
self.cbPerson.addItem(str(i[0])
This gives me a list of the firstnames.
self.cbPerson.addItem(str(i[0:3])
This gives me the first and last name but like this ('firstname','lastname')
how do I get the desired output: firstname lastname
python python-3.x pyqt cypher pyqt5
python python-3.x pyqt cypher pyqt5
edited Nov 10 at 21:28
eyllanesc
68.5k93052
68.5k93052
asked Nov 10 at 21:23
Gary Nobles
18413
18413
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Use join:
for i in self.cursor:
self.cbPerson.addItem(" ".join(i))
or better:
self.cbPerson.addItems([" ".join(i) for i in self.cursor])
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Use join:
for i in self.cursor:
self.cbPerson.addItem(" ".join(i))
or better:
self.cbPerson.addItems([" ".join(i) for i in self.cursor])
add a comment |
up vote
1
down vote
accepted
Use join:
for i in self.cursor:
self.cbPerson.addItem(" ".join(i))
or better:
self.cbPerson.addItems([" ".join(i) for i in self.cursor])
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Use join:
for i in self.cursor:
self.cbPerson.addItem(" ".join(i))
or better:
self.cbPerson.addItems([" ".join(i) for i in self.cursor])
Use join:
for i in self.cursor:
self.cbPerson.addItem(" ".join(i))
or better:
self.cbPerson.addItems([" ".join(i) for i in self.cursor])
answered Nov 10 at 21:28
eyllanesc
68.5k93052
68.5k93052
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243543%2fadding-two-variables-to-a-qcombobox-pyqt5%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown