コード例 #1
0
ファイル: U.py プロジェクト: QGB/QPSU
def cmd(*a):
	import T
	s=''
	if iswin():quot='"'
	if len(a)==0:
		if iswin():a=['cmd']
		# TODO #
	if len(a)==1:
		if type(a[0])==type(''):s=a[0]
		elif len(a[0])==1:s=T.string(a[0])
		elif len(a[0])>1:a=a[0]
	if len(a)>1:
		a=list(a)
		s=T.string(a.pop(0))+' '
		for i in a:
			if type(i)==type([]):
				for j in i:	
					s+=quot+T.string(i)+quot+' '
			else:
				s+=quot+T.string(i)+quot+' '
			
	# pln(s)
	# exit()
	try:
		return os.system(s)
	except:return -2
コード例 #2
0
ファイル: U.py プロジェクト: QGB/QPSU
def calltimes(a=''):
	import T
	a='_count'+T.string(a)
	if calltimes.__dict__.has_key(a): 
		calltimes.__dict__[a]+=1
	else:
		calltimes.__dict__[a]=0
	return calltimes.__dict__[a]