Results 1 to 3 of 3

Thread: Source code for SQLite Python as instruction in FCM Special Python 1?

  1. #1
    Join Date
    Aug 2013
    Beans
    12

    Source code for SQLite Python as instruction in FCM Special Python 1?

    Hi everybody,
    I am learning Pyhton myself following instruction in FCM Special Series Python. At the end of Part 7 of Volume 1, there is website to download source code www.thedesignatedgeek.com, but the site is about healthcare, I cannot find any thing about Infomatics or Programing.
    How can I get the source code?
    Thanks.

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Source code for SQLite Python as instruction in FCM Special Python 1?

    the source code is in the article and can be copied & pasted into a python file. Not quite as easy as downloading it, but it works.

    I use Geany, but do not use APSW. And I like to use sqliteman to review sqltables after I create them or other tasks directly. I use that to also test my sql code before copying into a python script.

    Copy & paste into a python script. I copied sql from pdf and created this for just one table. You can then add the other tables. and queries.

    Code:
    #! /usr/bin/env python
    # -*- coding: utf-8 -*-
    
    import sys, threading, Queue, os
    import sqlite3
    
    def dbi(filename):
        create = not os.path.exists(filename)
        dbi = sqlite3.connect(filename)
        return dbi
    
    
    def makeTable(tblname, sql):
        db = dbi(tblname)
        cursor = db.cursor()
        cursor.execute(sql)
    
    
    sql = 'CREATE TABLE  IF NOT EXISTS Recipes (pkiD INTEGER PRIMARY KEY, name TEXT, servings TEXT, source TEXT)'
    makeTable("cookbook1.db", sql)
    Last edited by oldfred; August 1st, 2013 at 06:09 AM.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Feb 2008
    Beans
    5,078
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Source code for SQLite Python as instruction in FCM Special Python 1?

    The web site is a .net, not a .com.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •