#19 - Reformat pbm file
Convert pbm file to csv with right height and width
This commit is contained in:
		
							
								
								
									
										11
									
								
								utils/savetofile.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								utils/savetofile.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| """ | ||||
| 	Save a two dimension array in a file | ||||
| """ | ||||
|  | ||||
| def matrixToFile(matrix, fileName): | ||||
| 	with open(fileName, 'w') as f: | ||||
| 		for x in matrix: | ||||
| 			for y in x: | ||||
| 				f.write('%s ' % y ) | ||||
| 			f.write('\n') | ||||
| 	 | ||||
		Reference in New Issue
	
	Block a user
	 Marc-Antoine Lafreniere
					Marc-Antoine Lafreniere