码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
C/C++中如何调用Python
C++中调用Python脚本的意义就不讲了,至少你可以把它当成文本形式的动态链接库,  需要的时候还可以改一改,只要不改变接口, C++的程序一旦编译好了,再改就没那么方便了  先看Python的代码  代码: #test function  def add(a,b):      print "in python function add...
分类:编程语言   时间:2015-04-30 08:52:50    阅读次数:184
web 打印那些事
++++原生的windows.print++++ ? ? ? 一开始我是使用基于jQuery的jqprint类库进行打印的,由于后来需求的变更,这款插件已经不能够满足了,与其类似的还有printArea,printPage等,值得一说的是他们使用的都是原...
分类:Web程序   时间:2015-04-30 06:28:14    阅读次数:130
简单四则运算计算器
#include void print(void) { printf("*************************\n"); printf("*****1:add 2:sub*******\n"); printf("*****3:mul 4:div*******\n"); printf("*************************\n"...
分类:其他好文   时间:2015-04-29 21:41:59    阅读次数:210
通过shell脚本开始和结束守护进程
//关闭脚本#!/bin/shWHOAMI=`whoami`PID=`ps -u $WHOAMI | grep 守护进程名 | awk '{print $1}'`if (用户名 "$PID" != "") then kill 参数 $PIDfi// 开始脚本#!/bin/shWHOAMI=`who....
分类:系统相关   时间:2015-04-29 21:20:33    阅读次数:142
如何解决python中urlopen超时问题
看代码;利用urlopen中的超时参数设立一个循环while True: try: page = urllib.request.urlopen(url, timeout=3) break except: tracebake.print_exc()...
分类:编程语言   时间:2015-04-29 18:56:48    阅读次数:167
Python 编写登陆接口,输入用户名密码,认证成功后显示欢迎信息,输入错误三次锁定
file=open(‘lock.txt‘).readlines()name=input(‘username:‘).strip()lock=[]foriinfile:line=i.strip(‘\n‘)lock.append(line)ifnameinlock:print(name,‘已经被锁定,请联系开户行.退出!‘)else:i=1whilei<=3:i=i+1print(‘........................‘)username=nameprint(userna..
分类:编程语言   时间:2015-04-29 17:38:18    阅读次数:587
python中如果在while循环中是return会导致循环中断
python中如果在while循环中是return会导致循环中断[root@10.144.5.223root]#cattest_while_return.pycount=0while(count<6):print‘Thecountis:‘,countcount=count+1print"Goodbye!"print‘-‘*20while(count>=3):print‘Thecountis:‘,countcount-=1print"Goodbye!"print‘-‘*..
分类:编程语言   时间:2015-04-29 17:32:27    阅读次数:817
python 的装饰器使用
classShoping: name={} @staticmethod defadd(): #name[‘1‘]=(‘name‘) aa=("print内部方法在调用") print(aa) return(aa) @classmethod deftest(self): print("这是我使用类方法调用!") #returnself.add()
分类:编程语言   时间:2015-04-29 15:18:54    阅读次数:162
python zip函数
一、代码引导 首先看这一段代码: ?>>>?name=(‘jack‘,‘beginman‘,‘sony‘,‘pcky‘)? ?>>>?age=(2001,2003,2005,2000) ?>>>?for?a,n?in?zip(name,age):? ?????????print?a,n?5??6? 输出:?...
分类:编程语言   时间:2015-04-29 12:02:47    阅读次数:163
C++对文本里面的大量数据进行排序(shell,c++,fopen,awk,sed)
#/bin/bash #对文本里面的数据进行排序 awk 'BEGIN{ RS="," } {print $0} END{ }'<a | sort -n | sed '/^$/ d' | awk 'BEGIN{ RS="\n";ORS="," } {print $0} END{ }'|sed 's/,$//g' 下面是c++版本的。 ---------------------------...
分类:编程语言   时间:2015-04-29 11:53:20    阅读次数:183
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!