Pythoncard question

Discussion in 'Python' started by DarkBlue, May 4, 2006.

  1. DarkBlue

    DarkBlue Guest

    I am trying to port a Delphi database application
    to python on linux with a firebird database backend
    and I am using pythoncard to recreate the gui.

    I will have about 25 delphi forms to
    be recreated and I would like to know
    what is the best way to call them up
    from within each other .
    There is a main screen where I must
    be able to call up any of the subscreens
    and on any given subscreen there would
    be buttons to call up 1-5 of the other subscreens
    or go back to the mainscreen.

    The database is connected on the mainscreen
    and relevant connections/cursors shall be accessible
    from any of the subscreens.

    While I am able to connect to the database and create the
    different screens I am stumped at how to efficiently
    call them up and pass the cursors between them as needed.

    Sorry for the long post.


    Thanks for any hint
    Db
    DarkBlue, May 4, 2006
    #1
    1. Advertising

  2. Hi, I'm doing a sort of symbolic linking app in Windows for my own
    enjoyment, and figured I would do it in python for the same reason +
    learning the language.

    The following functions could obviously do with some refactoring. One
    obvious thing would be to make wordsetter and wordsforfolder more
    generic, and just pass a few extra parameters. But that seems sort of
    stupid.

    Any suggestions on refactoring here? other improvements?


    def getwordslist(word):
    thisword = wordpath + word + ".xml"
    if exists(thisword):
    doc = xml.dom.minidom.parse(thisword)
    loc = doc.childNodes[0]
    for i in range(0, len(loc.childNodes)):
    if (loc.childNodes.firstChild.data == thispath):
    break
    else:
    wordsetter(thisword,doc,loc)


    else :
    doc = xml.dom.minidom.Document()
    loc = doc.createElementNS("", "locations")
    doc.appendChild(loc)
    wordsetter(thisword,doc,loc)

    return None

    def getfolderwords(word):

    if exists(normpath(folderwords)):
    doc = xml.dom.minidom.parse(folderwords)
    loc = doc.childNodes[0]
    wordsforfolder(word,doc,loc)


    else :

    doc = xml.dom.minidom.Document()
    loc = doc.createElementNS("", "wordlist")
    doc.appendChild(loc)
    xml.dom.ext.PrettyPrint(doc, open(normpath(folderwords), "w"))
    wordsforfolder(word,doc,loc)

    return None


    def wordsetter(word,doc,loc):
    thisloc = doc.createElementNS("", "location")
    xexpr= "//location[.='" + thispath + "']"

    xp = Evaluate(xexpr,doc.documentElement)
    if len(xp) < 1:

    loc.appendChild(thisloc)
    text = doc.createTextNode(thispath)
    thisloc.appendChild(text)
    fi = open(word, "w")
    fi.write(doc.toxml())


    def wordsforfolder(word,doc,loc):
    thisloc = doc.createElementNS("", "word")
    xexpr= "//word[.='" + word + "']"

    xp = Evaluate(xexpr,doc.documentElement)
    if len(xp) < 1:

    loc.appendChild(thisloc)
    text = doc.createTextNode(word)
    thisloc.appendChild(text)
    fi = open(folderwords, "w")
    fi.write(doc.toxml())


    Cheers,
    Bryan Rasmussen
    bryan rasmussen, May 4, 2006
    #2
    1. Advertising

  3. oops, sorry about that. I copied the message over in gmail but forgot
    to change the subject.


    Sorry,
    Bryan Rasmussen
    bryan rasmussen, May 4, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luiz Siqueira Neto

    Form using HTML on PythonCard

    Luiz Siqueira Neto, Jul 4, 2003, in forum: Python
    Replies:
    3
    Views:
    324
    Lee Harr
    Jul 4, 2003
  2. Karl Lopes

    PythonCard newbie question

    Karl Lopes, Jul 13, 2003, in forum: Python
    Replies:
    1
    Views:
    387
    Kevin Altis
    Jul 13, 2003
  3. Ron Stephens
    Replies:
    0
    Views:
    348
    Ron Stephens
    Sep 13, 2003
  4. Kevin Altis

    ANN: PythonCard 0.7.2

    Kevin Altis, Sep 17, 2003, in forum: Python
    Replies:
    0
    Views:
    559
    Kevin Altis
    Sep 17, 2003
  5. DarkBlue

    PythonCard question

    DarkBlue, Aug 17, 2006, in forum: Python
    Replies:
    1
    Views:
    286
Loading...

Share This Page