def get_andesay(self, usersay, userip): andesay = '' andesay += '<br/>' p = Pinyin() userfenci = fenci(usersay) # userfenci = json.loads(userfenci) # city = p.get_pinyin(self.city) andesay += say.weather(usersay, userip) andesay += say.hello(usersay) andesay += say.song(usersay) andethink = '' andethink += '<br/>ande-think-trace, just for study' # andethink += '<br/>ande ip:' + get_ande_ip() andethink += '<br/>' + is_cn(usersay) andethink += '<br/>' + is_ascii(usersay) andethink += '<br/>' + userfenci andethink += '<br/>' + p.get_pinyin(usersay) #status = userfenci['words'][0]['attr'] debug = True # True False if debug: andesay += andethink return andesay
def get_andesay(self, usersay, splitter=''): andesay = '' andesay += '<br/>' p = Pinyin() userfenci = fenci(usersay) # userfencij = json.loads(userfenci) # is_cn = self.is_cn(usersay) #city = p.get_pinyin(self.city) # andesay += sayweather(usersay,city) andesay += say.hello(usersay) print andesay andesay += say.song(usersay) andethink = '' andethink += '<br/>ande-think-trace,it will remove' andethink += '<br/>' + self.user_ip() andethink += '<br/>' + self.is_cn(usersay) andethink += '<br/>' + self.is_ascii(usersay) andethink += '<br/>' + userfenci andethink += '<br/>' + p.get_pinyin(usersay) andethink += '<br/>' + self.ip + '<br/>' + self.zipcode + '<br/>' andethink += '<br/>' + self.addr andethink += '<br/>' + self.provice # +'<br/>'+self.city #status = userfenci['words'][0]['attr'] #status += userfenci['words'][1]['attr'] debug = True # True False if debug: andesay += andethink print andesay return andesay
import say say.hello()
# Import a file from src import combo print(combo.Constant.APP_NAME) # Import a class from a file from src.combo import Constant print(Constant.APP_DESC) # Import all from a file from src.combo import * u = User('welson') print(Util.get_username(u)) # Import a module from package import src.say as SrcSay print(SrcSay.hello()) # Import a module by sugarly syntax import sys sys.path.append("src") import say print(say.hello())
import say print(say.hello()) print(say.x)
import Say from say import hello say.hello() hello()
import say import sub.my_math say.hello('Bes') print '__name__', __name__ # __name__ __main__ print 'say.__name__', say.__name__ # say.__name__ say print 'say.mySecretName', say.mySecretName # say.mySecretName Ale print 'sub.my_math.__name__', sub.my_math.__name__ # sub.my_math print 'sub.my_math.addToTwo(2)', sub.my_math.addToTwo(2)