OCR Project.py
def Btn_OCR_Save_Config_File(self, event=None):
		'''
		Save all added scan areas to csv file.
		'''
		_scan_type = self.ScanType.get()

		filename = filedialog.asksaveasfilename(title = "Select file", filetypes = (("Scan Config", "*.csv"),),)
		filename = self.CorrectExt(filename, "csv")
		if filename == "":
			return
		else:
			with open(filename, 'w', newline='') as csvfile:

				fieldnames = ['x', 'y', 'w', 'h', 'x1', 'y1', 'w1', 'h1']
			
				writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
				writer.writeheader()
				for row in self.Treeview.get_children():
					child = self.Treeview.item(row)
					values = child["values"]	
					writer.writerow({'x': values[0], 'y': values[1], 'w': values[2], 'h': values[3], 'x1': values[4], 'y1': values[5], 'w1': values[6], 'h1': values[7]})

		Save all added scan areas to csv file.
		
Save all added scan areas to csv file.
Save all added scan areas to csv file .
def Btn_OCR_Save_Config_File(self, event=None):
		_scan_type = self.ScanType.get()
		filename = filedialog.asksaveasfilename(title = "Select file", filetypes = (("Scan Config", "*.csv"),),)
		filename = self.CorrectExt(filename, "csv")
		if filename == "":
			return
		else:
			with open(filename, 'w', newline='') as csvfile:
				fieldnames = ['x', 'y', 'w', 'h', 'x1', 'y1', 'w1', 'h1']
				writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
				writer.writeheader()
				for row in self.Treeview.get_children():
					child = self.Treeview.item(row)
					values = child["values"]	
					writer.writerow({'x': values[0], 'y': values[1], 'w': values[2], 'h': values[3], 'x1': values[4], 'y1': values[5], 'w1': values[6], 'h1': values[7]})
def Btn_OCR_Save_Config_File ( self , event = None ) : _scan_type = self . ScanType . get ( ) filename = filedialog . asksaveasfilename ( title = "Select file" , filetypes = ( ( "Scan Config" , "*.csv" ) , ) , ) filename = self . CorrectExt ( filename , "csv" ) if filename == "" : return else : with open ( filename , 'w' , newline = '' ) as csvfile : fieldnames = [ 'x' , 'y' , 'w' , 'h' , 'x1' , 'y1' , 'w1' , 'h1' ] writer = csv . DictWriter ( csvfile , fieldnames = fieldnames ) writer . writeheader ( ) for row in self . Treeview . get_children ( ) : child = self . Treeview . item ( row ) values = child [ "values" ] writer . writerow ( { 'x' : values [ 0 ] , 'y' : values [ 1 ] , 'w' : values [ 2 ] , 'h' : values [ 3 ] , 'x1' : values [ 4 ] , 'y1' : values [ 5 ] , 'w1' : values [ 6 ] , 'h1' : values [ 7 ] } )
Save all added scan areas to csv file.
Save all added scan areas to csv file .
'''
		Save all added scan areas to csv file.
		'''
self
event