日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

bing的简单英文字典工具

發(fā)布時(shí)間:2023/12/20 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 bing的简单英文字典工具 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

今天看到園友心白水撰寫(xiě)的《簡(jiǎn)單翻譯工具--必應(yīng)字典第三方API使用方法》,感覺(jué)很不錯(cuò),所以用Python也寫(xiě)了一個(gè)。源碼如下:

1 import urllib.request 2 import json 3 4 serviceurl='http://xtk.azurewebsites.net/BingDictService.aspx?Word=' 5 6 while True: 7 word = input('請(qǐng)輸入英文單詞: ') 8 if len(word) < 1 : 9 break 10 url = serviceurl + word 11 try: 12 uh = urllib.request.urlopen(url) 13 except: 14 print('API錯(cuò)誤,請(qǐng)重試') 15 continue 16 data = uh.read() 17 try: 18 js = json.loads(data.decode('utf-8')) 19 except: 20 js = '' 21 22 if ( js["pronunciation"] == None): 23 print("未查到匹配單詞") 24 25 else: 26 print("美音:[" ,js["pronunciation"]["AmE"],
          "] 英音:[",js["pronunciation"]["BrE"],"]\n") 27 for de in js["defs"]: 28 print(de["pos"],de["def"]) 29 print("\n例句") 30 for sam in js["sams"]: 31 print("en:", sam["eng"]) 32 print("中文:", sam["chn"],"\n") 33 continue

程序運(yùn)行的結(jié)果如下:

請(qǐng)輸入英文單詞: python
美音:[ 'pa?θɑn ] 英音:[ 'pa?θ(?)n ]

n. 蟒;蚺蛇
Web 蟒蛇;巨蟒;派森

例句
en: Serpent blood spurted through the air, and in a minute, the huge python was dead.
中文: 蛇血在空中噴射出來(lái),很快,大蟒蛇就死了。

en: Suggests that Python Web services implementations were not the only ones having trouble with the air fare quote service.
中文: 指出,PythonWeb服務(wù)實(shí)現(xiàn)并不是惟一使用機(jī)票報(bào)價(jià)服務(wù)有困難的。

en: Another idea is to require python owners to have their pets fitted with microchips.
中文: 另一個(gè)想法是讓養(yǎng)蛇人給他們的寵物配上微芯片。

en: A practice millennium python seeing, changes into an elegant young man, spits into the borneol in his mouth.
中文: 一修煉千年的巨蟒看見(jiàn),化為一翩翩少年,將冰片吐入他口中。

en: Participants reacted to the meaning threat implicit in Python by handing out a larger notional punishment to a lawbreaker.
中文: 參與者的反應(yīng)是在巨蟒中一個(gè)具有隱含意義的威脅派由一個(gè)的更大名義讓處罰者進(jìn)行處罰。

en: Quite a number of Python programmers have recommended Spark to me.
中文: 很多Python程序員都向我推薦Spark。

en: Zhu went out to investigate, and there, a few paces from his door, he saw a huge python!
中文: 祝出去查看,就在門(mén)口幾步遠(yuǎn)的地方,他看到了一條巨蟒!

en: The balls disappeared, and the couple found a lumpy-looking carpet python nearby.
中文: 球不見(jiàn)了,夫婦卻發(fā)現(xiàn)在附近有一條身形凹凸不平的地毯蟒。

en: So, in a second study they used a description of a Monty Python sketch which participants weren't told was supposed to be a joke.
中文: 因此,在第二個(gè)實(shí)驗(yàn)中,他們使用了一個(gè)描述巨蟒的素描,而參與者也沒(méi)有認(rèn)為這應(yīng)該是一個(gè)玩笑。

en: The scripts directory contains python scripts used to install and uninstall the application.
中文: 腳本目錄包含用于安裝和卸載應(yīng)用程序的python腳本。

轉(zhuǎn)載于:https://www.cnblogs.com/zhengsh/p/5877471.html

總結(jié)

以上是生活随笔為你收集整理的bing的简单英文字典工具的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。