码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
Python条件语句和运算符
if ?else形式 [nxuser@PSjamsBond-0-0-0?~]$?vi?testoperator.py #!/bin/python #operator?testing number1=111 number2=222 if(number1>number2): ??print("num1>num2") else: ??print("num2>num1"...
分类:编程语言   时间:2014-11-05 20:00:21    阅读次数:266
python的*和**参数
python里面有两个比较有特色的函数入参,*和**,按照习惯,一般命名为: def func(*args, **kwargs): pass 如果要打印出来的话,args是一个元组,kwargs是一个字典,下面来看几个例子: def func_a(**kwargs): print kwargsa = {"key": "value"}func_a(a) #func_a...
分类:编程语言   时间:2014-11-05 13:11:33    阅读次数:191
Python基础9- 字典
#coding=utf8#字典由键和对应的值组成(键值对)--哈希表,字典元素也可以为空dict1 = {'name':'kaly','age':20,'sex':'male'}dict2 = {}#键与值间需用冒号隔开,每一对键之间需要逗号作为分隔符,键与值的关系为一对多的print dict1#...
分类:编程语言   时间:2014-11-05 12:29:11    阅读次数:146
打印机无法打印文件
1.service里面的print spooler服务没有打开。解决方法就是手动去启动这个服务就可以了2.print spooler服务启动之后,但是过了大概半分钟之后又自动关闭了。这时候要做的事情就是:清空C:\WINDOWS\system32\spool\PRINTERS 目录下所有的文件,正常...
分类:其他好文   时间:2014-11-04 19:30:06    阅读次数:140
SHELL AWK 循环求和
1、简单求和,文件如下:[linux@test /tmp]$ cat test123.52125.54126.36求和:[linux@test /tmp]$ awk '{sum += $1};END {print sum}' test375.422、过滤条件求和:[linux@test /tmp]$...
分类:系统相关   时间:2014-11-04 19:21:14    阅读次数:334
Crystal Report 处理当前系统时间
原文:Crystal Report 处理当前系统时间Changed the print date format to HH/yy/MM/mm/SS/dd (For Example:2014/01/23 16:30:45= 161430014523) : iif(Hour(CurrentTime)<1...
分类:其他好文   时间:2014-11-04 19:12:52    阅读次数:172
web.py下获取get参数
比较简单,就直接上代码了:import weburls = ( '/', 'hello')app = web.application(urls, globals())class hello: def GET(self): print web.input() ...
分类:Web程序   时间:2014-11-04 16:37:04    阅读次数:206
python【二】python的字符串操作
python的字符串操作很灵活;先来看一个例子: str='helloworld' 首先我们输出这个字符串: print  str这是一种表示方法,还有很多表示的方法; 比如: print  str[0:10] 我们也能得到 helloworld print str[1:3] 我们得到:el,截取字符串的el两个字符;   截取字符串的前提条件: 是这样的我们如果要截取某段...
分类:编程语言   时间:2014-11-04 15:04:07    阅读次数:200
Python tip 题目笔记
翻转字符串 x = '123456' y = x[::-1]给你一字典a,如a={1:1,2:2,3:3},输出字典a的key,以','链接,如‘1,2,3'。 print ','.join([str(i) for i in a])给你一个字符串 a, 输出字符奇数位置的字符...
分类:编程语言   时间:2014-11-04 14:28:00    阅读次数:237
hdu 4791 Alice's Print Service (DP+离线处理)
hdu 4791 Alice's Print Service (DP+离线处理)—— black的专栏 —— waShaXiu...
分类:其他好文   时间:2014-11-04 13:10:01    阅读次数:148
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!