Well, there is no quick way, I guess.
But here are some thoughts:
For many projects SQLite should do the trick. It's even in Python's Standard Libraries (sqlite3)
One advantage: SQLite doesn't require an SQL server.
Disadvantage: It lacks some advanced functionality.
It is in fact a single external file, but you don't need to manage it by yourself.
When you feel the urge to put your data into spreadsheets, SQLite might be the solution.
Very quick intro:
Start with import sqlite3
Create a database file and connect to it: connection = sqlite3.connect('myfirst.db')
Create a cursor object: crs = connection.cursor()
Make the cursor execute some tasks:
crs.execute("CREATE TABLE sometable ...
crs.execute("INSERT INTO sometable VALUES ...
Python SQL
Can someone quickly explain SQL to me, how to use it and why or if its better than external files, thanks
IK its database but that's it, I need this for a project
Well, there is no quick way, I guess.
But here are some thoughts:
For many projects SQLite should do the trick. It's even in Python's Standard Libraries (sqlite3)
One advantage: SQLite doesn't require an SQL server.
Disadvantage: It lacks some advanced functionality.
It is in fact a single external file, but you don't need to manage it by yourself.
When you feel the urge to put your data into spreadsheets, SQLite might be the solution.
Very quick intro:
Start with
import sqlite3
Create a database file and connect to it:
connection = sqlite3.connect('myfirst.db')
Create a cursor object:
crs = connection.cursor()
Make the cursor execute some tasks:
Save the changes and close the connection:
cool but how can i like take data from a database and does it require and external file?
@CodejiraThe database file is created upon connection, if it doesn't already exist.
A simple SQL query in Python looks like this:
Did this from memory, maybe not 100% correct
@xolyon