第10章 | 充电时刻
本章主要介绍模块及其工作机制
------
模块
>>> import math
>>> math.sin(0)
0.0
模块是程序
一个简单的模块
#hello.py
print ("Hello,World!")
>>> import hello
Traceback (most recent call last):
File "", line 1, in
import hello
ImportError: No module n...
分类:
编程语言 时间:
2014-09-28 23:11:56
阅读次数:
485
typedef std::basic_string tstring;inline static void trim(tstring& s){ s.erase(0, s.find_first_not_of(_T("\r\t\n "))); s.erase(s.find_last_not_of(_T("...
分类:
编程语言 时间:
2014-09-28 14:27:52
阅读次数:
222
>>> d = {'a':1}>>> print '%s' % 1,d1 {'a': 1}>>> print '%s %s' % 1,dTraceback (most recent call last): File "", line 1, in TypeError: not enough argu....
分类:
编程语言 时间:
2014-09-28 04:29:10
阅读次数:
203
vi可分为三种操作状态,分别是命令模式(Command mode)、插入模式(Insert mode)和末行模式(Last line mode)
Insert的切换→Command mode,按Esc键
离开vi及存文件
在Command mode下,可按冒号“:”键入入Last line mode,例如:
:w filename (输入“w filename”,将文章存入指定...
分类:
其他好文 时间:
2014-09-27 17:45:00
阅读次数:
241
rotate原型:
std::rotate
C++98
C++11
template
ForwardIterator rotate (ForwardIterator first, ForwardIterator middle,
ForwardIterator last);
该函数是循环移...
分类:
其他好文 时间:
2014-09-26 11:17:38
阅读次数:
198
Java代码varfx={buffer:function(obj,cur,target,fnDo,fnEnd,fs){if(!fs)fs=6;varnow={};varx=0;varv=0;if(!obj.__last_timer)obj.__last_timer=0;vart=newDate()....
分类:
Web程序 时间:
2014-09-26 10:16:28
阅读次数:
320
今晚CF GYM A题,神坑。。原题:Aspen Avenue``Phew, that was the last one!'' exclaimed the garden helper Tim as he threw the last tree plant to the ground. His emp...
分类:
Web程序 时间:
2014-09-26 02:22:08
阅读次数:
320
A straight tunnel without branches is crowded with busy ants coming and going. Some ants walk left
to right and others right to left. All ants walk at a constant speed of 1 cm/s. When two ants meet, ...
分类:
其他好文 时间:
2014-09-26 02:19:18
阅读次数:
188
php对json字符串解码使用json_decode()函数,第一个参数传字符串,第二个参数若为true,返回array;若为false,返回object。如果返回NULL,说明报错,输出json_last_error(),得到的整数值对应错误提示。如图:json_last_error()比较常见的...
分类:
Web程序 时间:
2014-09-25 17:51:47
阅读次数:
175
When a file name is deleted from the directory tree, the file name's connection to the inode number is severed. If the file name is the last "link" to...
分类:
其他好文 时间:
2014-09-25 15:42:39
阅读次数:
177