mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			339 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			339 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import sqlite3
 | |
| 
 | |
| con = sqlite3.connect("mydb")
 | |
| 
 | |
| cur = con.cursor()
 | |
| 
 | |
| languages = (
 | |
|     ("Smalltalk", 1972),
 | |
|     ("Swift", 2014),
 | |
| )
 | |
| 
 | |
| for lang in languages:
 | |
|     cur.execute("insert into lang (name, first_appeared) values (?, ?)", lang)
 | |
| 
 | |
| # The changes will not be saved unless the transaction is committed explicitly:
 | |
| con.commit()
 | |
| 
 | |
| con.close()
 | 
