[Pythonmac-SIG] Miscellaneous MacPython Questions
Richard Gordon
maccgi@bellsouth.net
Fri, 24 Sep 1999 09:18:17 -0400
At 10:27 +0200 09/24/1999, Just van Rossum wrote:
>It will give that exception if the file is still open. f = open("foo.txt",
>"w") will normally overwrite an existing file.
Awk! I can't believe that I forgot to close the file!
>Dunno... In the IDE, go to the little popup arrow on the top right, select
>"enable profiler" and run your script. After the script is done you'll be
>presented with a stats window.
Very cool. Now I just need to figure out how to interpret the
results. I was interested in the profiler partly because when I port
my script to a Solaris Enterprise Server with a gig of ram and scsi3,
it only executes 3 seconds faster than it does on an 8100/100 ppc-
something is wrong with this picture and I suspect it involves inept
programming.
>using __stdout__ works only if stdout was not already redirected, like in
>the IDE. I still prefer something like:
>
>savestdout = sys.stdout
>sys.stdout = myfile
>try:
> do stuff
>finally:
> sys.stdout = savestdout
OK, that makes sense.
> >6. If I was going to put an interface on a standalone Mac-only
> >application, am I correct in believing that there is no reason to
> >bother considering the use of (the very spooky) Tkinter over native
> >Mac tools?
>
>Depends: if you're already familiar with Tkinter you might want to try that.
That settles that. :-]
>BuildApplication/MacFreeze will find all modules that the application
>depends on. It will create 'PYC ' resources for each .pyc file, and will
>stuff all shared libraries in the data fork of the app. These shared
>libraries are found through 'PYD ' resources.
And I suppose that both BuildApplication and MacFreeze will also
merge any .rsrc files that are used for dialogs, etc?
Richard Gordon
--------------------
Gordon Consulting & Design
Database Design/Scripting Languages
mailto:richard@richardgordon.net
http://www.richardgordon.net
770.971.6887 (voice)
770.216.1829 (fax)