From Pieter Claerhout" This is a multi-part message in MIME format. ------=_NextPart_000_0013_01BEB127.D1DE4BC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello, I wrote a little script, using the MacPython IDE. Then I saved it as an applet. So far, everything was OK. Then I used the script MacFreeze to generate an application from the script, but it complains about a syntax error. The strange thing is that I can't find a syntax error... You can find the script as attachment. Thanks, Pieter [ Pieter Claerhout chill@mediaport.org ] ------=_NextPart_000_0013_01BEB127.D1DE4BC0 Content-Type: application/octet-stream; name="Files to PDF.py" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Files to PDF.py" import sys import macfs import os def main(): =09 # Globale variabelen =09 appName =3D "Files to PDF 1.5" =09 fileList =3D "" =09 header =3D "" header =3D header + "%!PS-Adobe-3.0\r\r" header =3D header + "% File Generated by " + appName + "\r" header =3D header + "% =A9 1999 Pieter Claerhout\r\r" header =3D header + "[ /Title () /Author (Philips) /Subject () = /Keywords () /DOCINFO pdfmark\r" header =3D header + "/prun {/mysave save def dup =3D flush RunFile = clear cleardictstack mysave restore}\r" header =3D header + "def\r\r" =09 footer =3D "" footer =3D footer + "\r%EOF" =09 # Einde globale variabelen # Main programma for file in sys.argv[1:]: if os.path.isdir(file): continue if file[-3:] =3D=3D ".ps": fileList =3D fileList + "(" + file + ") RunFile\r" fileList =3D fileList + "(" + file + ") =3D=3D flush\r" # Einde main programma =09 =09 # Wegschrijven van het outputbestand =09 output =3D header + fileList + footer =09 fss, ok =3D macfs.StandardPutFile('Save combined file as:', = 'naamloos.ps') if ok: path =3D fss.as_pathname() f =3D open(path, "wb") f.write(output) f.close() =09 # Einde wegschrijven van het outputbestand =09 if __name__ =3D=3D '__main__': main() ------=_NextPart_000_0013_01BEB127.D1DE4BC0-- From Pieter Claerhout" I tried to make a script that reads a PostScript file line by line, and this to find the first line which starts with "%%Pages: ". After the program found this line, is OK to close the file and to print this line. Everything works fine, but with big files (more than 5 MB, and most of my PostScript files are bigger than that), I run into memory problems. This is the source of my script: import macfs import sys import EasyDialogs fsspec, ok = macfs.PromptGetFile('File to check end-of-lines in:', 'TEXT') if not ok: sys.exit(0) pathname = fsspec.as_pathname() fp = open(pathname, 'r') for x in fp.readlines(): if x[:9] == "%%Pages: ": print "Found", x[9:-1], "pages!" break fp.close() Anyone an idea how I can handle this problem. I also have some problems with the different line-ending style from the different platforms. How should I handle this?? If anyone has another solution for finding the number of pages in a PostScript file, I am glad to learn from you... Kind regards, Pieter [ Pieter Claerhout chill@mediaport.org ] [ Pieter Claerhout chill@mediaport.org ] From cwebster@math.tamu.edu Tue Jun 8 17:20:30 1999 From: cwebster@math.tamu.edu (Corran Webster) Date: Tue, 8 Jun 1999 11:20:30 -0500 (CDT) Subject: [Pythonmac-SIG] Reading big text files In-Reply-To: <001201beb1c7$f7999b80$8f23cfc3@cevi0008> Message-ID: <199906081620.LAA05538@radon.math.tamu.edu> > Everything works fine, but with big files (more than 5 MB, and most of my > PostScript files are bigger than that), I run into memory problems. This is > the source of my script: The problem is that readlines() reads the entire file into memory at once. Try the fileinput module which does much the same, but with lazy evaluation - it only reads the lines from the file as they are needed. Change as follows: > import macfs > import sys > import EasyDialogs import fileinput > fsspec, ok = macfs.PromptGetFile('File to check end-of-lines in:', 'TEXT') > if not ok: > sys.exit(0) > > pathname = fsspec.as_pathname() > fp = open(pathname, 'r') for x in fileinput.input(fp): > if x[:9] == "%%Pages: ": > print "Found", x[9:-1], "pages!" > break > > fp.close() > > Anyone an idea how I can handle this problem. I also have some problems with > the different line-ending style from the different platforms. How should I > handle this?? Not so sure about this since I haven't run into it recently, but it's a lmost certainly a FAQ - I'll leave it for others to answer. Corran From joe@strout.net Tue Jun 8 18:12:04 1999 From: joe@strout.net (Joseph J. Strout) Date: Tue, 8 Jun 1999 10:12:04 -0700 Subject: [Pythonmac-SIG] Reading big text files In-Reply-To: <199906081620.LAA05538@radon.math.tamu.edu> References: <001201beb1c7$f7999b80$8f23cfc3@cevi0008> Message-ID: >> if x[:9] == "%%Pages: ": >> print "Found", x[9:-1], "pages!" Note that you don't need the -1 here, the standard idiom would be x[9:]. >> Anyone an idea how I can handle this problem. I also have some problems with >> the different line-ending style from the different platforms. How should I >> handle this?? What sort of problems? Mac Python does line ending conversion for you automagically when you open a file in text mode, at least if you use readline(). Anyway, applying a string.strip() to each line certainly does the trick. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From joanca@typerware.com Tue Jun 8 19:32:59 1999 From: joanca@typerware.com (JoanCarles p Casas=?ISO-8859-1?Q?=edn?=) Date: Tue, 8 Jun 1999 20:32:59 +0200 Subject: [Pythonmac-SIG] Reading big text files Message-ID: <199906081833.OAA28235@python.org> Pieter Claerhout wrote: >Anyone an idea how I can handle this problem. I also have some problems with >the different line-ending style from the different platforms. How should I >handle this?? There's a script into MacPython:Demo:example0 folder (checktext.py), have also a look into example0.html to find out. Don't know if the best way for fixing line-ending is string.replace (newbie ;) Hope this helps a bit, JoanCarles :::!!!::: joanca@typerware.com http://www.typerware.com From FoulCraven@aol.com Wed Jun 9 02:03:17 1999 From: FoulCraven@aol.com (FoulCraven@aol.com) Date: Tue, 8 Jun 1999 21:03:17 EDT Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #182 - 1 msg Message-ID: <6140f135.248f1755@aol.com> >I wrote a little script, using the MacPython IDE. Then I saved it as an >applet. So far, everything was OK. Then I used the script MacFreeze to >generate an application from the script, but it complains about a syntax >error. The strange thing is that I can't find a syntax error... I've found that with BuildApplet, if I did not have a carriage return following the last line of the script, it would give me an error like that. Simply adding one single carriage return is all it took to fix it. --david From Pieter Claerhout" Hello, is it possible to disable a script's out window. I tried building the script as an application, but still the script.out window appears now and then. And another question: what is the best windowing toolkit if you want to stay truly cross-platform between Mac and PC? I tried tkinter but I didn't like the macintosh version. Are there any other possibilities?? Kind regards, Pieter [ Pieter Claerhout chill@mediaport.org ] From Pieter Claerhout" Hello, is there anyone who already figured out how to handle syntax coloring inside the Python IDE. That would be very handy (for newbies like me). Maybe this is something I have to ask directly to Just, because he's the author of the IDE. Kind regards, Pieter [ Pieter Claerhout chill@mediaport.org ] From A.M.INGRALDI@larc.nasa.gov Wed Jun 9 17:54:39 1999 From: A.M.INGRALDI@larc.nasa.gov (Anthony M. Ingraldi) Date: Wed, 09 Jun 1999 12:54:39 -0400 Subject: [Pythonmac-SIG] Application.out window / Windowing toolkit Message-ID: <199906091654.MAA02975@express.larc.nasa.gov> On Wednesday, June 9, 1999, Pieter Claerhout wrote: > is it possible to disable a script's out window. I tried building the script > as an application, but still the script.out window appears now and then. > Use the EditPythonPrefs application to alter the startup options. You'll need to check the option to delay the console window until needed. This doesn't really disable the out window, but you'll never see it unless you intentionally send something to standard out or you hit an unhandled exception. -- Tony Ingraldi A.M.INGRALDI@LaRC.NASA.GOV Phone : (757) 864-3039 Fax : (757) 864-7892 From joe@strout.net Wed Jun 9 18:16:53 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 9 Jun 1999 10:16:53 -0700 Subject: [Pythonmac-SIG] Python IDE and syntax coloring In-Reply-To: <002501beb296$a5ad7740$c123cfc3@cevi0008> Message-ID: At 9:39 AM -0700 06/09/99, Pieter Claerhout wrote: >is there anyone who already figured out how to handle syntax coloring inside >the Python IDE. That would be very handy (for newbies like me). Maybe this >is something I have to ask directly to Just, because he's the author of the >IDE. Here's the scoop. The IDE has syntax coloring already, but it's disabled. I helped Just develop it somewhat, and now it's very good, except that sometimes it gets confused when multi-line strings are involved. (You can create these either with triple-quotes, or by using the continuation character at the end of a line.) That means that now and then you have to hit command-1 (or whatever) to fix the coloring. Just thinks that this problem is big enough that he should leave syntax coloring disabled. I disagree, but I'm only one person. What do you think? Would you rather have syntax coloring that occasionally gets confused in unusual cases, or no syntax coloring at all? Tell Just what you think! (Note that if the next release doesn't include syntax coloring, or if the next release doesn't appear at all in the next week or two, and you want it, I'll prepare a patch to the IDE that will enable it for you. But of course I'd rather avoid that route if possible.) Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From joe@strout.net Wed Jun 9 18:13:24 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 9 Jun 1999 10:13:24 -0700 Subject: [Pythonmac-SIG] Application.out window / Windowing toolkit In-Reply-To: <000d01beb295$e35014a0$c123cfc3@cevi0008> Message-ID: At 9:33 AM -0700 06/09/99, Pieter Claerhout wrote: >is it possible to disable a script's out window. I tried building the script >as an application, but still the script.out window appears now and then. It probably appears whenever you print something. If you redirect sys.stdout and sys.stderr someplace else, you should be able to keep it hidden. >And another question: what is the best windowing toolkit if you want to stay >truly cross-platform between Mac and PC? I tried tkinter but I didn't like >the macintosh version. Are there any other possibilities?? No, I think you'll need to roll your own wrapper classes. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From savageb@pacbell.net Thu Jun 10 07:23:46 1999 From: savageb@pacbell.net (savageb) Date: Wed, 09 Jun 1999 23:23:46 -0700 Subject: [Pythonmac-SIG] Python IDE and syntax coloring Message-ID: <199906100623.XAA16116@mail-gw2.pacbell.net> > What do you > think? Would you rather have syntax coloring that occasionally gets > confused in unusual cases, or no syntax coloring at all? Tell Just what > you think! > I personally think it would be great to have the syntax coloring. I thought that was a very nice feature of Idle. Also (perhaps I'm just spacing and this has been addressed before, but it has been a very rough week so far, so please forgive) will the next version have the ability to print? Right now I open my files up in BBedit to print them which works fine. But I wish I could just print from the IDE. - Bob From jack@oratrix.nl Thu Jun 10 09:59:44 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 10 Jun 1999 10:59:44 +0200 Subject: [Pythonmac-SIG] Application.out window / Windowing toolkit In-Reply-To: Message by "Anthony M. Ingraldi" , Wed, 09 Jun 1999 12:54:39 -0400 , <199906091654.MAA02975@express.larc.nasa.gov> Message-ID: <19990610085945.11D80303120@snelboot.oratrix.nl> > On Wednesday, June 9, 1999, Pieter Claerhout wrote: > > > is it possible to disable a script's out window. I tried building the script > > as an application, but still the script.out window appears now and then. > > > > Use the EditPythonPrefs application to alter the startup options. You'll > need to check the option to delay the console window until needed. A small addendum: you can either run EditPythonPrefs to change the system-wide behaviour, or drop your applet on EditPythonPrefs and change the behaviour for that single applet. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From just@letterror.com Thu Jun 10 14:01:28 1999 From: just@letterror.com (Just van Rossum) Date: Thu, 10 Jun 1999 15:01:28 +0200 Subject: [Pythonmac-SIG] Python IDE and syntax coloring In-Reply-To: <199906100623.XAA16116@mail-gw2.pacbell.net> Message-ID: At 11:23 PM -0700 6/9/99, savageb wrote: >I personally think it would be great to have the syntax coloring. Working on it... >I thought >that was a very nice feature of Idle. Also (perhaps I'm just spacing and >this has been addressed before, but it has been a very rough week so far, so >please forgive) will the next version have the ability to print? Right now I >open my files up in BBedit to print them which works fine. But I wish I >could just print from the IDE. Personally I hardly ever print code, so it's not very high on my wish list. Printing support has been there in MacPython for a while (module Printing, see also PrintingDemo.py), but although I implemented this wrapper, I have very little experience with it. In other words: mods are gladly accepted! I'll help as much as I can with the IDE internals if neccesary. Just From Pieter Claerhout" Hello, is it possible to read a file beginning from the last-line up to the first one using the fileinput mechanism?? Kind regards, Pieter [ Pieter Claerhout chill@mediaport.org ] From steele@cs.brandeis.edu Sat Jun 12 00:09:08 1999 From: steele@cs.brandeis.edu (Oliver Steele) Date: Fri, 11 Jun 1999 19:09:08 -0400 Subject: [Pythonmac-SIG] Reading big text files Message-ID: <199906112309.TAA10115@life.ai.mit.edu> Pieter Claerhout writes: > Everything works fine, but with big files (more than 5 MB, and most of my > PostScript files are bigger than that), I run into memory problems. and: > I also have some problems with > the different line-ending style from the different platforms. How should I > handle this?? I've run into exactly these problems, and I found myself needing to go a bit beyond what the other respondents have so helpfully suggested. If you know in advance that the file uses UNIX or DOS line separators, you can open the file with 'rb' instead of 'r' and then trim the string, as Joseph J. Strout suggested. Unfortunately, file.readline() on a MacOS file opened with 'rb' will read the whole file, so you've fixed the problem for UNIX/DOS files but you're back to where you started for MacOS files. The textopen module, at http://www.cs.brandeis.edu/~steele/sources/textopen.py, creates a file-like object that recognizes all line-ending styles. Add: from textopen import textopen and replace fp = open(pathname, 'r') with fp = textopen(pathname, 'r') and your code will work regardless of the line-ending style. If you use textopen, though, you can't use the fileinput module to read one line at a time as Corran Webster suggested. (fileinput.input() expects a string, whereas textopen() returns a file-like object.) You can use the textline module, at http://www.cs.brandeis.edu/~steele/sources/textlines.py: from textopen import textopen from textlines import textlines ... fp = textopen(pathname): for x in textlines(fp): ... From Pieter Claerhout" Hello, I made an interface for an applet with the use of a ResEdit resource file. In the beginning. now I have two questions: 1. How do you handle checkboxes. I found a function for radio buttons in the documentation, but I could not find a function for checkboxes. 2. How do you center a dialog box on your screen?? Kind regards, Pieter Claerhout [ Pieter Claerhout chill@mediaport.org ] From seanh@unforgettable.com Sat Jun 12 19:07:00 1999 From: seanh@unforgettable.com (Sean Hummel) Date: Sat, 12 Jun 1999 11:07:00 -0700 Subject: [Pythonmac-SIG] Dialog windows with ResEdit Message-ID: <199906121809.OAA05125@pop02.globecomm.net> Well for #1, I'm not sure. But for #2 there are a few ways to accomplish this: 1. Set the option to center on main screen, in ResEdit. When you are editing the "DLOG" resource, this is an option in one of the menus. 2. When you load the DLOG resource, you can modify the position of the the dialog before you actually show it. ---------- >From: "Pieter Claerhout" >To: "Python Mac" >Subject: [Pythonmac-SIG] Dialog windows with ResEdit >Date: Sat, Jun 12, 1999, 10:08 AM > > Hello, > > I made an interface for an applet with the use of a ResEdit resource file. > In the beginning. now I have two questions: > > 1. How do you handle checkboxes. I found a function for radio buttons in the > documentation, but I could not find a function for checkboxes. > > 2. How do you center a dialog box on your screen?? > > Kind regards, > > > Pieter Claerhout > > [ Pieter Claerhout > chill@mediaport.org ] > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://www.python.org/mailman/listinfo/pythonmac-sig > From maccgi@bellsouth.net Mon Jun 14 01:33:02 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Sun, 13 Jun 1999 20:33:02 -0400 Subject: [Pythonmac-SIG] BBPy? Message-ID: For some time, I've been meaning to mention that I am puzzled by the BBPy stuff that comes with Mac Python 1.52b1 distribution. The readme says: << contents: - "Run as Python" -- the extension - PythonSlave.py -- the "slave" script that handles the AppleEvents - source -- source code & CW9 project for the extension >> However, there isn't a "Run as Python" extension in the folder and there isn't a Code Warrior project included, just the PythonSlave and some miscellaneous .h, .c, and .rsrc stuff. In any case, I don't have CW and as a rule, "We Don't Do C." So, is there a copy of the "Run as Python" extension for BBEdit floating around somewhere? Thanks. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto://richard@richardgordon.net 770.565.8267 From steele@cs.brandeis.edu Mon Jun 14 01:59:31 1999 From: steele@cs.brandeis.edu (Oliver Steele) Date: Sun, 13 Jun 1999 20:59:31 -0400 Subject: [Pythonmac-SIG] Read a file backwards using fileinput Message-ID: <199906140059.UAA01358@life.ai.mit.edu> > is it possible to read a file beginning from the last-line up to the first > one using the fileinput mechanism?? No; the source to fileinput contains this line: if i != self._lineno: raise RuntimeError, "accessing lines out of order" that basically checks that you're accessing the lines sequentially. http://www.cs.brandeis.edu/~steele/sources/textlines.py, that I mentioned in my last message, lets you read the lines backwards, but it's dreadfully inefficient. (In this case, it reads from the beginning of the file each time.) If you have to read the lines backwards, and if it's too big to fit in memory, your best bet is probably to traverse it forwards building an array mapping line number to file offset (using file.tell() and file.readline()), and then step through the array backwards retrieving each line (using file.seek()). If the array is too big, you can store every tenth, or hundredth, offset, and read blocks of 100 lines and walk through them backwards. But maybe there's some other way to do what you're doing, that doesn't involve walking through the file backwards? (Maybe you can build whatever data structure you're building from the information in the file, and then walk through _it_ backwards?) From just@letterror.com Mon Jun 14 10:38:40 1999 From: just@letterror.com (Just van Rossum) Date: Mon, 14 Jun 1999 11:38:40 +0200 Subject: [Pythonmac-SIG] BBPy? In-Reply-To: Message-ID: --============_-1282768816==_============ Content-Type: text/plain; charset="us-ascii" At 8:33 PM -0400 6/13/99, Richard Gordon wrote: >For some time, I've been meaning to mention that I am puzzled by the >BBPy stuff that comes with Mac Python 1.52b1 distribution. The readme >says: > ><< >contents: >- "Run as Python" -- the extension >- PythonSlave.py -- the "slave" script that handles the AppleEvents > >- source -- source code & CW9 project for the extension >>> > >However, there isn't a "Run as Python" extension in the folder and >there isn't a Code Warrior project included, just the PythonSlave and >some miscellaneous .h, .c, and .rsrc stuff. In any case, I don't have >CW and as a rule, "We Don't Do C." It seems the distribution script is somewhat broken. OTOH, as far as I'm concerned BBPy is hopelessly obsolete. I'm not sure it even works with BBEdit 4.5. History: I wrote it in a day or two back in 1996 at the suggestion of Joe Strout. I worked with it for a while, got very disappointed and started building an IDE instead ;-). If someone would be interested in developing it further: be my guest, but I don't feel like maintaining it any longer. >So, is there a copy of the "Run as Python" extension for BBEdit >floating around somewhere? Thanks. I've attached a copy. Just --============_-1282768816==_============ Content-Type: application/mac-binhex40; name="Run_as_Python" Content-Disposition: attachment; filename="Run_as_Python" (This file must be converted with BinHex 4.0) :$9*eEL"KFb"3HA4SEfi!3N*B9&)UBfJ"!!!!!!!!!!Npi4)!!!!!!3!!!!LC!!! (Q3!!!+3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!e5G@iJBA-J8(P dD'pZE@9bCf9N@8fe69P0ELj`H@&X!J"849K88(PdD!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!,'"lI%!!!!!!!!*23!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!#!!!-!!!!!!%!""!"8!93%!ePPF`!!!!!!!%!!UJ"8!2S%!Nj[!!! !!!!)!$`!0J&8L$l58(PdD'pZ8faKGQ8ZF(R6)'Pc)'j[G#"bG@jZD@jR,#!0Gfp eE'3JH@pe)'aTDf8JG'mJE'pMBA4P)'Pd2`!!!!!!#!!+!#J!+U!#!!%!!!!1!#J !+!#-!C!!!)"996!+!!!!"!!!!N%!!!!'!3!!8J!!!!!'SQ!+!!"#3PK8!)!!!%M Ri-K1ZJ$b3IVrkL!)S&91ZJ#3!%cI%`G1qJ-J3IVreY(m!!!'P5!)S&91G8MR"J" C6b"[!"!LE`!8,#m!'"kB(eJ!!4pB!!)I@!!$+KGd!'"%%KJ3!3*!!)"R$0)"%!& )J%M!e)"J+"k"(eJ!!4!"!N!!3'F--"IP51*!5-$8J'!1(eJ!!KpB!!-N&q@+iS, GX5J!8i9+K@ki@%p-h`"J6R9)ja!J*%!J,!!%*JU@J'G!5S"Q(%)X!!J`2+LITdB [#$!mSCLM4V(I9X"%!"P!!!J[!bm+6VVr4#m!6VVr6Nr[!!`T5J!%5L`!#'F%F!' KQ%cI"!K1G8(kr[V4r!!!"S`J#+"9`Ba1G8je)!a*qJ!'+&41G3!!!!""q[rk))a 1GBG6CA49F%%d!!"19[q1,`-YI&"jG'Mre&92,cacD@GZ5'lre%Ki!!4)E[r`-$` )*DJ@-"mf!%T$C`B`!f!!!F496bmm9%9B9#"Z!"4)D!!"F!!3%#m!5'lri$!m##@ S&M!I0J"+3fF'-!0J!!'@98m[2&4&@&3[,J!-,bi!%%KZrqJ`2!JPU"B`(cB!5N0 R"M!$B!!"EP92,ca`HA4S,ca&@%9$5'lrm$mmrrp#TdKZrrJ`2!X8U"B`(cB!5N0 R"M!$B!!"2P925'lrq#mm,5dY,8KZrqJ`2!B3U"B`(cB!5N0R"M!$B!!"'P925'l rq#mm6N&048KZrq!`2!B3U"B`(cB!5N0R"M!$B!!!pP925'lrq%KZrpK)H!!$2c` !!8Kirrj#Td+R-$`0&kJ@-"mf!!a$rCpQ5&922c`!J%+RUB8`(cB!$%-!!QB'F!" J!!#b5'lrMNkj!!!$[NS!@%pQ"R!!B!!!R%KZrij1Z3!!"(3f!%T$@%pR$M!$B!! !K%T$C`3`!f"k98p)E[r`-$`#"+J@-"mf!%T$C`3`!f"L98p)E[rJ-$`#"+J@-"m f!%T$C`3`!f"+98p)E[rS-$`#"+J@-"mf!%T$C`3`!f!b98p)E[ri-$`#"+J@-"m f!%T$C`3`!f!D98p)E[rB-$`#"+J@-"mf!%T$C`3`!f!#F!!Q(djH6R@-8f9ZC&4 PH(4"Fd&&!!!!6PEr!%MR'$!QEJ!-*Li!#%kkrF!S!#m$5'lr!+NC@8m[!b"V!!* 1N!!JAb4))%UJ+8KZr`"C6bm+6VN!!!Cq)"m[!#m5,`Y1Z[fU0J"+3dr[!""R#$m $)'X!DNk3!#"+S#SJ"-'-60m-'%jH)&p36dl3K'eKD@i!!!"19[qB,`SNEJ!),Aa 849K8rjK"q3!!"$)T5!!!,b`!!%*R5'lrQ%KZrkJr2!!'UHSJE!!!S"p+,[qSCJ4 `!'!B0+lrVL9Zrl!!!N(Zrl4$kJ!'F%#J,R!"*&p1ANjeNNGPG&"jG'K[EP0XBAC P8h"PB`!!!%j@!!!JEJ!))#J!)#)S!#3-J&4&@&4Q$Jb"8(PdD'B'3Lm!$'!'(h` !!3!-6PiZRdjeM%eC4NP-48C*6&4&8J!!!%j@rhj)ja!J*'i!##em68&$8rpq98m [2(0TCfj)E[pq5(J!"%KZriS`2!JPU"B`(cB!5N0R"M!$B!!"Y&92,ca'6N45,ca cEh"P5'lrLMmmrrp#TdKZrrJ`2!X8U"B`(cB!5N0R"M!$B!!"K&922a)[+J!#3UG )E[q5F!'U8M!I98p#TdKZrj*)E[rdF!+S)c!I98p#Tbm+5'lrm(!#U#-`(e923UG #Td)R5'lrk$!m"`DS&M!I0J!JE[rdS#P96bmmB@aTFb"Zrr3[%&P2,blrp%kj!!! 'IL!I,`")E[rJ-$`)*DJ@-"mJE[rdS#T96dKZrrJ[2#dY,5e)E[rJ-$`'%+J@-"m f!'CD98p)E[rJ-$`#"+J@-"mJE[r`S#P96bmmB@aTFb"Zrr![%&P2,blrm%kj!!! 'IL!I,`")E[rB-$`)*DJ@-"mJE[r`S#P96dKZrqK#TdKZrpJ`2!B*U"B`(cB!98p )E[rB-$`#"+J@-"p96dKZrrJ[2'CcC@a)E[rS-$`'%+J@-"mf!&925'lrk$!m!J5 S&M!I98p)E[ri5'lrJNKi!"&#CdKirrp#Td+R-$`0&kJ@-"mf!%T$C`3`!f!U98p )E[ri-$`#"+J@-"mf!%T$C`3`!f!598p)E[q#-$`#"+J@-"mf!$!$60m%#%jH6R@ 46'&eEQ0S8(PdD'pZ8faKGQ8!!#*I)&qJ*5k!DJ*#Pdl4!!!!!!!!!!!!!!!!"N& $Ld"bU8$Vd!!!!%F!)b!!!!!'GM!Z-Lic1AB`,M)Z-b#T)%TeFh3JGQ&Z)&*[Fh0 eE5![)%aPG(4PFR*[FL`J2'TeFh4!E'9dG'9bFQpb,QjX2J!!!3!!!!LC!!!(Q3! !!+3)r"0%*d`!!!!F!*B!"ACPFR-!!!!b4%P86!!!!$j"6&*8!!!!5N*#@%B!!!" @3N*B5`!!!'*#3PK8!!!!EJ!"rrm!!!G1#2`4+!#!rrm!!!!!!!!!!!#!rrm!!!# %!!!!!!#!rrm!!!#@!!!!!!#!rrm!!!#H!!!!!!#!!!!J!!#S!!!!!!e5G@iJBA- J8(PdD'pZr0%!: --============_-1282768816==_============-- From joe@strout.net Mon Jun 14 16:59:55 1999 From: joe@strout.net (Joseph J. Strout) Date: Mon, 14 Jun 1999 08:59:55 -0700 Subject: [Pythonmac-SIG] BBPy? In-Reply-To: References: Message-ID: At 2:38 AM -0700 06/14/99, Just van Rossum wrote: >It seems the distribution script is somewhat broken. OTOH, as far as I'm >concerned BBPy is hopelessly obsolete. I'm not sure it even works with >BBEdit 4.5. History: I wrote it in a day or two back in 1996 at the >suggestion of Joe Strout. I worked with it for a while, got very >disappointed and started building an IDE instead ;-). Yes, I'm with Just on this one. "Run as Python" was very cool when it was the only thing available; it saved having to save the file, switch to the finder, and drop it on Python. But now with Just's Awesome IDE, I never use BBEdit and its extensions anymore either. Hey, speaking of the distribution script, how's the distribution of MacPython 1.5.2 final coming? I note that for other platforms, it was released two months ago yesterday. Is there anything I (or others on the list) can do to help? Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From maccgi@bellsouth.net Mon Jun 14 17:53:17 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Mon, 14 Jun 1999 12:53:17 -0400 Subject: [Pythonmac-SIG] BBPy? In-Reply-To: References: Message-ID: --============_-1282743225==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" At 11:38 +0200 6/14/1999, Just van Rossum wrote: >It seems the distribution script is somewhat broken. OTOH, as far as I'm >concerned BBPy is hopelessly obsolete. I'm not sure it even works with >BBEdit 4.5. History: I wrote it in a day or two back in 1996 at the >suggestion of Joe Strout. I worked with it for a while, got very >disappointed and started building an IDE instead ;-). If someone would be >interested in developing it further: be my guest, but I don't feel like >maintaining it any longer. Hi Just & thanks for the file and comments. PythonSlave.py has an error at line 21 ("Types" instead of "types"), but it looks like the extension is broken under BBE 5.1 anyway. Trying to run a script hung BBE and I found the following in the .out window: PythonSlave 0.1.3 ready. Apple Event was not handled, error: (-608, 'noOutstandingHLE') I was interested in BBPy because I'm already in BBEdit most of the day writing Perl, html and JavaScript stuff, so it would be a little more convenient from that standpoint. Also, BBEdit has become very tightly integrated with MacPerl as of v. 5.1- that's good since it has really helped with regex, etc., but most people who are now getting curious about MacPerl don't even know what Python is, let alone Mac Python, and it seems to me that one way of stimulating more interest in Python would be if BBEdit offered some support for it. OTOH, the IDE is really neat and I can see how it covers most of the bases as far as writing Python code is concerned. One question and one comment: a) does find/replace support any type of regex? and b) there's been some discussion here lately about syntax coloring- this is definitely a *good* thing and it would be really nice if this was perfected and implemented the next time around. Thanks. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto://richard@richardgordon.net 770.565.8267 --============_-1282743225==_ma============ Content-Type: text/enriched; charset="us-ascii" At 11:38 +0200 6/14/1999, Just van Rossum wrote: It seems the distribution script is somewhat broken. OTOH, as far as I'm concerned BBPy is hopelessly obsolete. I'm not sure it even works with BBEdit 4.5. History: I wrote it in a day or two back in 1996 at the suggestion of Joe Strout. I worked with it for a while, got very disappointed and started building an IDE instead ;-). If someone would be interested in developing it further: be my guest, but I don't feel like maintaining it any longer. Hi Just & thanks for the file and comments. PythonSlave.py has an error at line 21 ("Types" instead of "types"), but it looks like the extension is broken under BBE 5.1 anyway. Trying to run a script hung BBE and I found the following in the .out window: MonacoPythonSlave 0.1.3 ready. Apple Event was not handled, error: (-608, 'noOutstandingHLE') I was interested in BBPy because I'm already in BBEdit most of the day writing Perl, html and JavaScript stuff, so it would be a little more convenient from that standpoint. Also, BBEdit has become very tightly integrated with MacPerl as of v. 5.1- that's good since it has really helped with regex, etc., but most people who are now getting curious about MacPerl don't even know what Python is, let alone Mac Python, and it seems to me that one way of stimulating more interest in Python would be if BBEdit offered some support for it. OTOH, the IDE is really neat and I can see how it covers most of the bases as far as writing Python code is concerned. One question and one comment: a) does find/replace support any type of regex? and b) there's been some discussion here lately about syntax coloring- this is definitely a *good* thing and it would be really nice if this was perfected and implemented the next time around. Thanks. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto://richard@richardgordon.net 770.565.8267 --============_-1282743225==_ma============-- From maccgi@bellsouth.net Mon Jun 14 18:11:26 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Mon, 14 Jun 1999 13:11:26 -0400 Subject: [Pythonmac-SIG] BBPy? In-Reply-To: References: Message-ID: At 08:59 -0700 6/14/1999, Joseph J. Strout wrote: >Yes, I'm with Just on this one. "Run as Python" was very cool when it was >the only thing available; it saved having to save the file, switch to the >finder, and drop it on Python. But now with Just's Awesome IDE, I never >use BBEdit and its extensions anymore either. I can understand that if you don't do much work in other languages. However, one BBEdit feature that I don't think the IDE has is editing script files on a server via integrated ftp. If you do much cgi work, this is incredibly useful as is Anarchie Pro's integration with BBEdit if you want to open multiple files from the server. I wouldn't presume to know how hard it would be to incorporate ftp into the IDE, but it would certainly be a welcome feature. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto://richard@richardgordon.net 770.565.8267 From andres@corrada.com Mon Jun 14 15:46:06 1999 From: andres@corrada.com (Andres Corrada) Date: Mon, 14 Jun 1999 14:46:06 +0000 Subject: [Pythonmac-SIG] BBPy? References: Message-ID: <37651559.65C60454@corrada.com> Richard Gordon wrote > I can understand that if you don't do much work in other languages. > However, one BBEdit feature that I don't think the IDE has is editing > script files on a server via integrated ftp. If you do much cgi work, > this is incredibly useful as is Anarchie Pro's integration with > BBEdit if you want to open multiple files from the server. I wouldn't > presume to know how hard it would be to incorporate ftp into the IDE, > but it would certainly be a welcome feature. I started a thread in the psa-members list about what I perceive as a pull between pushing Python IDEs and Python communitty support for whatever editor people prefer. Gordon's point is well taken and illustrates that we should support general editors precisely because Python is not the only thing many of us do at work and play. I've volunteered to do a HOWTO on how to configure your favorite editor so if people have input on what they would like to see on the Mac side, let me know. I use Alpha so the information that I have been reading about on BBEdit is great. Please let me know about your favorite editor and the Python mode available for it. For example, does anyone use Code Warrior to write Python? ------------------------------------------------------- Andres Corrada-Emmanuel Email: andres@corrada.com Owner http://www.corrada.com/mamey Mamey Phone: (413) 587-9595 ------------------------------------------------------- From maccgi@bellsouth.net Tue Jun 15 15:16:04 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Tue, 15 Jun 1999 10:16:04 -0400 Subject: [Pythonmac-SIG] Re: [Pythonmac-SIG] BBPy? In-Reply-To: <37651559.65C60454@corrada.com> References: <37651559.65C60454@corrada.com> Message-ID: At 14:46 +0000 6/14/1999, Andres Corrada wrote: >I've volunteered to do a HOWTO on how to configure your favorite editor so if >people have input on what they would like to see on the Mac side, let me know. >I use Alpha so the information that I have been reading about on BBEdit is >great. Please let me know about your favorite editor and the Python mode >available for it. For example, does anyone use Code Warrior to write Python? > I've never gotten too far using Alpha for Python. I did finally track down a Python mode package for it, but it seems half finished and doesn't do very much. I've never attempted to use the Mac version of Emacs for Python as it's so old that I doubt if it would support Python mode. I don't know of a Python tool for MPW/ToolServer, but would be interested if anyone happens to have one. The upshot is that the only editor that I use for Python on the Mac is the IDE which is very slick but narrowly focused. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.565.8267 From jeffrey@Digicool.com Tue Jun 15 15:39:02 1999 From: jeffrey@Digicool.com (Jeffrey P Shell) Date: Tue, 15 Jun 1999 10:39:02 -0400 Subject: [Pythonmac-SIG] Python on MacOS X (not server) Message-ID: <199906151437.KAA16384@python.org> Alright, has anyone tried compiling Python 1.5.2 on THIS sucker ? (the developer release seeded at Macworld Expo and to ADC members). I tried recompiling Python after I installed MacOS X (and thus wiping out my old OSX Server partition) and restored my old home directory. The first thing I noticed was that the threading libraries seem to have changed (compiling with threads and Next Framework and dyld). It gets fairly far along in compilation before erroring out. I haven't taken the time (yet) to investigate further. I don't know what the NDA is about MacOS X, but I'm happy that i FINALLY HAVE A BLUEBOX THAT WORKS ! :) Hopefully now I can get some more focus in on Zope development for MacOS X. Objective Everything seems to run fine in OS X (server and non-server) and they claim it will work with Carbon apps. It's just a pity that it's still at Python 1.4. .jPS | jeffrey@digicool.com zope, through the web. www.zope.org From jeffrey@Digicool.com Tue Jun 15 23:58:29 1999 From: jeffrey@Digicool.com (Jeffrey P Shell) Date: Tue, 15 Jun 1999 18:58:29 -0400 Subject: [Pythonmac-SIG] MacPython in the face of MacOS X Message-ID: <199906152256.SAA28635@python.org> As I continue to punt around not-that-well-known-territory (for me anyways) in regards to MacOS X, I've come across some new li'l issues. I don't know how many of you have seen the glorious pile of spaghetti that is configure, configure.in, and friends -- it's fun. *snicker*. Since there have been some minor-to-major changes in MacOS X away from from MacOS X Server, something in configure files are going uncaught or being caught improperly. There may be a few changes that I'm going to submit soon (if i get it working) to Guido. I've modified configure.in to report MacOS X as, well, MacOS X. For the platform stuff that Python generates, it comes out as macosx10_0 (since the reported version is 10.0). I didn't know whether to set things to be 'macos' or 'macosx'. I find my current naming convention a tad silly since i'm saying 10 twice (the x and the 10_0), but I'm starting to wonder about the future of MacPython on the MacOS X Platform. Has much thought been given to this? Since MacOS X has BSD underpinnings, we won't have to summer the strangeness's of SIOUX. On the other hand, who knows the future for things like TKinter and the MacPython IDE in such an environment. But unless MacPython is Carbon complient, it might not be an issue anyways. Basically, if I set the machine dependency string to be 'macos10_0' (i don't think calling it next10_0 is right), will this cause problems if the MacPython distribution gets built for 10 (probably on the Carbon side)? I'm still building and poking around in my spare time and waiting anxiously for MacWorld NY :) .jPS | jeffrey@digicool.com zope, through the web. www.zope.org From jack@oratrix.nl Wed Jun 16 09:00:11 1999 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 16 Jun 1999 10:00:11 +0200 Subject: [Pythonmac-SIG] MacPython in the face of MacOS X In-Reply-To: Message by "Jeffrey P Shell" , Tue, 15 Jun 1999 18:58:29 -0400 , <199906152256.SAA28635@python.org> Message-ID: <19990616080011.E044E303120@snelboot.oratrix.nl> I think I'd set sys.platform to "macosx". It's definitely not macos, but I think adding the 10_0 is overkill. The macosx would be used for things like checking whether you can import (say) MacOS GUI modules. os.name should be posix, methinks. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jeffrey@Digicool.com Wed Jun 16 15:14:20 1999 From: jeffrey@Digicool.com (Jeffrey P Shell) Date: Wed, 16 Jun 1999 10:14:20 -0400 Subject: [Pythonmac-SIG] MacPython in the face of MacOS X Message-ID: <199906161412.KAA12133@python.org> >From: Jack Jansen > I think I'd set sys.platform to "macosx". It's definitely not macos, but I > think adding the 10_0 is overkill. The macosx would be used for things like > checking whether you can import (say) MacOS GUI modules. The 10_0 is Unix-ish. (ie, sunos5_4, etc...). It's primarily a good way for things like configure to detect differences between versions (like subtle differences between OpenStep 4 and 5.x (5.x being the Rhapsody family). The configure tests can check the system name and release in this fashion. I'd like to keep with that. I haven't looked yet at how this configure option affects the rest of the build and I'll probably tweak it so that things like lib-macosx is made, not lib-macosx10_0. (I still have yet to get a succesful build of the dynamic version I need for Zope source releases to build). I'll keep my building/prodding as MacOSX. Hopefully soon I'll have some more hard drives attached to this machine so I can get Server back up and really look at the differences, as well as getting Darwin running (We'd love to get Python in the Darwin distribution, and hopefully Zope as well). .jPS | jeffrey@digicool.com zope, through the web. www.zope.org From andres@corrada.com Sat Jun 19 07:13:33 1999 From: andres@corrada.com (Andres Corrada) Date: Sat, 19 Jun 1999 06:13:33 +0000 Subject: [Pythonmac-SIG] Tree-like execution of scripts Message-ID: <376B3424.BC72884C@corrada.com> Hi, I want to build a web site's pages by implementing a series of Python scripts that reside in a directory tree structure that mimics the web site architecture. My UNIX mind understands how to do this by having shell scripts that call sub-scripts, etc. How can I do this on the Mac? I thought that using the execfile function would be the way to go, but the footnote on the manual that this is rarely used makes me think there is a better way. What would be the Mac way of doing this task? ------------------------------------------------------- Andres Corrada-Emmanuel Email: andres@corrada.com Owner http://www.corrada.com/mamey Mamey Phone: (413) 587-9595 ------------------------------------------------------- From kantel@mpiwg-berlin.mpg.de Mon Jun 21 11:53:17 1999 From: kantel@mpiwg-berlin.mpg.de (=?iso-8859-1?Q?J=F6rg?= Kantel) Date: Mon, 21 Jun 1999 12:53:17 +0200 Subject: [Pythonmac-SIG] Python running under MachTen/WebTen Message-ID: Hi, has someone tried to make Python working under MachTen (a UN*X running on your Mac Desktop) or better under WebTen (that's an Apache Port for Mac running within a kind of UN*X-Shell). Perl is running on both but I wan't to write my CGI's with Python ;-). BTW: The Mac-Solution using Apple Events is not possible because it's not Thread-safe. TIA J"org -- -------------------------------------------------------------------------- J"org Kantel Max-Planck-Institute for the History of Science Computer-Department kantel@mpiwg-berlin.mpg.de Wilhelmstr. 44 http://www.mpiwg-berlin.mpg.de/staff/kantel/kantel.html D-10117 Berlin fon: +4930-22667-220 fax: +4930-22667-299 -------------------------------------------------------------------------- From joe@strout.net Mon Jun 21 16:16:22 1999 From: joe@strout.net (Joseph J. Strout) Date: Mon, 21 Jun 1999 08:16:22 -0700 Subject: [Pythonmac-SIG] Tree-like execution of scripts In-Reply-To: <376B3424.BC72884C@corrada.com> Message-ID: At 11:13 PM -0700 06/18/99, Andres Corrada wrote: > I want to build a web site's pages by implementing a series of >Python scripts >that reside in a directory tree structure that mimics the web site >architecture. My UNIX mind understands how to do this by having shell scripts >that call sub-scripts, etc. How can I do this on the Mac? I thought that using >the execfile function would be the way to go, but the footnote on the manual >that this is rarely used makes me think there is a better way. What would be >the Mac way of doing this task? Why do you need a bunch of different scripts? Why not just one program, with functions that call themselves recursively as needed? I have a little skeleton program for processing a folder hierarchy on the Mac if you're interested. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From andres@corrada.com Mon Jun 21 18:43:55 1999 From: andres@corrada.com (Andres Corrada) Date: Mon, 21 Jun 1999 17:43:55 +0000 Subject: [Pythonmac-SIG] Tree-like execution of scripts References: Message-ID: <376E78D8.93BC17DF@corrada.com> Joe wrote, > Why do you need a bunch of different scripts? Why not just one program, > with functions that call themselves recursively as needed? Putting scripts in the directories is a cheap way of making the directories sort of act like objects. That way, if I reorganize the web site by moving the directories around, the knowledge on how to build the pages stays with the directory branches. I am interested in your skeleton program. How can I get it? ------------------------------------------------------- Andres Corrada-Emmanuel Email: andres@corrada.com Owner http://www.corrada.com/mamey Mamey Phone: (413) 587-9595 ------------------------------------------------------- From joe@strout.net Mon Jun 21 22:53:48 1999 From: joe@strout.net (Joseph J. Strout) Date: Mon, 21 Jun 1999 14:53:48 -0700 Subject: [Pythonmac-SIG] Tree-like execution of scripts In-Reply-To: <376E78D8.93BC17DF@corrada.com> References: Message-ID: --============_-1282120237==_============ Content-Type: text/plain; charset="us-ascii" At 10:43 AM -0700 06/21/99, Andres Corrada wrote: >Putting scripts in the directories is a cheap way of making the directories >sort of act like objects. That way, if I reorganize the web site by moving the >directories around, the knowledge on how to build the pages stays with the >directory branches. Hmm, good point. That is a rather elegant design, now that you mention it. Though I suspect if you ever actually did move things around, you'd end up with a lot of broken links, since the script in one directory can't easily know where other directories are located. >I am interested in your skeleton program. How can I get it? Here it is. Just import this, then make your own FileCrawler subclass that does something interesting in handleAlias/FolderAlias/Document/Folder. Cheers, -- Joe --============_-1282120237==_============ Content-Id: Content-Type: multipart/appledouble; boundary="============_-1282120237==_D============" --============_-1282120237==_D============ Content-Transfer-Encoding: base64 Content-Type: application/applefile; name="%FileCrawler.py" Content-Disposition: attachment; filename="%FileCrawler.py" ; modification-date="Fri, 26 Feb 1999 13:33:01 -0700" AAUWBwACAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAADAAAASgAAAA4AAAAJAAAAWAAAACAA AAAIAAAAeAAAABAAAAACAAAAiAAAAf9GaWxlQ3Jhd2xlci5weVRFWFRQeXRoAQABCQC1 AAAAAAAAAAAAAAAAAAAAAb3O/lVxQ/5pXw1LbQwA/wEPYwAAAQAAAAG9AAAAvQAAAEIA AAAAAAAAAAAAAAAAAAAAAAAAAAAAVEVYVHR0eHQBAABAAIEAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAFCQAAAAAAAAAAYADnpoAAAABgAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXQAAAAA AAAAAQAOem4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAANAABNWcAFwBIAG8AdwAgAHQAAAC5e3MHAAAAdGFic2l6 ZSgCAAAAaQQAAABpAQAAAHMMAAAAZm9udHNldHRpbmdzKAQAAABzBwAAAFByb0ZvbnRp AAAAAGkJAAAAKAMAAABpAAAAAGkAAAAAaQAAAABzDAAAAHdpbmRvd2JvdW5kcygEAAAA aWgBAABpHwEAAGm+AwAAaTgDAABzCwAAAHJ1bl9hc19tYWluaQAAAABzCQAAAHNlbGVj dGlvbigCAAAAacIBAABp1gEAADAAAAEAAAABvQAAAL0AAABCAyfuTDmoAAAAHAAyAABQ eVdTAAAACgCAAAAAAAAAAzMfJA93aW5kb3cgc2V0dGluZ3M= --============_-1282120237==_D============ Content-Type: application/octet-stream; name="FileCrawler.py" Content-Disposition: attachment; filename="FileCrawler.py" Content-Transfer-Encoding: base64 aW1wb3J0IG9zDWltcG9ydCBtYWNmcw1mcm9tIE1BQ0ZTIGltcG9ydCAqDQ1jbGFzcyBG aWxlQ3Jhd2xlcjoNCQ0JZGVmIGhhbmRsZUFsaWFzKHNlbGYsIHBhdGgpOg0JCXByaW50 ICJEb2N1bWVudCBhbGlhczoiLCBwYXRoDQkNCWRlZiBoYW5kbGVGb2xkZXJBbGlhcyhz ZWxmLCBwYXRoKToNCQlwcmludCAiRm9sZGVyIGFsaWFzOiIsIHBhdGgNCQ0JZGVmIGhh bmRsZURvY3VtZW50KHNlbGYsIHBhdGgsIHR5cGVjb2RlKToNCQlwcmludCB0eXBlY29k ZSwgIkRvY3VtZW50OiIsIHBhdGgNDQlkZWYgaGFuZGxlRm9sZGVyKHNlbGYsIHBhdGgp Og0JCXByaW50ICJGb2xkZXI6IiwgcGF0aA0JCXNlbGYuY3Jhd2wocGF0aCkNCQkNCWRl ZiBjcmF3bChzZWxmLCBwYXRoKToNCQlmaWxlcyA9IG9zLmxpc3RkaXIocGF0aCkNCQlm b3IgZm5hbWUgaW4gZmlsZXM6DQkJCWlmIHBhdGhbLTFdID09ICc6JzogZnBhdGggPSBw YXRoICsgZm5hbWUNCQkJZWxzZTogZnBhdGggPSBvcy5wYXRoLmpvaW4ocGF0aCwgZm5h bWUpDQkJCXNwZWMgPSBtYWNmcy5GU1NwZWMoZnBhdGgpDQkJCXRyeToNCQkJCWluZm8g PSBzcGVjLkdldEZJbmZvKCkNCQkJZXhjZXB0Og0JCQkJIyBpZiBHZXRGSW5mbyBmYWls cywgaXQgbXVzdCBiZSBhIGZvbGRlciENCQkJCWluZm8gPSBtYWNmcy5GSW5mbygpDQkJ CQlpbmZvLlR5cGUgPSAnZmxkcicNCQkJaWYgaW5mby5GbGFncyAmIGtJc0FsaWFzOg0J CQkJaWYgaW5mby5UeXBlID09ICdmZHJwJzoNCQkJCQlzZWxmLmhhbmRsZUZvbGRlckFs aWFzKGZwYXRoKQ0JCQkJZWxzZToNCQkJCQlzZWxmLmhhbmRsZUFsaWFzKGZwYXRoKQ0J CQkJCQ0JCQllbGlmIGluZm8uVHlwZSA9PSAnZmxkcic6DQkJCQlzZWxmLmhhbmRsZUZv bGRlcihmcGF0aCkNCQkJZWxzZToNCQkJCXNlbGYuaGFuZGxlRG9jdW1lbnQoZnBhdGgs IGluZm8uVHlwZSkNCQkJCQ0= --============_-1282120237==_D============-- --============_-1282120237==_============ Content-Type: text/plain; charset="us-ascii" ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' --============_-1282120237==_============-- From seanh@unforgettable.com Wed Jun 23 05:56:55 1999 From: seanh@unforgettable.com (Sean Hummel) Date: Tue, 22 Jun 1999 21:56:55 -0700 Subject: [Pythonmac-SIG] Tree-like execution of scripts Message-ID: <199906230456.AAA29763@pop01.globecomm.net> Look at the older versions of "Frontier" as it had many ways of doing this in a database, which would be easily transportable to Python, and a directory structure. www.userland.com, I believe they charge for the newest versions of Frontier, but the older ones, are still available. ---------- >From: "Joseph J. Strout" >To: Andres Corrada , pythonmac-sig@python.org >Subject: Re: [Pythonmac-SIG] Tree-like execution of scripts >Date: Mon, Jun 21, 1999, 2:53 PM > > At 10:43 AM -0700 06/21/99, Andres Corrada wrote: > >>Putting scripts in the directories is a cheap way of making the directories >>sort of act like objects. That way, if I reorganize the web site by moving the >>directories around, the knowledge on how to build the pages stays with the >>directory branches. > > Hmm, good point. That is a rather elegant design, now that you mention it. > Though I suspect if you ever actually did move things around, you'd end up > with a lot of broken links, since the script in one directory can't easily > know where other directories are located. > > >>I am interested in your skeleton program. How can I get it? > > Here it is. Just import this, then make your own FileCrawler subclass that > does something interesting in handleAlias/FolderAlias/Document/Folder. > > Cheers, > -- Joe > > ,------------------------------------------------------------------. > | Joseph J. Strout Biocomputing -- The Salk Institute | > | joe@strout.net http://www.strout.net | > `------------------------------------------------------------------' From savageb@pacbell.net Fri Jun 25 03:36:56 1999 From: savageb@pacbell.net (savageb) Date: Thu, 24 Jun 1999 19:36:56 -0700 Subject: [Pythonmac-SIG] FW: Carbon SDK: Download Today! Message-ID: <199906250237.TAA23507@mail-gw5.pacbell.net> In case people are interested. This is the announcement of the SDK for the version of Carbon that will run on OS 8.5 -bob ------ FWD ---------- From: Apple Developer Connection To: Apple Developer Connection News Subject: Carbon SDK: Download Today! Date: Wed, Jun 23, 1999, 5:13 PM ============================================================ A P P L E D E V E L O P E R C O N N E C T I O N S E E D I N G N O T I C E June 23 1999 ============================================================ The Carbon SDK for Mac OS 8 is available to all ADC members. Carbon represents the core set of programming interfaces you can use to build Mac OS X applications that can also be deployed on Mac OS 8. The Carbon 1.0d10c3 SDK contains the files necessary for Carbon development on Mac OS 8.5 and includes documentation, utilities, sample code, interface files and version 1.0d10 of the CarbonLib library. To access the software, simply log on to the ADC Member Site using your existing Apple ID (account name) and password and select the "Download Software" option to see a list of software available. The Carbon SDK (Carbon_1.0d10c3_SDK) will be provided as a disk image in both .bin and .hqx format. For more information on Carbon and Mac OS X, please see our web pages at While logged on to the Member Site, please take this opportunity to update your profile to ensure that your mailing information is accurate. For details on the new ADC Member Site interface and functionality, please see Thanks and happy building! Apple Developer Connection ------------------------------------------------------------------- You are receiving this e-mail because you are registered as a member of the Apple Developer Connection. As a member you will continue to receive regular membership updates as well as other important developer information. If you'd like to be removed from the ADC Member list, or you have questions about your account or membership benefits, please send an e-mail to devprograms@apple.com. Other contact information: ------------------------------------------------------------------- From greg@turtleprod.com Fri Jun 25 20:11:43 1999 From: greg@turtleprod.com (Greg Pierce) Date: Fri, 25 Jun 1999 14:11:43 -0500 Subject: [Pythonmac-SIG] problems getting 1.5.1 and 1.5.2b2 running Message-ID: hi...i've had Python installed and running in the past, but switched machines to a new Powerbook G3 (Lombard) w/ 8.6 and can't get Python to install or run properly...i'm hoping for some help... at the end of the install process for 1.5.1, i get this message..... I cannot import the Res module, nor load it from either of toolboxmodules shared libraries. The errors encountered were: import Res: No module named Res load from toolboxmodules.CFM68K.slb: PythonCore: The named library was not found. load from toolboxmodules.ppc.slb: toolboxmodules.ppc.slb: File not found if i try to run "Configure Python" i get: Traceback (innermost last): File "flap:jack:Python:Mac:scripts:ConfigurePython.py", line 237, in ? File "flap:jack:Python:Mac:scripts:ConfigurePython.py", line 177, in main macfs.error: (-43, 'File not found') if i try to fire up the IDE i get: Traceback (innermost last): File "DevDev:PyPy:RoboFog:IDE:PythonIDE.py", line 54, in ? File "DevDev:PyPy:RoboFog:IDE:PythonIDE.py", line 21, in init ImportError: No module named Qd I can still launch Python and import use most basic modules and built-ins.... Similar problems occur w/ the 1.5.2b2 install. Where should i go from here? Greg Pierce greg@turtleprod.com http://www.turtleprod.com/greg/ ---Slow and Steady Wins the Race--- From nbornstein@plr.com Sat Jun 26 20:36:33 1999 From: nbornstein@plr.com (Niel M. Bornstein) Date: Sat, 26 Jun 1999 15:36:33 -0400 Subject: [Pythonmac-SIG] BuildApplication and FTPlib questions Message-ID: Hey there - I'm using Python 1.5.2b1 to make a small specialized FTP app, and I have a couple of questions. I used BuildApplication to build a stand-alone, and I am unsure about a couple things. First, although I used EditPythonPrefs to delay the SIOUX console until needed, it opens immediately. Is there some way I can guarantee that it doesn't open until I do a print? Second, the major functionality of this app is to transfer files by FTP. I'm not sure if I'm doing something wrong, but the transfer seems very slow... what kind of effect does the block size parameter have on the transfer? Does it have to match the block size on the open() call? Also, in my test environment, the FTP sometimes has hung because the server was not responding. Eventually, it times out with an error, but is there a way to capture a command-. to cancel the transfer? Thanks, Niel From just@letterror.com Mon Jun 28 11:32:41 1999 From: just@letterror.com (Just van Rossum) Date: Mon, 28 Jun 1999 12:32:41 +0200 Subject: [Pythonmac-SIG] BuildApplication and FTPlib questions In-Reply-To: Message-ID: At 3:36 PM -0400 6/26/99, Niel M. Bornstein wrote: >Hey there - > >I'm using Python 1.5.2b1 to make a small specialized FTP app, and I have a >couple of questions. > >I used BuildApplication to build a stand-alone, and I am unsure about a >couple things. First, although I used EditPythonPrefs to delay the SIOUX >console until needed, it opens immediately. Is there some way I can >guarantee that it doesn't open until I do a print? Did you try dropping your app onto EditPythonPrefs and then setting the SIOUX option? The easiest thing in the long run is to create a resource file in the same directory as your main program like this: MyMainProgram.py MyMainProgram.rsrc And then drop the resource file onto EditPythonPrefs and edit your prefs. Your edited prefs will now be included in your app when running BuildApplication or BuildApplet. >Second, the major functionality of this app is to transfer files by FTP. >I'm not sure if I'm doing something wrong, but the transfer seems very >slow... what kind of effect does the block size parameter have on the >transfer? Does it have to match the block size on the open() call? Hm, no idea here. Anyone else? >Also, in my test environment, the FTP sometimes has hung because the server >was not responding. Eventually, it times out with an error, but is there a >way to capture a command-. to cancel the transfer? This should work as is: try: ...do ftp stuff... except KeyboardInterrupt: ...user cancelled... Just From nbornstein@plr.com Tue Jun 29 01:08:24 1999 From: nbornstein@plr.com (Niel M. Bornstein) Date: Mon, 28 Jun 1999 20:08:24 -0400 Subject: [Pythonmac-SIG] BuildApplication and FTPlib questions In-Reply-To: References: Message-ID: >Your edited prefs will now be included in your app when running >BuildApplication or BuildApplet. ... >>I'm not sure if I'm doing something wrong, but the transfer seems very >>slow... ... >try: > ...do ftp stuff... >except KeyboardInterrupt: > ...user cancelled... Thanks for your help. Using EditPythonPrefs on the .rsrc seems to work, though the KeyboardEvent exception doesn't seem to make a difference. Hopefully, the server will never be down and require the user to cancel -- if it is there are bigger problems anyway ;) I'm still looking for an answer on speeding up the transfer. One final question: my client needs to be able to tell his clients what they need to have to run this app. Is there documentation as to which Mac platforms are currently supported? OS version, hardware, etc. From what I've been able to find, any PowerMac should work, but I'm not clear on which 68k Macs will work, under what OS. Niel From seanh@unforgettable.com Tue Jun 29 03:36:35 1999 From: seanh@unforgettable.com (Sean Hummel) Date: Mon, 28 Jun 1999 19:36:35 -0700 Subject: [Pythonmac-SIG] Problems with embedding Message-ID: <199906290236.WAA11739@pop05.iname.net> Okay so here is one I haven't seen on the list yet. I have written a GAME which embeds python, using it to describe the game's logic. While all the sprites are handled with the SpriteWorld Library. Now as the game worked in the past, all the callbacks made into the "__main__" module, contained an entire state of the game. However using this was too slow, once the game got more complex. As a result, I attempted to store the state info inside of the "__main__" module, and the root level, as just some variables: import gameworld import sprites spritelist=[] def initializeGame(gw): ... newsprite=sprites.CreateFromCicnResource() spritelist.append(newsprite) return def idle(gw): print spritelist[0] return When the "idle" function callback is made from the mainloop of the application framework, the "spritelist" is still set to [], even though it was added in the "initializeGame" Is there something I'm not doing? Is the context different in this case? I've checked the obvious, like making sure that code for this module is not getting released prematurely. From Pieter Claerhout" Hello, I think I have found a bug in the BuildApplication applet. I made a Python applet with a custom creator (defined in a ResEdit file). The strange thing is that when I do a BuildApplet, the applet automatically has the correct type and creator, but not when I do a BuildApplication. Does anyone experienced the same problem? Kind regards, Pieter [ Pieter Claerhout chill@mediaport.org ] From just@letterror.com Wed Jun 30 20:36:47 1999 From: just@letterror.com (Just van Rossum) Date: Wed, 30 Jun 1999 21:36:47 +0200 Subject: [Pythonmac-SIG] BuildApplication bug?? In-Reply-To: <000301bec32a$6edd6b40$9d1300c3@cevi0008> Message-ID: At 8:56 PM +0200 6/30/99, Pieter Claerhout wrote: >Hello, > >I think I have found a bug in the BuildApplication applet. >I made a Python applet with a custom creator (defined in >a ResEdit file). The strange thing is that when I do a >BuildApplet, the applet automatically has the correct >type and creator, but not when I do a BuildApplication. > >Does anyone experienced the same problem? Yes, but only recently. I've fixed it for the next release. You can patch it yourself by removing these two lines from :Mac:Tools:macgen_bin.py (around line 80) < fss = macfs.FSSpec(output) < fss.SetCreatorType('Pyta', 'APPL') Just From just@letterror.com Wed Jun 30 20:51:44 1999 From: just@letterror.com (Just van Rossum) Date: Wed, 30 Jun 1999 21:51:44 +0200 Subject: [Pythonmac-SIG] BuildApplication bug?? In-Reply-To: References: <000301bec32a$6edd6b40$9d1300c3@cevi0008> Message-ID: I wrote: >Yes, but only recently. I've fixed it for the next release. You can patch >it yourself by removing these two lines from :Mac:Tools:macgen_bin.py >(around line 80) >< fss = macfs.FSSpec(output) >< fss.SetCreatorType('Pyta', 'APPL') The file is really :Mac:Tools:macfreeze:macgen_bin.py. Just