I've been learning Python and I must say I loved it. But as a new learners I am having some other problems as well:
Could you guys tell me whether it is a feature of Python or the library of itself.
I am checking how to connect to sqllite database and I came up with this article and there is a code sample over there as such below:
>>> from pysqlite2 import dbapi2 as sqlite
>>> connection = sqlite.connect('test.db')
>>> memoryConnection = sqlite.connect(':memory:')
>>> cursor = connection.cursor()
When he wrote memory as string, he put two : (colon) as well and I am wondering whether it is peculiar to library instead of Python itself.
The ':memory:' string is entirely database dependent. As explained in the documentation for sqlite:
You can use
":memory:"to open a database connection to a database that resides in RAM instead of on disk.
As far as the Python language is concerned, ':memory:' is just a string like any other.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With