第十五届全国大学生智能车智能车竞赛国赛电子证书制作

01竞赛获奖证书


由于 第十五届全国大学生智能车竞赛 结束时间短,距离各个地区新学期开学日期(9月1日)比较近。很多参赛队伍面临着新的一学期的 推免研究生 的活动临近,需要更快的获得获奖证书。

相比于传统的办法纸质的获奖证书,直接给参赛队伍发送获奖证书的纸质版本更加的便捷。为了便于学校对证书的查伪,在证书右下角设置竞赛成绩公布网站的链接二维码。

证书的电子版本采用统一的 证书模板和用语 。包括有三个模板:

  • 参赛学生获奖证书
  • 指导教师获奖证书
  • 参赛队伍获奖证书

▲ 获奖证书模板

▲ 获奖证书模板

用于电子证书防伪,竞赛组委会将会把获奖信息统一发布在竞赛网站:

http://smartcar.cdstm.cn


02国赛获奖证书下载


※ 附录


#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# FINALPRN.PY                  -- by Dr. ZhuoQing 2020-09-01
#
# Note:
#============================================================

from head import *
import pandas as pd
import certsub

excelfilename = tspstring2text('final')
printf(excelfilename)

excelfile = pd.read_excel(excelfilename, sheet_name='Sheet1')
exceldata = excelfile.values.tolist()

for id,l in enumerate(exceldata):

    if type(l[1]) != str: continue
    teacher = l[6:8]
    student = l[8:13]
    college = l[1]
    team = l[2]
    group = l[3]
    award = l[5]
    area = '全国总决赛'

#    printf(l)

    ret = certsub.collegecert(college, team, group, award, area, teacher, student)
#    break

printf('\a')

#------------------------------------------------------------
#        END OF FILE : FINALPRN.PY
#============================================================
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# FINALEXCEL.PY                  -- by Dr. ZhuoQing 2020-09-01
#
# Note:
#============================================================

from head import *
import pandas as pd
import certsub

#------------------------------------------------------------
excelfilename = tspstring2text('final')
#printf(excelfilename)

excelfile = pd.read_excel(excelfilename, sheet_name='Sheet1')
exceldata = excelfile.values.tolist()

printff('序号', '学校', '队伍', '组别', '奖项', '姓名', '类别')
count = 0

#------------------------------------------------------------
tabflag = 0
if len(sys.argv) > 1:
    tabflag = 1

#------------------------------------------------------------
for id,l in enumerate(exceldata):

    if type(l[1]) != str: continue
    if type(l[5]) != str: continue

    teacher = l[6:8]
    student = l[8:13]
    college = l[1]
    team = l[2]
    group = l[3]
    award = l[5]

    for st in student:
        if type(st) != str: continue
        if len(st) == 0: continue
        if st == '-':    continue

        st = st.strip('\xa0').strip('\u4dae')
        count += 1

        if tabflag != 0:
            printff(count, '\t', college, '\t', team.replace(' ', '_'),'\t',  group, '\t', award,'\t',  st, '\t', '参赛学生')
        else:
            printff(count, college, team.replace(' ', '_'), group, award, st, '参赛学生')

    for st in teacher:
        if type(st) != str: continue
        if len(st) == 0: continue
        if str == '-':   continue
        st = st.strip('\xa0').strip('\u4dae')
        count += 1

        if tabflag != 0:
            printff(count,'\t',  college,'\t',  team.replace(' ', '_'), group, '\t', award, '\t', st,'\t',  '指导教师')
        else:
            printff(count, college, team.replace(' ', '_'), group, award, st, '指导教师')

printf('\a')

tspmsgcopy()

#------------------------------------------------------------
#        END OF FILE : FINALEXCEL.PY
#============================================================
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# CERTSUB.PY                   -- by Dr. ZhuoQing 2020-09-01
#
# Note:
#============================================================

from head import *

studentpic = 2
teacherpic = 3
teampic = 4

studenttext = 7
studentarea = 26
studentaward = 6
studentgroup = 8

teachertext = 11
teacherteamtext = 19
teacherarea = 27
teacheraward = 10
teachergroup = 12

teamtext = 15
teamarea = 28
teamaward = 14
teamgroup = 16

#------------------------------------------------------------
def studentsave(filename, t='大红袍大学 苹果派', group='基础四轮组', area='全国总决赛', award='一等奖'):
    tspsettext(studenttext, t)
    tspsettext(studentarea, area)
    tspsettext(studentaward, award)
    tspsettext(studentgroup, group)
    tspsaveimagerange(studentpic, filename, 0, ratio100=100)

def teachersave(filename, t='大红袍大学 特朗普', tt='不靠谱队', group='基础四轮组', area='全国总决赛', award='一等奖'):
    tspsettext(teachertext, t)
    tspsettext(teacherteamtext, tt)
    tspsettext(teacherarea, area)
    tspsettext(teacheraward, award)
    tspsettext(teachergroup, group)
    tspsaveimagerange(teacherpic, filename, 0, ratio100=100)

def teamsave(filename, t='大红袍大学 苹果派队伍', group='基础四轮组', area='全国总决赛', award='一等奖'):
    tspsettext(teamtext, t)
    tspsettext(teamarea, area)
    tspsettext(teamaward, award)
    tspsettext(teamgroup, group)
    tspsaveimagerange(teampic, filename, 0, ratio100=100)

#------------------------------------------------------------
tempfile = r'd:\temp\1.jpg'
def collegecert(college, team, group, award, area, teacher, student):
    if type(college) != str:    return 1
    if len(college) == 0:       return 2

    if type(award) != str:      return 3
    if len(award) == 0:         return 4

    if award == '-':            return 3

    for i in range(len(teacher)):
        if type(teacher[i]) != str: continue
        teacher[i] = teacher[i].strip('\r').strip('\n').strip('\xa0').strip('\u4dae')

    for i in range(len(student)):
        if type(student[i]) != str: continue
        student[i] = student[i].strip('\n').strip('\n').strip('\xa0').strip('\u4dae')

    college = college.strip('\n').strip('\n').strip('\a')
    team = team.strip('\n').strip('\n').strip('\a')
    group = group.strip('\n').strip('\n').strip('\a')
    award = award.strip('\n').strip('\n').strip('\a')

    for i in range(len(student)):
        st = student[i]
        if type(st) != str: continue
        if len(st) == 0:    continue
        if st == '-':       continue

        filebase = '-'.join([college, team, group, st]) + '.JPG'
        filename = os.path.join(r'd:\temp', filebase)
        printf(filename)

        tname = college +' '+ st

        if os.path.isfile(filename):
            continue
#            os.remove(filename)

        studentsave(tempfile, t=tname, area=area, award=award, group=group)
        os.rename(tempfile, filename)

    for i in range(len(teacher)):
        st = teacher[i]
        if type(st) != str:     continue
        if len(st) == 0:        continue
        if str == '-':          continue

        filebase = '-'.join([college, team, group, st]) + '.JPG'
        filename = os.path.join(r'd:\temp', filebase)
        printf(filename)

        tname = college + ' '+ st

        teamname = team
        if teamname.find('队') < 0: teamname = teamname + '队'

        if os.path.isfile(filename):
            continue
#            os.remove(filename)

        teachersave(tempfile, t=tname, tt=teamname, area=area, award=award, group=group)
        os.rename(tempfile, filename)

    filebase = '-'.join([college, team, group]) + '.JPG'
    filename = os.path.join(r'd:\temp', filebase)
    printf(filename)

    if os.path.isfile(filename): return 0
#        os.remove(filename)

    teamname = team
    if teamname.find('队') < 0: teamname = teamname + '队'
    teamsave(tempfile, t=teamname, area=area, award=award, group=group)
    os.rename(tempfile, filename)

    return 0

#------------------------------------------------------------
if __name__ == "__main__":
    teacher = ['教师1', '教师2']
    student = ['学生1', '学生2', '学生3', '学生4', '学生5']

    ret = collegecert('水果加工厂', '大苹果', '普通四轮组', '四等奖', '全国总决赛', teacher, student)

    printff(ret, '\a')

#------------------------------------------------------------
#        END OF FILE : CERTSUB.PY
#============================================================

猜你喜欢

转载自blog.csdn.net/zhuoqingjoking97298/article/details/108335225