Video Catalogue

R

Rodney Dangerfield

Greetz!

Recently I started creating a CGI application for my gf that
she would use for indexing and keeping track of her video
collection.

I am relatively new to python so I started with the basics.
I figured out how to extract the form field values in a
script and how to save to a file.

My question is which data type should I use to store the information
about the videos? I was thinking of using a dictionary variable,
I saw something about the pickle module too, could I use it to
save the state of my dictionary to a file and than later read it
and feed values from it to the form fields via CGI?

All help is greatly appreciated.
 
T

Tom B.

Rodney Dangerfield said:
Greetz!

Recently I started creating a CGI application for my gf that
she would use for indexing and keeping track of her video
collection.

I am relatively new to python so I started with the basics.
I figured out how to extract the form field values in a
script and how to save to a file.

My question is which data type should I use to store the information
about the videos? I was thinking of using a dictionary variable,
I saw something about the pickle module too, could I use it to
save the state of my dictionary to a file and than later read it
and feed values from it to the form fields via CGI?

All help is greatly appreciated.

I think a dictionary might work well, I might use a dictionary within a
dictionary.

vidiodict =
{'Title':{'description':'','date':'','cast':'','length':'130.99','comments':''}}

that way you could look at vidiodict['Title']['length'] it returns '130.99'.

Tom
 
H

Harlin Seritt

Tom B.:

If you're not having trouble saving with dict then use that. You only need
pickle if using lists or dicts are not doing the job when the data in them
are integers or long.


Tom B. said:
Rodney Dangerfield said:
Greetz!

Recently I started creating a CGI application for my gf that
she would use for indexing and keeping track of her video
collection.

I am relatively new to python so I started with the basics.
I figured out how to extract the form field values in a
script and how to save to a file.

My question is which data type should I use to store the information
about the videos? I was thinking of using a dictionary variable,
I saw something about the pickle module too, could I use it to
save the state of my dictionary to a file and than later read it
and feed values from it to the form fields via CGI?

All help is greatly appreciated.

I think a dictionary might work well, I might use a dictionary within a
dictionary.

vidiodict =
{'Title':{'description':'','date':'','cast':'','length':'130.99','comments':
''}}

that way you could look at vidiodict['Title']['length'] it returns '130.99'.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top