Reply
Thread Tools
smileyninja's Avatar
Posts: 24 | Thanked: 0 times | Joined on Jul 2007 @ Lakeland, FL
#1
I'm completely new to python programing but have a small understanding of visual basic. I'D like to get my feet wet and try my hands at making a python "frontend" to a sqlite database. Specificly a simple logbook app that would record time, date, address, service, odometer mileage. Then hAve the ability to search for when I did a certain job. Later on I'd like to add the ability to get lat/long from my bt gps and record that data as well.

The waY I imagine doing this is making a form, then putting in the code to make it operate. I've seen a few blurbs and comments regarding sqlite and python but no real tutorials. Is there a better way to record my data?

My question is, with my vb.net mentality- what tools should I gather? I bought a couple of o'reilly books on python (learning 2.3 & programing python2.0), I downloaded pygtk as well as the latest python and sqlite.exe on my WinXP laptop. Assuming the code is as portable as I've heard, I plan on coding on laptop then copying the .py file to n800. Are there any gotchas that I am overlooking? What if anythiNg would make my journey easier?

Sorry about the ranDOM CApitals, posting from my n800 and they keep popping up.
 
tonymaro's Avatar
Posts: 39 | Thanked: 5 times | Joined on Aug 2007 @ Them thar hills
#2
Originally Posted by smileyninja View Post
My question is, with my vb.net mentality- what tools should I gather? I bought a couple of o'reilly books on python (learning 2.3 & programing python2.0), I downloaded pygtk as well as the latest python and sqlite.exe on my WinXP laptop. Assuming the code is as portable as I've heard, I plan on coding on laptop then copying the .py file to n800. Are there any gotchas that I am overlooking? What if anythiNg would make my journey easier?
Everyone has their own choice of IDE's. Personally I use Eclipse with the PyDev extensions to check my Python syntax. I just started learning python about 4 weeks ago, but I have yet to see a good way to design a form as you describe then plug in the code. I've tried Glade, which has Python extensions, but I never got it to work right. I ended up just coding in my UI design into the application. In other words, I'm creating my widgets at runtime.

I found GTK harder to learn than Python, tbh. I've done GTK development for years using Lazarus, but that abstracts everything so much I never realized how convoluted it seemed compared to my old Windows thought processes.

Here's some references I've found useful:
Maemo API reference for Python
The GTK Class Reference
Maemo hardware key map reference
Installing ScratchBox on your desktop

I hope one or more of those help.

Originally Posted by smileyninja View Post
Sorry about the ranDOM CApitals, posting from my n800 and they keep popping up.
Yeah, I know what you mean lol.
 
tonymaro's Avatar
Posts: 39 | Thanked: 5 times | Joined on Aug 2007 @ Them thar hills
#3
Oh, by the way, that scratchbox tutorial is for Linux desktops, sorry, no help for you. I'm not even sure there's a way to make an app installer package from inside Windows. In other words, once you have your application working and you want to distribute it, you'll need to build a debian package of it. I don't think you can do that in Windows without a virtual machine.

You could always get VirtualBox and run Ubuntu in a virtual machine on your Windows laptop. Or just bite the bullet and format

Last edited by tonymaro; 2007-08-26 at 18:07.
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#4
Originally Posted by smileyninja View Post
My question is, with my vb.net mentality- what tools should I gather? I bought a couple of o'reilly books on python (learning 2.3 & programing python2.0), I downloaded pygtk as well as the latest python and sqlite.exe on my WinXP laptop. Assuming the code is as portable as I've heard, I plan on coding on laptop then copying the .py file to n800. Are there any gotchas that I am overlooking?
GUIs are the least portable aspect of Python. The Internet Tablets use an extended version of GTK (and other libraries) called Hildon. The GUI may need some slight adjustments between Hildon and your development platform. On the other hand, the back-end code is very portable between platforms. SQLite comes pre-installed with PyMaemo and Python 2.5 for Windows.

If your data consists less than a couple of thousand of records, using an SQL database such as SQLite may be a bit of an overkill. Even the Internet Tablets are capable of searching through flat text files containing thousands of lines in just a few hundreds of milliseconds. (I quickly tested that a text file with ten thousand 80-character lines with random gibberish took less than one second to read and scan for arbitrary three-character sequences, on a Nokia N800.)

Oh, by the way: Python 2.0 is ancient. You should target Python 2.2 at minimum and get up-to-date documentation. May I suggest the on-line book "Dive Into Python" by Mark Pilgrim? I also have "Python in a Nutshell" by Alex Martelli and "Python Cookbook" by Alex Martelli and David Ascher on my bookshelf and they're both great.
 
smileyninja's Avatar
Posts: 24 | Thanked: 0 times | Joined on Jul 2007 @ Lakeland, FL
#5
You could always get VirtualBox and run Ubuntu in a virtual machine on your Windows laptop. Or just bite the bullet and format
I've got a vmware image of the maemo development appliance with ubuntu 6.10 -all set up with scratchbox, etc. I suppose could do all my development from that environment since it would be closer to the finished product (n800). All I've done with it so far is verify that it appears to work. Also found a mobile python that I just placed on a usb stick so I could learn a bit of python while at work.
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#6
Personnaly i use PyGTKEditor on my n800
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#7
I agree that GTK (GUIs in general) is more difficult than Python itself. If you're just getting started, and aiming at something simple, you might look up the Eagle framework at Gustavo Barbieri's blog (see Planet). It is a layer over GTK, done with Maemo and the IT in mind, with a simplified API that lets you define and manage simple forms very easily without needing an IDE.
 
Posts: 26 | Thanked: 3 times | Joined on May 2007
#8
You don't need to faff around in the sandbox to do python dev, just do it on your favourite linux surface, using glade.

I found the difficult thing was getting my head around the callbacks they are somewhat awkward compared with VB or ( for those who remember ) hypercard, probably far more powerful though.

go google for pygtk with glade and have fun

I have managed to get gpsd talking to python, will post the basics when I have got a mo

btw maemo has python 2.5
 
smileyninja's Avatar
Posts: 24 | Thanked: 0 times | Joined on Jul 2007 @ Lakeland, FL
#9
Thanks for the advice everyone. I'm about halfway through the Learning Python book. I kNOw that my books are a couple versions behind, but I got them off amazon.com for less than $20 total. I didn't FIgure too much would change. I also downlOaded some online versions as well. Once I get tHe ideas and lingo down I suppose I could invest in the latest versions later and donate the older books to my local library.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 07:24.