[Python-au] Re: python-au Digest, Vol 5, Issue 9

Jimmy jbou5922 at bigpond.net.au
Mon Dec 1 12:41:15 CET 2003


Thanks for that - have been looking into in, and it looks good for what I
want.

Ta
Jim
----- Original Message ----- 
From: <python-au-request at python.net>
To: <python-au at python.net>
Sent: Saturday, November 29, 2003 10:00 PM
Subject: python-au Digest, Vol 5, Issue 9


> Send python-au mailing list submissions to
> python-au at starship.python.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://starship.python.net/mailman/listinfo/python-au
> or, via email, send a message with subject or body 'help' to
> python-au-request at starship.python.net
>
> You can reach the person managing the list at
> python-au-owner at starship.python.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of python-au digest..."
>
>
> Today's Topics:
>
>    1. Re: Calling two Python Scripts from another script PartII
>       (Gary Reynolds)
>    2. Request for advice (Jimmy)
>    3. Newcastle Work Offered (JOHN KIRK)
>    4. Re: Request for advice (Andy Todd)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 23 Nov 2003 11:18:02 +1100
> From: Gary Reynolds <garyr at dentistry.usyd.edu.au>
> Subject: Re: [Python-au] Calling two Python Scripts from another
> script PartII
> To: Python-au-mailing-list <python-au at python.net>
> Message-ID: <3FBFFCBA.8030509 at dentistry.usyd.edu.au>
> Content-Type: text/plain; charset="us-ascii"
>
> Duane Hennessy wrote:
>
> > Another way to run python scripts from another script is if the
> > scripts you want to run are just a consecutive list of commands
> > without a 'main' function or anything then you can more easily execute
> > them like the following example...
>
> Realistically guys, I don't like what you are preaching here...
>
> Yes, python (like most languages) has an exec command, but you really
> should not use it when calling more python code. Python already has
> methods for obtaining functionality from other /modules/ which should be
> used instead.
>
> Rather than having straight line code in each of your files, split them
> up based on what they do in terms of functionality.  You will end up
> with code that is intrinsically documented by way of meaningful function
> calls, rather than the user needing to open secondary modules to see
> what they actually do.
>
> For example:
>
> file = open("search_engine.py", "r")
> exec(file.read())
> file.close()
>
> Or:
>
> from search_engine import *
> se = SearchEngine("http://www.mysite.com.au/")
> se.spider()
> se.index()
> se.commit()
>
> The second example is reasonably obvious to the reader what is going to
> happen... but I wouldn't have a clue what my first example does?
>
> Also, when you need to re-run that part of the script, you need to
> reload it into memory which will be slower... much better to import
> modules rather than scripts...
>
> Where you can, split common bits of functionality into modules and
> import them, but make sure there is no straight line code in them - only
> classes or functions.
>
> My $0.222 (inc. GST)
>
> Gary
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://starship.python.net/pipermail/python-au/attachments/20031123/23d77740/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Fri, 21 Nov 2003 15:37:58 +1100
> From: "Jimmy" <jbou5922 at bigpond.net.au>
> Subject: [Python-au] Request for advice
> To: <python-au at python.net>
> Message-ID: <017001c3afe9$3d4579f0$0100000a at JIMSMACHINE>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> I'm currently developing a prototype in Python, that has the potential to
> make the transition to being part of a long term commercial development.
The
> prototype basically performs all of the business logic thats required, but
> simply takes interactively typed or text file based input and simply
prints
> the required data. What's required is simply to plug the input and output
> information into some sort of form, preferably browser based. Can anyone
> point me to any documentation that outlines the techniques for connecting
> python classes and routines to web-based forms. This software will
initially
> run standalone, so embedding this code in a Zope style framework is
probably
> going to be an overkill. This is a pretty time critical development, so
I'd
> prefer an approach that's as simple and easy as possible.
>
> Any advice on this, or knowledge of suitable products that make this
process
> easy would be greatly appreciated. I'd like to introduce python as an
> integral part of the development process for this concern, rather than
them
> surrendering all to Microsoft.
>
> Thanks
> James Bourke
>
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 29 Nov 2003 20:06:51 +1100
> From: JOHN KIRK <softscan at dodo.com.au>
> Subject: [Python-au] Newcastle Work Offered
> To: python-au at python.net
> Message-ID: <3FC861AB.8000909 at dodo.com.au>
> Content-Type: text/plain; charset=us-ascii; format=flowed
>
> Hi,
> I am based in Newcastle N.S.W. and need someone to teach me Python and
> oversee some game development  I am doing.
> Anyone out there interested ?
> John
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 29 Nov 2003 10:39:09 +0000
> From: Andy Todd <andy47 at halfcooked.com>
> Subject: Re: [Python-au] Request for advice
> To: Jimmy <jbou5922 at bigpond.net.au>
> Cc: python-au at python.net
> Message-ID: <3FC8774D.6010301 at halfcooked.com>
> Content-Type: text/plain; charset=us-ascii; format=flowed
>
> Jimmy wrote:
> > Hi,
> >
> > I'm currently developing a prototype in Python, that has the potential
to
> > make the transition to being part of a long term commercial development.
The
> > prototype basically performs all of the business logic thats required,
but
> > simply takes interactively typed or text file based input and simply
prints
> > the required data. What's required is simply to plug the input and
output
> > information into some sort of form, preferably browser based. Can anyone
> > point me to any documentation that outlines the techniques for
connecting
> > python classes and routines to web-based forms. This software will
initially
> > run standalone, so embedding this code in a Zope style framework is
probably
> > going to be an overkill. This is a pretty time critical development, so
I'd
> > prefer an approach that's as simple and easy as possible.
> >
> > Any advice on this, or knowledge of suitable products that make this
process
> > easy would be greatly appreciated. I'd like to introduce python as an
> > integral part of the development process for this concern, rather than
them
> > surrendering all to Microsoft.
> >
> > Thanks
> > James Bourke
> >
> >
>
> James,
>
> If your requirement is for all of the interface work to be done by
> people who understand Python and HTML, not just HTML then I'd suggest
> you take a look at Quixote -
http://www.mems-exchange.org/software/quixote/
>
> Its got a very useful Forms framework which is explained in a tutorial
> here - http://www.quixote.ca/learn/2.html
>
> Regards,
> Andy
> -- 
> --------------------------------------------------------------------------
------
>  From the desk of Andrew J Todd esq - http://www.halfcooked.com/
>
>
>
>
> ------------------------------
>
> _______________________________________________
> python-au maillist  -  python-au at starship.python.net
> http://starship.python.net/mailman/listinfo/python-au
>
>
> End of python-au Digest, Vol 5, Issue 9
> ***************************************
>





More information about the python-au mailing list