Join Bruce Van Horn for an in-depth discussion in this video Working with In-Line SQL (DML), part of Learning Python with PyCharm.
- [Instructor] Let's add some code…to our database utility script…that actually saves the words to our database.…So, I'm going to scroll down…and so I can see this save_words_to_database method stub…that I already have in here…and I'm just going to get rid of what's in here.…Now, for this one the first thing I'm going to want to do…I want to connect to the database that we have,…so I'll say conn equals lite.connect…and I've done this again…where I've passed in the database path…so I will just take database_path here…and now I have my connection.…As before I'll do with conn…and I'll create a cursor…and now I'm going to deal with that second parameter…up there on line 16 the word list.…
So, for each word and list…I'm going to save to the database.…So, I'll say for word in word_list…and really what I want to do here…is I want to check to see if the word…is already in there and if it is then I want to update…the usage count and if it's not in there…then I'm going to go ahead and insert it.…So, I'll go ahead and make a comment to that effect…
AuthorBruce Van Horn
- Installing the PyCharm, Git, and Pypy packages
- Adding functions
- Refactoring code
- Calling packages
- Debugging code
- Creating databases
- Working with in-line SQL
- Creating web projects with PyCharm
Skill Level Beginner
1. First Steps with PyCharm
2. Code Quality
3. Working with Databases
4. Web Projects
Odds and ends5m 42s
Next steps1m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.