Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankGrossman committed Jun 11, 2021
0 parents commit 9c74a72
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Imports
import sqlite3
# Establish connection to database
conn = sqlite3.connect('python.db')
c = conn.cursor()
# Create global variable name
name = ""

def create_table():
global name # Retrieve global variable name
c.execute('CREATE TABLE IF NOT EXISTS RecordONE (Number REAL, Name TEXT)') # DB execution
name = input("What is your name?") # Input to global variable name

def data_entry():
number = "1234"
c.execute("INSERT INTO RecordONE (Number, Name) VALUES(?, ?)", (number, name)) # Execute sql

# Call functions
create_table()
data_entry()

# Save changes to DB
conn.commit()

# Close connection
c.close()
conn.close()
Binary file added python.db
Binary file not shown.

0 comments on commit 9c74a72

Please sign in to comment.