You Are Here:

Community: Developer Discussion Boards

#1 Old Question how to begin with the database - 2006-03-21, 04:51

Join Date: Mar 2006
Posts: 3
ellamae
Offline
Registered User
hi guys!
i am creating an application for series 60 phone using python. i am new with this and i want to seek some help on how will i create a database for my application. for example, in VB6, i am using MS Access. In python, i have no idea which database will i be using to store the data.
Reply With Quote

#2 Old Re: how to begin with the database - 2006-03-22, 20:35

Join Date: Aug 2004
Posts: 290
simo.salminen
Online
Regular Contributor
If you store your data to lists or dictionary and use only basic data types, you can get away with simple eval/repr.

lets assume you have following data:
Code:
database = {'data': 0}
save:
Code:
open("file", "w").write(repr(database))
load:
Code:
database = eval(open("file").read())
Of course, this is unsecure. Check out the pys60 doc if you wanna use real sql database.
Reply With Quote

#3 Old Re: how to begin with the database - 2006-03-23, 02:40

Join Date: Jan 2005
Posts: 148
Location: Bangkok, Thailand
Send a message via MSN to korakotc
korakotc's Avatar
korakotc
Offline
Regular Contributor
I wrote a few snippets here. They may be useful to you.
http://www.bigbold.com/snippets/tags/sql/series60
Reply With Quote

#4 Old Re: how to begin with the database - 2006-03-23, 02:59

Join Date: Jan 2005
Posts: 148
Location: Bangkok, Thailand
Send a message via MSN to korakotc
korakotc's Avatar
korakotc
Offline
Regular Contributor
Simo, there is a convenient way to load/store simple data/structure to a file.
Code:
import marshal

data = {'a':1, 'b':2}
f = open('C:\\file.bin', 'wb')
marshal.dump(data, f)
Similarly you can load data from the file.
Code:
f = open('C:\\file.bin', 'rb')
data = marshal.load(f)
"pickle" module is more appropriate to this kind of task.
However, it's not included in pys60 1.3.1
Reply With Quote

#5 Old Re: how to begin with the database - 2006-03-23, 13:06

Join Date: Aug 2004
Posts: 290
simo.salminen
Online
Regular Contributor
Yes, marshal is faster. Nice thing about eval/repr is that you can view and modify the files using text editor, which is nice during development.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
database trouble liafail General Symbian C++ 6 2005-12-28 06:56
Rdbs (database session or client-server database access) - Feature Not Supported jjesus Symbian Tools & SDKs 3 2004-07-27 10:56
InsertL in database Controls the DB Blkangel General Symbian C++ 5 2004-01-13 16:02
Series 60 SDK Appwizard on windows xp moonjoor Symbian Tools & SDKs 15 2003-12-24 11:22
database problem sridhar_ratna General Symbian C++ 1 2003-04-18 10:07

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ