How to execute sql Python script in Windows command Prompt?
Question: I have a simple script that uses sqlite3 in Python.

However, when I run this from cmd.exe in Windows I get an "Open With" window.
If I click 'cancel' it says "Access is denied." in cmd.exe.

    
    
    import sqlite3
    connection = sqlite3.connect("test_database.db")
    c = connection.cursor()
    c.execute("CREATE TABLE People(FirstName TEXT, LastName TEXT, Age INT)")
    c.execute("INSERT INTO People VALUES('Ron','Obvious',42)")
    connection.commit()
    connection.close()
    

I can run Python scripts fine from cmd.exe. I just have this problem because
I'm using sqlite?

(Also, I have the sqlite path in PATH)

How can I stop this "Open with" window appearing, and actually get my script
to run correctly from cmd.exe?


Answer: Running myscript.py in cmd does not work if I use import sqlite. Instead, I
ran "python myscript.py" and the script runs fine.

Thanks to @nerdwaller.

