def encode_url(url):
print(url)
url_re = ''
mi = ''
for i, ch in enumerate(url):
f_real_x = None
f_real_y = None
for real_x, real_y_chs in enumerate(ascii):
for real_y, real_y_ch in enumerate(real_y_chs):
if real_y_ch == ch:
f_real_x = real_x
f_real_y = real_y
if f_real_y is not None and f_real_x is not None:
this_data_x = x[data[0]]
encode_x = this_data_x[f_real_x]
mi = mi + encode_x
this_data_y = y[data[1]]
encode_y = this_data_y[f_real_y]
mi = mi + encode_y
return 'http://www.baidu.com/link?url=a3f48d30fc293c5e471ef23de092fddc99' + mi
if __name__ == '__main__':
t = encode_url("www.4414.cn");
print(t)[/mw_shl_code]
print(t)