python中对文件、文件夹的操作需要涉及到os模块和shutil模块。 创建文件: 1) os.mknod("test.txt") 创建空文件 2) open("test.txt",w) 直接打开一个文件,如果文件不存在则创建文件 创建目录: os.mkdir("file") 创建目录 复制文件....
分类:
编程语言 时间:
2014-06-15 21:53:58
阅读次数:
247
原题地址:https://oj.leetcode.com/submissions/detail/5341904/题意:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of ...
分类:
编程语言 时间:
2014-06-15 21:33:16
阅读次数:
270
原题地址:https://oj.leetcode.com/problems/reverse-nodes-in-k-group/题意:Given a linked list, reverse the nodes of a linked listkat a time and return its mod...
分类:
编程语言 时间:
2014-06-15 21:24:43
阅读次数:
293
美妙的Python之Python起步 简而言之:Python 是能你无限惊喜的语言,与众不同。 1.动态类型: Python是一种动态类型语言,不须要预先声明变量的类型,变量的类型和值在赋值那一刻动态地初始化。这一点与C/C++,Java等静态类型语言全然不同,静态类型在编译阶段就...
分类:
编程语言 时间:
2014-06-15 20:18:35
阅读次数:
239
原题地址:https://oj.leetcode.com/problems/longest-substring-without-repeating-characters/题意:Given a string, find the length of the longest substring witho...
分类:
编程语言 时间:
2014-06-15 19:51:00
阅读次数:
254
转自:http://news.cnblogs.com/n/210346/1.笨办法学 Pythonhttp://learnpythonthehardway.org/book/有各种练习题你将会会学到:在所有的平台上安装 Python 编程环境写 Python 程序理解 Python 语法和文档像一个...
分类:
编程语言 时间:
2014-06-15 18:10:32
阅读次数:
394
最近看Vamei的Python文章,其中一篇讲异常处理的,原本看完没啥疑惑,或许是自己想的简单了。看到评论,一个园友的问题引起我的兴趣。他的问题是def func(x): try: return ++x finally: return x+1print fun...
分类:
编程语言 时间:
2014-06-15 06:47:20
阅读次数:
228
在用中文进行注释的之后运行会有这样的提示:在文件头加上 #coding=utf-8这一行就可以用中文注释了
分类:
编程语言 时间:
2014-06-15 06:07:16
阅读次数:
310
原题地址:https://oj.leetcode.com/problems/add-two-numbers/题意:You are given two linked lists representing two non-negative numbers. The digits are stored i...
分类:
编程语言 时间:
2014-06-15 00:40:44
阅读次数:
328
#!/usr/bin/env python# -*- coding: utf-8 -*-############################################## File : requestAnyURLWithCookie.py# Author : luc...
分类:
Web程序 时间:
2014-06-15 00:33:30
阅读次数:
187