Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:46:56+00:00 2026-06-02T03:46:56+00:00

For now I am trying to use python for sqlite3. My question is, I

  • 0

For now I am trying to use python for sqlite3. My question is, I don’t know how to read the existed ‘abc.db’ with python.
I mean that I just know the abc.db is a sqlite3 file. But I don’t know the structure of it, and I also need to get the information from this abc.db.

I used :

import sqlite3
try:  
        sqlite_conn = sqlite3.connect('abc')  
except sqlite3.Error, e:  
         print 'conntect sqlite database failed.'  
         sqlite_logger.error("conntect sqlite database failed, ret = %s" % e.args[0]) 

So, what can I do next? I need to read the abc, and if it is possible, I want to output the content directly on the terminal. Is it possible? Because I need to analyse the data in this file. Thanks a lot!!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:46:59+00:00Added an answer on June 2, 2026 at 3:46 am

    In your sqlite_conn object you could run the following command

    cur = sqlite_conn.cursor()
    
    cur.execute("SELECT name FROM sqlite_master WHERE type='table'")
    
        rows = cur.fetchall()
    
        for row in rows:
            print row[0]
    

    Then you could do a SELECT * from <Tablename> for each of those tables. The sqlite_master is a sqlite metadata here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the nntplib that comes with python to make some posts
I am trying to use textwrap to format an import file that is quite
I'm trying to use the csv module to read a utf-8 csv file, and
So I've read the theory, now trying to parse a file in Haskell -
I'm trying to use a python script to upload a zip file to a
I have been trying to use the new validators that are now included with
Now I am trying to use MPI_Sendand MPI_Recv to pass best found solutions among
Right now I have been trying to use Launchpad's API to write a small
I'm trying to use regular expression right now and I'm really confuse. I want
I am trying to use the timed_wait from boost. Now I am actually not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.