# -*- coding: utf-8 -*-
import sys, urllib,os
'''f=open("F:/S.txt","r",) 
text=f.read()
f.close()
s=text #han zi 
url1=s
url1 = url1.decode('gbk', 'replace')
s=urllib.quote(url1.encode('utf-8', 'replace'))
print s #16 jinzhi


url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text="+s
'''
url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=我是图灵机器人"  #text=我是图灵机器人，很高兴为你服务
#print url
wp = urllib.urlopen(url) 
content = wp.read()
fp = open("/home/pi/xiangmu/tulin/tulin.mp3","wb")
fp.write(content)
os.system("./bofang.sh")
fp.close() 
