How to get cypher query result in python

considered I run below query in neo4j browser. It will shows some nodes in neo4j display panel and how many nodes and relationships in this query have.

I wish to get the "nodes count and relationship" count when i execute the query in python way.

match(n) return(n) limit 5

results of query in the browser shows : "Displaying 5 nodes, 1 relationships"

I am using python3.5 and module as "from neo4j import GraphDatabase"

When you execute the Cypher query with the python driver, call the consume() method on the result object like so:

Then I believe you can use the "counters" member of that object that comes back; see SummaryCounters in the API here

Thanks david.allen,

i tried the below code. But i got '{}'.

from neo4j import GraphDatabase
driver = GraphDatabase.driver("bolt://", auth=("neo4j", "xxxx"))
session = driver.session()
q1="MATCH(n) return n limit 5"
nodes =