1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > python翻译软件实现代码(使用google api完成)

python翻译软件实现代码(使用google api完成)

时间:2023-05-16 16:42:33

相关推荐

python翻译软件实现代码(使用google api完成)

后端开发|Python教程

python,翻译软件,googleapi

后端开发-Python教程

啊洋个人发卡6.2源码,ubuntu自带的驱动,爬虫抢单软件,php的内核,seo推广口号lzw

复制代码 代码如下:

捆绑 文件 vc 源码,vscode高频快捷键,ubuntu用qq,tomcat什么,sqlite设置rowid,网页设计培训网,香港域名服务器购买,swf插件下载,新前端框架,爬虫群接龙,php注册页面,seo学习工具,springboot集成翻译,菜谱网站模板免费下载,网页游戏制作素材,matlab凸透镜模板,网站后台怎么操作,网页错误提示页面模板,188旅游管理系统下载,vb 扑克牌小程序lzw

# -*- coding: utf-8 -*-

import httplib

from urllib import urlencode

import re

def out(text):

p = pile(r\",")

m = p.split(text)

print m[0][4:].decode(UTF-8).encode(GBK)

if __name__==\__main__:

while True:

word=raw_input(Input the word you want to search:)

text=urlencode({ ext:word})

h=httplib.HTTP(\)

h.putrequest(GET, /translate_a/t?client=t&hl=zh-CN&sl=en&tl=zh-CN&ie=UTF-8&oe=UTF-8&+text)

h.endheaders()

h.getreply()

f = h.getfile()

lines = f.readlines()

out(lines[0])

f.close()

网页视频聊天室源码,vscode不能开启终端进程,ubuntu top退出,tomcat 占cpu高,爬虫 智能检验,php分类目录源码,seo网站推广新闻性文章案例lzw

haskell版

复制代码 代码如下:

module Main where

import Network.HTTP

import Text.Regex.Posix

main = do

putStrLn "Input the word you want to search:"

word <- getLine

handle <- simpleHTTP (getRequest $ "/translate_a/t?client=t&hl=zh-CN&sl=en&tl=zh-CN&ie=UTF-8&oe=UTF-8&" ++ (text word))

content <- getResponseBody handle

let match = (content =~ "\",\""::(String,String,String))

putStrLn $ drop 4 $ first match

main

text word = urlEncodeVars [("text",word)]

first::(String,String,String)->String

first (x,_,_) = x

作者:Hevienz

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。