当前位置: 首页>>代码示例>>Python>>正文


Python DataBase.insertData方法代码示例

本文整理汇总了Python中database.DataBase.insertData方法的典型用法代码示例。如果您正苦于以下问题:Python DataBase.insertData方法的具体用法?Python DataBase.insertData怎么用?Python DataBase.insertData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在database.DataBase的用法示例。


在下文中一共展示了DataBase.insertData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Principal

# 需要导入模块: from database import DataBase [as 别名]
# 或者: from database.DataBase import insertData [as 别名]

#.........这里部分代码省略.........
				check = False
			if check == None:
				nameCompetitor = " "
				
				category = "Moto"
				if int(numCompetitor) >= self.minMoto and int(numCompetitor) <= self.maxMoto:
					category = "Moto"
				elif int(numCompetitor) >= self.minQuad and int(numCompetitor) <= self.maxQuad:
					category = "Quad"
				elif int(numCompetitor) >= self.minCar and int(numCompetitor) <= self.maxCar:
					category = "Car"
				if int(allData[8].split(";")[1]) == 0:
					wpt = "OK"
				else:
					wpt = "NOK"
				if int(allData[10].split(";")[1]) == 0:
					disc = "OK"
				else:
					disc = "NOK"
				try:
					if int(allData[15].split(";")[1]) == 0:
						dz = "OK"
				except:
					dz = "NOK"
					dzDismiss = allData[15].split(";")
					for i,dzValue in enumerate(dzDismiss):
						if i !=0:
							self.db.insertDz(int(numCompetitor),dzValue)
							
				codNum = int(allData[5].split(";")[1])
				version = "2.0"
				gpsNumber = allData[3].split(";")[1]
				obs = " "
				self.db.insertData(int(numCompetitor),nameCompetitor,category,wpt,dz,disc,codNum,version,gpsNumber,obs)
				for line in allData:
					try:
						if findWord:
							tmpnum = line.split(";")[3]
							num = tmpnum.split(":")[1]
							zonePassed.append(int(num))
						if line.startswith('InfosChronos') :
							findWord = True
					except:
						pass
				zoneDismiss = list(set(self.countZone) - set(zonePassed))
				for a in zoneDismiss:
					self.db.insertZoneDismiss(numCompetitor,a)
			#except:
				#pass
					
		self.countVehicles()
		self.mainTable()

	def countVehicles(self):
		"""Count how many different vehicle exist and count each of them, then show it on 
		a text area
		"""
		rows = self.db.get_category()

		self.minMoto = rows[0][2]
		self.maxMoto = rows[0][3]
		self.minQuad = rows[1][2]
		self.maxQuad = rows[1][3]
		self.minCar = rows[2][2]
		self.maxCar = rows[2][3]
开发者ID:rbistolfi,项目名称:gps-tracking,代码行数:69,代码来源:run.py


注:本文中的database.DataBase.insertData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。