def __init__(self):
        # load template and base data
        self.userinfo = modUserInfo.modUserInfo()
        self.userinfo.loadbaseinfo(4)
        self.userinfo.loadtemplate()

        # get begin date
        begin_date = datetime.date(
            int(self.userinfo.begin_year), int(self.userinfo.begin_month), int(self.userinfo.begin_day)
        )
        self.delta = datetime.timedelta(days=7)
        self.now = begin_date
        # nowarr=str(now).split('-')
        self.next = self.now + self.delta
        # nextarr=str(next).split('-')

        # init some value
        self.flag = False

        # made 2*2 matrix array to sort
        self.arr = modPublic.sarray()
        for i in range(100):
            for j in range(100):
                self.arr.teamA[i][j] = ""
                self.arr.teamB[i][j] = ""
                self.arr.black[i][j] = False
                self.arr.isOver[i][j] = False

                # load template and set team name to template
        self.loadtemplate(str(self.userinfo.count), str(self.userinfo.team_count))

        # export excel
        self.export_excel()
	def __init__(self):
		#load template and base data
		self.userinfo=modUserInfo.modUserInfo()
		self.userinfo.loadbaseinfo(3)
		self.userinfo.loadtemplate()

		#get begin date
		begin_date = datetime.date(int(self.userinfo.begin_year),int(self.userinfo.begin_month),int(self.userinfo.begin_day))
		delta = datetime.timedelta(days=7)
		now=begin_date
		#nowarr=str(now).split('-')
		next=now+delta
		#nextarr=str(next).split('-')

		#init some value
		self.flag=False

		#made 2*2 matrix array to sort
		self.arr=modPublic.sarray()
		for i in range(100):
			for j in range(100):
				self.arr.teamA[i][j]=""
				self.arr.teamB[i][j]=""
				self.arr.black[i][j]=False
				self.arr.isOver[i][j]=False
		
		#sort game
		k=0	#field number
		d=0	#day numer
		n=0	#round number
		for i in range(self.userinfo.team_count):
			for j in range(self.userinfo.team_count):
				if i<j:
					self.userinfo.field[0].date[d]=now
					self.arr.teamA[i][j]=self.userinfo.team[i].name
					self.arr.teamB[i][j]=self.userinfo.team[j].name
					
					#round first
					if n<self.userinfo.count:
						n+=1	#if round is not use end, then use other round to start contest.
					else:
						n=0		#if all field and all round is full, then user other days.
						d+=1
						now=next	#update date information
						next=next+delta	
						
					print i,j
					print str(d)+" "+str(n)
					print self.userinfo.field[0].date[d]
					print self.userinfo.team[i].name + " VS " + self.userinfo.team[j].name
		
		
		#d is need skip.#
		self.maxd=d+1
		
		#enum array
		self.enumarray_main()
		
		#export excel
		self.export_excel()
import win32com.client
import win32ui

#my self module to process some question
import modUserInfo
import modOffice
import modPublic
import modString


#load string handle module
string=modString.modString()
string.Number2ABC(26)

#load template and base data
userinfo=modUserInfo.modUserInfo()
userinfo.loadbaseinfo(5)
userinfo.loadtemplate()

#create excel
office=modOffice.modOffice()
office.create_excel_app()
office.create_excel_workbook()
office.create_excel_sheets()

#set contest title
for i in range(userinfo.team_count):
	office.sheet.Cells(i+2, 1).Value=userinfo.team[i].name
	office.sheet.Cells(1, i+2).Value=userinfo.team[i].name
	office.sheet.Cells(i+2, i+2).Value="X"