Insert List into Sqlite with Python

295
February 20, 2018, at 10:07 AM

I'm getting user input to create a list and I'd like to insert this list into a sqlite database.

Here's my code:

while add.lower() == "y":
    it = input("Enter the Full Path to add: Ex. OU=computers,DC=example,DC=com:")
    ouList.append(it)
    add = input("Do you wish to add an OU? Y or N?")

def ouList():
    for ou in ouList:
        c.execute("INSERT INTO account (ou) VALUES(?)", (ou_list))
    conn.commit()

It creates this list correctly as I've printed this out during tests, it's just not inserted into SQLite.

I'm confident that this is something simple, I'm just overlooking it.

READ ALSO
Implementing the New York Times' rent vs. buy calculator

Implementing the New York Times' rent vs. buy calculator

I'm interested in reproducing the New York Times' Rent vsBuy Calculator

153
For loop not executing properly, not appending to list

For loop not executing properly, not appending to list

I am trying to create a discord bot for a personal project to better myself at Python programmingHowever, I ran into an issue

132
What difference does it make change the order which you import modules on Python?

What difference does it make change the order which you import modules on Python?

So i was trying to learn the basics of creating GUI's with Tkinter, and i found this code in a tutorial:

206