C++中调用Python脚本的意义就不讲了,至少你可以把它当成文本形式的动态链接库,
需要的时候还可以改一改,只要不改变接口, C++的程序一旦编译好了,再改就没那么方便了
先看Python的代码
代码:
#test function
def add(a,b):
print "in python function add...
分类:
编程语言 时间:
2015-04-30 08:52:50
阅读次数:
184
++++原生的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
//关闭脚本#!/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
看代码;利用urlopen中的超时参数设立一个循环while True: try: page = urllib.request.urlopen(url, timeout=3) break except: tracebake.print_exc()...
分类:
编程语言 时间:
2015-04-29 18:56:48
阅读次数:
167
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会导致循环中断[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
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
一、代码引导 首先看这一段代码: ?>>>?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
#/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