如何使我的自定义按钮具有跳转到日期的功能?
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay, myCustomButton'
},
customButtons: {
myCustomButton: {
text: 'Jump to date!',
click: function() {
// Jump to date function
alert('clicked the custom button!');
}
}
},
Run Code Online (Sandbox Code Playgroud) 有没有办法从用户输入检查它是什么类型?并做这样的事情:
if input == str:
do this
elif input == int:
do this
else:
do this
Run Code Online (Sandbox Code Playgroud) conn = sqlite3.connect('SADS.db')
cur = conn.cursor()
print " "
choice = raw_input("Does the Customer know their user ID? Y/N : ")
if choice == "N":
number = raw_input("What is their phone number? : ")
cur.execute("SELECT * FROM customers WHERE Telephone = (?)", (number,))
row = cur.fetchone()
print "Customer ID : " , row[0]
Run Code Online (Sandbox Code Playgroud)
我使用上面的代码来检索客户详细信息 - 但是当我这样做时,我收到以下错误:
File "G:\ICT\SADS.py", line 111, in editdetails
print "Customer ID : " , row[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
Run Code Online (Sandbox Code Playgroud)
它真的让我神经紧张我已经尝试使用while循环或行中的行但它不起作用 - 请帮助:(