A simple python script to calculate prime numbers and store them into a database using sqlite3.
You can calculate the prime numbers to the number you want (10000 for example) and store them into a database. Later, you can easily compute primes to another larger number without needing to find again all the primes you already have computed before.
Do you need to export all your primes as a text file ? You can do it easily with this.
Do you want some primes from an interval ? No problem, read them directly from your database.