473,382 Members | 1,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Pythoncard question

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

May 4 '06 #1
2 1069
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[i].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
May 4 '06 #2
oops, sorry about that. I copied the message over in gmail but forgot
to change the subject.
Sorry,
Bryan Rasmussen
May 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ron Stephens | last post by:
Thanks, Tony, we long term newbies need to stick together ;-)) I just updated a few PythonCard versions of three of the modules from askMerlin, and posted them in a link right below the...
2
by: Adrian Smith | last post by:
I am using pythoncard 0.7.2 for windows. I am trying to use the same code for a large number of buttons so started out by using def on_mouseDown(self,event): but then I need to display the...
2
by: PipedreamerGrey | last post by:
I'm trying to create a standalone version (.exe) of PythonCard's Custdb sample using Py2Exe version 0.5.0. Everytime I attempt to compile the program, I get an error during compilation. This is...
1
by: Varun Hiremath | last post by:
Hello everybody, I was trying to install pythoncard on my system and I got this error. I am using an unstable version of Debian. Can someone tell me what the error could be. Is it because I am...
1
by: jlocc | last post by:
Hi!! I am working on a school project and I decided to use PythonCard and wxPython for my GUI development. I need a password window that will block unwanted users from the system. I got the...
1
by: Brandon McGinty | last post by:
Hi All, I'm getting started with pythoncard. I'm wondering if there is any way to auto-place the gui elements that I use, so that they are all visible, and aligned? I would use the...
4
by: Tequila | last post by:
I'm having some trouble starting PythonCard on my PC. I've downloaded and ran python-2.5.msi to install Python on my machine. And PythonCard-0.8.2.win32.exe to install PythonCard. When I try...
8
by: king kikapu | last post by:
Hi to all folks here, i downloaded and "playing" with PythonCard and i just want to share my thoughts so maybe we can discuss a little about it. I was used to wxGlade before and i think...
8
by: Kevin Walzer | last post by:
I'm curious to know what others think of these two frameworks for building wxPython apps. PythonCard has been around longer, but its development seems to have slowed. The last release, 0.8.2,...
24
by: John Henry | last post by:
For serveral years, I have been looking for a way to migrate away from desktop GUI/client-server programming onto the browser based network computing model of programming. Unfortunately, up until...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.