上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 24 下一页
摘要: 最近在写的程序频繁地与文件操作打交道,这块比较弱,还好在百度上找到一篇不错的文章,这是原文传送门,我对原文稍做了些改动。有关文件夹与文件的查找,删除等功能 在os模块中实现。使用时需先导入这个模块,导入的方法是:import os一、取得当前目录s =os.getcwd()# s 中保存的是当前目录(即文件夹)比如运行abc.py,那么输入该命令就会返回abc所在的文件夹位置。举个简单例子,我们将abc.py放入A文件夹。并且希望不管将A文件夹放在硬盘的哪个位置,都可以在A文件夹内生成一个新文件夹。且文件夹的名字根据时间自动生成。import osimport timefolder = tim 阅读全文
posted @ 2011-08-01 16:32 牛皮糖NewPtone 阅读(84941) 评论(4) 推荐(5) 编辑
摘要: 刚好用到,这篇文章写得不错,转过来收藏。 转载自 道可道 | Python 标准库 urllib2 的使用细节Python 标准库中有很多实用的工具类,但是在具体使用时,标准库文档上对使用细节描述的并不清楚,比如 urllib2 这个 HTTP 客户端库。这里总结了一些 urllib2 库的使用细节。1 Proxy 的设置 2 Timeout 设置 3 在 HTTP Request 中加入特定的 Header 4 Redirect 5 Cookie 6 使用 HTTP 的 PUT 和 DELETE 方法 7 得到 HTTP 的返回码 8 Debug Log 1 Proxy 的设置urllib2 阅读全文
posted @ 2011-08-01 16:23 牛皮糖NewPtone 阅读(140788) 评论(0) 推荐(9) 编辑
摘要: 原创翻译,如需转载,请与博主联系:yuxcer@126.com新手上路,翻译不恰之处,恳请指出,不胜感谢2.5 WordNet WordNet is a semantically oriented dictionary of English, similar to a traditional thesaurus(辞典)but with a richer structure. NLTK includes the English WordNet, with 155,287 words and 117,659 synonym(同义词)sets. We’ll begin by looking at s 阅读全文
posted @ 2011-07-27 17:33 牛皮糖NewPtone 阅读(4688) 评论(2) 推荐(0) 编辑
摘要: 第一眼看到这本书的时候,天哪,又是一本砖头一样的书,顿时信心少了一半,随便翻了下书,对于当时的我来说,过于深,此书并不太适合初学者来看,尤其我这种基础差的人。而且,当初看了豆瓣的评价,立马打退堂鼓,把此书丢书架上去了。 在我看完了think Python和python基础编程之后,动手写了些代码,因为帮导师整理MIT和pudure大学Python课程PPT和project,以及翻译NLTK的那本... 阅读全文
posted @ 2011-07-21 18:25 牛皮糖NewPtone 阅读(1980) 评论(1) 推荐(0) 编辑
摘要: 转载请注明出处“一块努力的牛皮糖”:http://www.cnblogs.com/yuxc/新手上路,翻译不恰之处,恳请指出,不胜感谢Updated 1st 2011.8.52.2 Conditional Frequency Distributions 条件频率分布We introduced frequency distributions in Section 1.3. We saw that given some list mylist of words or other items, FreqDist(mylist)would compute the number of occurrenc 阅读全文
posted @ 2011-07-11 08:48 牛皮糖NewPtone 阅读(2517) 评论(0) 推荐(0) 编辑
摘要: Updated log1st:2011/8/5 1.5 Automatic Natural Language Understanding 自然语言的自动理解 We have been exploring language bottom-up(自底向上的), with the help of texts and the Python programming language. However, we’re also interested in exploiting(利用) our knowledge of language and computation by building usefu... 阅读全文
posted @ 2011-07-11 08:38 牛皮糖NewPtone 阅读(2547) 评论(3) 推荐(0) 编辑
摘要: 新手上路,翻译不恰之处,恳请指出,不胜感谢Updated log1st:2011/8/52nd:2011/8/63rd:2012/5/14每次按一小节来分,本篇涉及第一章的1.1,除了最后的小节&扩展阅读&习题放在一篇博客内。CHAPTER 1 第一章Language Processing and Python 语言处理和PythonIt is easy to get our hands on millions of words of text. What can we do with it, assuming we can write some simple programs 阅读全文
posted @ 2011-07-11 00:02 牛皮糖NewPtone 阅读(8333) 评论(1) 推荐(2) 编辑
摘要: 新手上路,翻译不恰之处,恳请指出,不胜感谢 Updated log1st:2011/8/61.4 Back to Python: Making Decisions and Taking Control 回到Python:决策和控制So far, our little programs have had some interesting qualities: the ability to work with language, and the potential to save human effort through automation. A key feature of programm. 阅读全文
posted @ 2011-07-10 21:49 牛皮糖NewPtone 阅读(1300) 评论(0) 推荐(0) 编辑
摘要: Updated log1st 2011.8.6 Lazy博主终于把习题做完了,第一回合结束!...1.6 Summary小结• Texts are represented in Python using lists: ['Monty', 'Python']. We can use indexing, slicing,and the len() function on lists.在Python中文本用列表来表示:['Monty', 'Python']。我们可以使用indexing, slicing, 和len()函数对列表操作。• 阅读全文
posted @ 2011-07-10 21:45 牛皮糖NewPtone 阅读(2649) 评论(8) 推荐(1) 编辑
摘要: Updated 1st 2011.8.62.3 More Python: Reusing Code 代码重用By this time you’ve probably typed and retyped a lot of code in the Python interactiveinterpreter. If you mess up(弄得一团糟) when retyping a complex example, you have to enter it again. Using the arrow keys to access and modify previous commands is h 阅读全文
posted @ 2011-07-10 21:42 牛皮糖NewPtone 阅读(891) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 24 下一页