Added: 1 year ago
From: Jaynonymous1
Views: 6,779
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (27)

Sign In or Sign Up now to post a comment!
  • When Inserting the data into the table, you do something to copy the line to the next line. How did you do that!!!???

  • @Colstonewall I have a text editor with the commands and script sitting next to the terminal window. My screen cast software only captures the terminal window. D'oh! I have just given away my secret sauce.

  • What are the squarebrackets around [newname] for in the last select statement?

  • @jbraunia Honestly, I don't know. I just learned just enough Python to actually get this little program to work. A quick look at Python syntax says that square brackets means it is a Python list, and round bracket means that it is a Python tuple. I'm going to guess that if you have a query with many parameters, you present it as a list. to c.execute().

  • @Jaynonymous1 Sounds reasonable :)

  • Good video, very informative - one comment, I think you would have to do conn.commit() in order for you additions to the table to be saved.

  • @Gearoidmacgiolla Did you try it out and see? I only ask, because most SQLite APIs assume that all queries are transactions unless explicitly told. However, I didn't try it out, so I can't say for sure.

  • @Jaynonymous1 Yeah I tried it - it is necessary. I read up on it (I am only beginning to use sqlite) and it seems that it is something to do with python opening transactions for insert commands. It seems that it autocommits for non-query commands such as create. You can set the keyword isolation_level to None when opening the db and it will autocommit the queries you make.

  • @Gearoidmacgiolla Thanks for the heads-up. That's good to know. I'll be honest. I'm not a python programmer. I only got enough of Python up & running to do this tutorial. :)

  • thank you for an easy to understand video

  • Hey I'm starting to learn programming(as in from scratch) is python a good program to start out with? I have heard good things about it.

  • @gbsons In my opinion, Ruby is better. But Python is good. Try the SQLite Programming with Ruby video that I put up and see what you like better.

  • @Jaynonymous1 I'm no expert, but I'll take Python over Ruby ANY DAY! Just my opinion, however, Python wasn't named 'most popular' by Linux Journal for no reason. . .And thanks for the great video Jay. Hope you keep them coming!

  • @Colstonewall I like Python because it is very easy to read, especially if you are a C++ or Java person. With no knowledge, I was able to easily tweak some Python scripts many years ago. Ruby takes some getting used to, but I find that the flexibility Ruby gives with Module mixins and closures gives it more programming power than Python. Also, I was able to advance further and faster as a web programmer using Ruby. To each his own.

  • Thanks for the video.

  • Thanks for the HOWTO. I have the basics now thanks to your tutorial and will be continuing to research. I followed along with great results with Python 2.6. There is one loose end that you did not cover: when is it appropriate to close a db connection. I'll be researching that. Maybe you cover it in one of your great HOWTOs that I'll be viewing later to night ;-) Thanks!

  • @t0nyfr33man connection.close()

  • This was a great use of my 10 minutes. Gonna fire up Python now and get to work.

  • It's a great video, but Is there other way to access a database? where just it is necessary to send an object??

  • Dude, you rock! Thanks a lot for the refresher

  • Great video...very helpful and a good point to start with.

    Thanks :-)

  • Nice video. Thanks for uploading.

  • Thank you Jay, Kay and Ray!

  • Thanks, just what I was looking for. Very informative.

  • Dude! This is awesome, thanks

  • Thanks very much. Very straight forward.

  • @JOHNKDUFFY I'm glad you found it useful.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more