Access database - GUI - Python - I need architectural advice


J

jm.almeras

Hello !

I wish to develop a database application with a lot of specific
functionnalities dealing with sound files.

I have developped an Access prototype and run into a first problem : it
is not so easy to find code working with VBA to extract the duration of
a sound file. I have found many code samples, none works perfectly with
all sound files (variable rates, ...).

A second problem I have is that I recently started programming with
Python, and gosh, the idea of coding with VBA after tasting Python is
like going back to black & white television after tasting color and 3D !

Access, and more generally VB, is excellent for building the GUI (forms,
widgets etc.). Python is a great for coding, and it comes with high
quality libraries... Does anyone have any suggestions as to how I can
build my database app with nice Access-like GUI, and programming with
Python ?

One idea that has come to my mind is to store python modules in the
Access database and write VBA code to execute these on the fly... Is
this crazy ?

Thank you for any ideas you might have...

Jean-Marie

PS : just to make my need clear and precise, here is a list of
functionnalities that I will have in my application : register sound
files with all their characteristics (duration, ...), play (including
quick listening with acceleration and jumps), register love level for
each sound file and different users, automatic production of music lists
based on predefined structures (example of a structure : 20 min
classical and quiet, 20 min children songs, 30 minutes South American
music, ... extra sound files like short bird songs being inserted
randomly here and there, I am thinking of a meta-language to describe
such a structure) taking into account love level and how long it has not
been heard, ...
 
Ad

Advertisements

C

Chris Angelico

Access, and more generally VB, is excellent for building the GUI (forms,
widgets etc.). Python is a great for coding, and it comes with high quality
libraries... Does anyone have any suggestions as to how I can build my
database app with nice Access-like GUI, and programming with Python ?

If you're working with Python, why work with Access? Use one of the
free databases (eg PostgreSQL if you want something heavy-duty, or
SQLite to avoid installing anything), use a cross-platform GUI toolkit
like Tk (tkinter), GTK, wx (wxPython), or similar, and have your
program not care whether it's on Windows, Linux, or OS/2. (Yeah, you
can support OS/2 if you feel like it!!)

There are GUI builders for several of the toolkits Python supports.
Glade works for GTK, and Google tells me about a thing called wxGlade,
which presumably is the equivalent for wx. Personally, though, I don't
use them; I create my user interfaces in code, which I find easier to
work with. Give 'em a try, but don't be too scared off; it's actually
really easy to create a good cross-platform window with a modern
toolkit. Effectively, what you say is something like:

Give me a window. Lay it out with a vertical box.
Create a scrollable widget
Put a drawing area into my scrollable widget.
Put the scrollable widget onto the window.
Put an entry field into my window.
Create a horizontal button box.
Put a button "Hello" into my button box.
Put a button "Goodbye" into my button box.
Put the button box onto the window.

That's more or less how my GTK window creation works. It reads nicely
in the source code, it looks like the window's layout. Plays well with
source control, too, which a lot of GUI builder output doesn't.

The builders are there if you want them. Try without, try with, see
what suits your hand.

ChrisA
 
D

Dennis Lee Bieber

Access, and more generally VB, is excellent for building the GUI (forms,

Technically, that IS all that Access is -- a form/report designer. The
"native" database engine is JET (and in pre Office 2013, one had things
called Access Data Projects -- Access forms/reports using MS SQL Server as
the database engine in place of JET). JET is a file server database (each
application is opening the database file directly) rather than a
client/server system (in which the applications send requests to the server
-- the server is the only program physically touching the database
file). SQLite3 is also a file server system and is packaged with Python
(on Windows at least; other systems may assume that, like the tcl/TK
system, it is installed as part of the OS)
widgets etc.). Python is a great for coding, and it comes with high
quality libraries... Does anyone have any suggestions as to how I can
build my database app with nice Access-like GUI, and programming with
Python ?
Not quite as friendly, and sort of a moving target: Look at Dabo [the
creators' goal was to create a Python equivalent of Visual FoxPro].
 
R

rusi

I wish to develop a database application with a lot of specific
functionnalities dealing with sound files.
I have developped an Access prototype and run into a first problem : it
is not so easy to find code working with VBA to extract the duration of
a sound file. I have found many code samples, none works perfectly with
all sound files (variable rates, ...).
A second problem I have is that I recently started programming with
Python, and gosh, the idea of coding with VBA after tasting Python is
like going back to black & white television after tasting color and 3D !
Access, and more generally VB, is excellent for building the GUI (forms,
widgets etc.). Python is a great for coding, and it comes with high
quality libraries... Does anyone have any suggestions as to how I can
build my database app with nice Access-like GUI, and programming with
Python ?

Yes this is a hack. Everything you do in this area will be a hack
because the state of art is like this:

- No one builds GUI-tools like microsoft
- microsoft does not make programmer-friendly tools

One other hack you can consider is an inversion of what you were thinking:
- GUI under access
- programming under python
- bridge between the two via csv-hybrid*
- script-drive the access from the outside rather than from the inside (VBA).
(How to do that I'm not sure though there must be a way)

Note 1: "hybrid" because with sound files pure csv is not practicable
Note 2: The more you are using real 'databasey stuff' -- referential integrity,
foreign keys etc -- the more this approach becomes ugly.

One idea that has come to my mind is to store python modules in the
Access database and write VBA code to execute these on the fly... Is
this crazy ?


A less hairy way to do the same:
- Package up all the python functionality as standalone scripts
- Call these out from access

This way you dont put whole scripts inside access.
You only have to handle command-lines:
- build up inside access
- analyse inside python
 
C

Chris Angelico

Thank you ChrisA

These are good ideas. But looking precisely at widgets I will need, is one
of the GUI builders capable of offering :

1) the use of tabs in a form (that excludes Tkinter I believe)
2) dimensionable and editable arrays of columns and rows like when you open
a table under Access.

I'm assuming it was oversight that had this come to me privately
rather than be on list, and am hoping you won't mind my response going
to the list.

My personal experience with GUI toolkits includes a whole lot that
you'll probably never see in your life (VX-REXX, VPREXX, DrRexx, VREXX
(yeah, I did a lot with REXX in the 1990s), OWL, OS/2 PM, and various
others), but only a few of the modern cross-platform ones. Of the
three most popular Python toolkits, I have virtually no experience
with two (wx and tk), and my GTK work has mostly been in Pike rather
than Python. So I can't say what tkinter is capable of, but certainly
GTK will do what you want.

GTK's TreeView [1] [2] is capable of what you want. It does take some
effort to set it up (I dread the thought of doing it in C - it's
fiddly enough in languages where the array/tuple is a first class
object), but its power is immense. Don't let the "Tree" put you off -
a table view is just a tree where everything is a leaf. As for tabs -
if you mean a Notebook[3], that's fully supported and easy to use. Be
careful what you do with them, though, it's easy to make a UI that's
nigh impossible to find things in if you bury things deep enough. My
favorite example of that is adjusting virtual memory settings in
Windows (XP; not sure how it is in the newer ones): you go to Control
Panel, System properties, Advanced tab, Performance settings button
(brings up another dialog), Advanced tab, Change virtual memory button
(brings up yet another dialog), and then you have all your controls.
Any time you're tempted to create a tab called "Advanced", have a good
long think about what else you might call it... and nesting "Advanced"
inside "Advanced" is usually a recipe for confusion!

[1] C docs: http://www.gtk.org/api/2.6/gtk/GtkTreeView.html
[2] Pike docs: http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/GTK2/TreeView.html
[3] http://www.gtk.org/api/2.6/gtk/GtkNotebook.html

ChrisA
 
Ad

Advertisements

S

Sibylle Koczian

Am 28.11.2013 02:32, schrieb Mark Lawrence:
Not quite as friendly, and sort of a moving target: Look at Dabo [the
creators' goal was to create a Python equivalent of Visual FoxPro].

At http://www.dabodev.com/ and mailing list at
gmane.comp.python.dabo.users.
And while I can't compare Access and Dabo as far as ease of use is
concerned (don't use Access), I _can_ say that the mailing list
certainly is very friendly and helpful.

But the remark about the "moving target" is very true.

Sibylle
 
Ad

Advertisements

W

Wolfgang Keller

I wish to develop a database application with a lot of specific
functionnalities dealing with sound files.

I have developped an Access prototype and run into a first problem :

Access is not a database, it's a data shredder. And for the GUI part;
it only works on that pathologic non-operating system called Microsoft
(Not Responding).

Use PostgreSQL instead and one of these frameworks with Python:

using PyQt (& Sqlalchemy):
Qtalchemy: www.qtalchemy.org
Camelot: www.python-camelot.com
Pypapi: www.pypapi.org

using PyGTK:
Sqlkit: sqlkit.argolinux.org (also uses Sqlalchemy)
Kiwi: www.async.com.br/projects/kiwi

using wxPython:
Gui2Py: code.google.com/p/gui2py/
Dabo: www.dabodev.com
Defis: sourceforge.net/projects/defis (Russian only)
GNUe: www.gnuenterprise.org

Sincerely,

Wolfgang
 

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

Top