The way to print the issue keys to your command prompt is:
from jira.client import jira
options = {'server': 'https://URL.com'}
jira = JIRA(options, basic_auth=('username', 'password'))
issues = jira.search_issues('jqlquery')
for issue in issues:
print issue
That will do it. However, you mention you get a syntax error for your JQL query, so you'll need to post that query to see what is wrong with it. Valid would be, for example if you want to find the issues you added label 'TEST' to in your previous question:
label = 'TEST'
issues = jira.search_issues('labels=' + str(label))
Or:
jqlquery = 'labels=TEST'
issues = jira.search_issues(jqlquery)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…