码迷,mamicode.com
首页 >  
搜索关键字:python objects all    ( 160304个结果)
FastDFS安装、配置、部署(二)-Tracker配置详解
1、基本配置# is this config file disabled # false for enabled # true for disabled disabled=false# bind an address of this host # empty for bind all addresses of this host bind_addr=10.16.139.202# the track...
分类:其他好文   时间:2014-08-16 13:50:40    阅读次数:299
@修饰符--python中的装饰器
装饰器模式可以在不影响其他对象的情况下,以动态、透明的方式给单个对象添加职责,也能够处理那些可以撤销的职责。经常用于日志记录、性能测试等场合。想象一下这个很常见的场景,你写了一个方法只提供给以登陆的用户访问(事实上我也是通过django的@login_required才了解到@修饰符的),你可以写以...
分类:编程语言   时间:2014-08-16 13:45:20    阅读次数:269
使用python远程登录
最近要使用python做一个在web上管理交换机的程序,需要远程登录,就查了点资料,由于还没有搞到交换机,就先用自己的机器测试一下。首先python的标准库中包含telnet,用起来也很方便,查看一下文档写了个小程序:[python]view plaincopy#!/usr/bin/envpytho...
分类:编程语言   时间:2014-08-16 13:44:10    阅读次数:283
筛选网址
#!/usr/bin/env python#!-*-coding=utf-8-*-import refp=open("/home/xyt/桌面/erp_access.log","r")str=fp.readline()while str: str=fp.readline() ...
分类:其他好文   时间:2014-08-16 13:43:30    阅读次数:260
LeetCode——Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers ...
分类:其他好文   时间:2014-08-16 12:35:30    阅读次数:233
线段树模版
#include #include #include #include #include #include #include #include #define maxn 8080 #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define ALL %I64d using namespace std; typedef long ...
分类:其他好文   时间:2014-08-16 12:35:20    阅读次数:240
Shell学习之: 脚本之间的调用
在Java,Python中,可以用import的方式来进行脚本或模块之间调用,例如: >>> import math >>> math.sqrt(4) 2.0 在Shell中要如何调用别的shell脚本,或别的脚本中的变量,函数呢? 方法一: . ./subscript.sh 方法二: source ./subscript.sh 注意: 两个点之间,有空格,千万注意. 两个脚本不在同一目录,要用绝对路径 例如: main.sh #主脚本 subcripts.sh ...
分类:其他好文   时间:2014-08-16 12:34:40    阅读次数:176
python 解析 json
#coding=utf=8import urllib,jsonurl ='https://api.douban.com/v2/book/user/62855846/collections'read = urllib.urlopen(url).read()j = 0titles=[]atls=[]im...
分类:编程语言   时间:2014-08-16 12:31:50    阅读次数:230
java注释规范
1.文件注释:写在文件头部,包名之前的位置。范例如下。/** * 文件名:TestCode.java * 版权:Copyright 2014-2015 Hdu.All Rights Reserved. * 描述: xxxxxxxx * 修改人:xxx * 修改时间:2014-5-12 * 修改内容....
分类:编程语言   时间:2014-08-16 12:25:40    阅读次数:214
raw_input() 与 input() __ Python
这两个均是 python 的内建函数,通过读取控制台的输入与用户实现交互。但他们的功能不尽相同。举两个小例子。 1 >>> raw_input_A = raw_input("raw_input: ") 2 raw_input: abc 3 >>> input_A = input("Input: .....
分类:编程语言   时间:2014-08-16 11:08:20    阅读次数:269
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!