예제 #1
0
파일: alias.py 프로젝트: eescanilla/WShell
def _start(lnk=False):
    ''' a0 stdin.name stdin
		a0 a1 stdin
		a0 a1.name a1
		a0 a1 a2
		
	'''
    start = '''@start "" "{0}"'''
    # if U.debug():print a,'\n',U,T,N,F
    # if len(a)==2:

    sp = S.getStdinPath()
    if sp:
        sp = S.path.abspath(sp)
        # start=start.format(sp)
    # else:

    if len(a) == 1:
        if sp:
            a.append(F.getNameWithoutExt(sp))
            a.append(sp)
        else:
            help_()
    if len(a) == 2:
        if sp: a.append(sp)
        else:
            a[1] = T.sub(U.getCmd(), S.a[0], '').strip()  #忽略空格路径影响
            # U.ipy()
            a[1] = S.path.abspath(a[1])
            a.append(a[1])
            if U.debug(): print(a, F.getNameWithoutExt(a[1]))
            a[1] = F.getNameWithoutExt(a[1])
    if len(a) == 3:
        a[1] == path(a[1])
        a[2] = S.path.abspath(a[2])

        if S.path.exists(a[2]):
            if lnk:
                a[2] = '"{}"'.format(a[2])
            else:
                a[2] = start.format(a[2])
        else:
            help_()
    # if '{0}' not in start:
    # a[1]=path(a[1])

    write(a[1], a[2])

    # else:

    exit()
예제 #2
0
파일: alias.py 프로젝트: QGB/Wshell
def _start():
	start='''@start "" "{0}"'''
	if len(a)==2:
		sp=S.getStdinPath()
		if sp:
			start=start.format(sp)
			# print start,sp
			
	elif S.path.exists(a[2]):
		start=start.format(S.path.abspath(a[2]))
	if '{0}' not in start:
		a[1]=path(a[1])
		
		write(a[1],start)
	exit()	
예제 #3
0
파일: office.py 프로젝트: QGB/Wshell
import S

if len(S.a)==1 and not S.stdinToa():print S.name,'File(doc,xls,ppt...)'   ;exit()

soffice='''D:\Program Files\MicrosoftOffice2003Portable\MicrosoftOffice{0}Portable.exe'''

doffice={'word':('doc','docx'),
'excel':('xls','xlsx'),
'powerpoint':('ppt','pptx')
}


for i in doffice.keys():
	exec('s{0}=soffice.format(i)'.format(i))
	
	

# print sword
# if S.a[1].endswith('doc'):U.run(sword,S.a[1])


예제 #4
0
import S

import subprocess as s

o=s.check_output(['systeminfo'])

print o[:99]

# print list(expand_list(ft))
exit()


if len(S.a)==1 and not S.stdinToa():print S.name,'File',ft   ;exit()

if U.inMuti(S.a[1],ft,func=''.endswith):
	print 2333


U.run(S.a)



예제 #5
0
    attrs = []
    for l in list:
        v = getattr(l, attr)
        if isinstance(v, float):
            attrs.append("%.2f" % v)
            pass
        else:
            attrs.append(v)
            pass
        pass

    return attrs
    pass


list = S.read_from_xls()
S.compute_with_lastest_price(list)

column_names = [
    'name', 'code', "current", 'pbCurrent', 'price2', 'pb2', 'price5', 'pb5',
    'roe2', 'roe5', 'roe2017', 'roe2016', 'roe2015', 'roe2014', 'roe2013',
    'roe2012', 'roe2011', 'roe2010'
]
data = {}
for c in column_names:
    data[c] = get_attr_list(list, c)
    pass

df = pd.DataFrame(data, columns=column_names)

if not os.path.exists("s"):
예제 #6
0
파일: office.py 프로젝트: eescanilla/WShell
import S

if len(S.a) == 1 and not S.stdinToa():
    print S.name, 'File(doc,xls,ppt...)'
    exit()

soffice = '''D:\Program Files\MicrosoftOffice2003Portable\MicrosoftOffice{0}Portable.exe'''

doffice = {
    'word': ('doc', 'docx'),
    'excel': ('xls', 'xlsx'),
    'powerpoint': ('ppt', 'pptx')
}

for i in doffice.keys():
    exec('s{0}=soffice.format(i)'.format(i))

# print sword
# if S.a[1].endswith('doc'):U.run(sword,S.a[1])