Saya mencoba membuat modul python untuk bot jeni/phenny irc.
Ini adalah bagian dari kode saya
def bp(jenni, input):
try:
text = input.group(2).encode('utf-8').split()
except:
jenni.reply("Please use correct syntax '.bp id weapons 7'. Available for weapons and food only")
if text[0].isstr() and text[1].isstr() and text[2].isdigit() and len(text) == 3 and text[1] == ('weapons' or 'food'):
url = 'http://someAPIurl/%s/%s/%s/1.xml?key=%s' % (text[0], text[1], text[2], key)
Jika inputnya sudah str
mengapa saya mendapatkan kesalahan ini?
AttributeError: objek 'str' tidak memiliki atribut 'isstr'
str
maka Anda tahu ituisstr
, Anda tidak memerlukan metode untuk itu. - person tripleee   schedule 28.09.2012