第一章开胃菜Whetting Your Appetite 1 第二章使用Python解释器Using the Python Interpreter 3 2.1 调用解释器Invoking the Interpreter 2.2 解释器及其环境The Interpreter and Its Environment 第三章Python的非正式介绍An Informal Introduction to Python 9 3.1 初步认识Python Using Python as a Calcula
web采集的数据为 %u6B63%u5F0F%u4EBA%u5458,需要读取并转换为python对象,想了下不调用Javascr ipt去eval,只能自己翻译了。
核心代码:
import re
import codecs
pattern = re.compile('%u[0-9A-Z]{4}')
n = codecs.open('d:\\new.txt', 'w', 'utf-8')
with open('d:\\p', 'r') as f:
for l in f:
for i
最近为了熟悉一下 js 用有道翻译练了一下手,写一篇博客记录一下,也希望能对大家有所启迪,不过这些网站更新太快,可能大家尝试的时候会有所不同。
首先来看一下网页 post 过去的数据
大家不难发现,我们翻译的内容是放在 post 的 data 中的,这些参数,除了 salt 和 sign 要么就是不会变化,要么就是一眼能看出来意义的;那么这个 salt 和 sign 是什么呢?salt 根据 ta 数据的特征,我们应该会想到,这应该是一个时间戳,而 sign 又是什么呢?我们一起来看