From jack@oratrix.nl Tue May 1 11:38:59 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 01 May 2001 12:38:59 +0200 Subject: [Pythonmac-SIG] Have to run ConfigurePythonCarbon after each reboot In-Reply-To: Message by Kolya , Mon, 30 Apr 2001 08:49:48 +0100 , Message-ID: <20010501103942.1F73A312BA9@snelboot.oratrix.nl> > I am new to the delights of Python so please excuse my ignorance. > > I downloaded MacPython 2.1 on April 27, and it looks great! The only problem > is that whenever I try running my one and only applet after starting or > restarting the Mac, I get the error message: The application ... could not > be opened because PythonCoreCarbon could not be found. > > Then I run ConfigurePythonCarbon and everything works just fine. Until the > next reboot. I am running Mac OS 9.0.4. Have you installed Python on another disk than the system disk? If so you should copy PythonCore and PythonCoreCarbon in stead of aliasing them (ConfigurePython offers to do this). If you're not running off another disk than the system disk it could be that you're running into a new problem. If you can send me the full output of your Apple System Profiler I may be able to deduce what's happening. -- 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 jack@oratrix.nl Tue May 1 22:23:38 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 1 May 2001 23:23:38 +0200 (MET DST) Subject: [Pythonmac-SIG] MacPython 2.1 released Message-ID: <20010501212338.BDAF7DDDF0@oratrix.oratrix.nl> MacPython 2.1 is available for download. Get it via http://www.cwi.nl/~jack/macpython.html . Python is a high-level programming language that is suitable for simple scripting tasks as well as writing large applications. MacPython offers alot of Mac-specific extensions, including access to all major MacOS Toolbox modules (QuickDraw, QuickTime, AppleScript and many more), an Integrated Development Environment (in Python!), frameworks for windowing applications, unix-compatible cgi-scripting, image-manipulation libraries, numerical libraries, tk-based machine independent windowing and lots more. It also uniquely among Pythons allows you to create fully selfcontained (and, hence, distributable) applications without needing a C compiler or anything. New in this version: - A choice of Carbon or Classic runtime, so runs on anything between MacOS 8.1 and MacOS X - Distutils support for easy installation of extension packages - BBedit language plugin - All the platform-independent Python 2.1 mods - New version of Numeric - Lots of bug fixes - Choice of normal and active installer Please send feedback on this release to pythonmac-sig@python.org, where all the MacPythoneers hang out. Enjoy, -- 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/ ++++ From richard@blumberg.org Wed May 2 15:32:09 2001 From: richard@blumberg.org (Richard Blumberg) Date: Wed, 2 May 2001 10:32:09 -0400 Subject: [Pythonmac-SIG] MacPython 2.1 released In-Reply-To: <20010501212338.BDAF7DDDF0@oratrix.oratrix.nl> Message-ID: <20010502143340.SJOB3250.mta01.fuse.net@localhost> I just installed 2.1 final release, ran ConfigurePythonCarbon, started PythonInterpreter, and imported test.autotest. I got two failurs, test_asynchat and test_socket. The latter, I assume from previous posts, is because reverse lookup is not configured. The error message for test_asynchat is: > test_asynchat > The actual stdout doesn't match the expected stdout. > This much did match (between asterisk lines): > ********************************************************************** > test_asynchat > Connected > ********************************************************************** > Then ... > We expected (repr): "Received: 'hello world'\n" > But instead we got: "error: uncaptured python exception, closing channel > (socket.error:(22, 'Invalid argument') > [arjuna:applications:python 2.1:lib:asynchat.py|handle_read|82] > [arjuna:applications:python 2.1:lib:asyncore.py|recv|349])" > The actual stdout doesn't match the expected stdout. > This much did match (between asterisk lines): > ********************************************************************** > test_asynchat > Connected > ********************************************************************** > Then ... > We expected (repr): '' > But instead we got: ' ' > test test_asynchat failed -- Writing: ' ', expected: '' Also, if I open Terminal and try to run Python from the command line, with '/Applications/Python\ 2.1/PythonInterpreter', I get the following error: > /Applications/Python 2.1/PythonInterpreter: unmatched ` [1] Is it possible to run MacPython from the command line? What I'd like to do is settle on this single version of Python, set up a symbolic link to '/Applications/Python\ 2.1/PythonInterpreter' at /usr/bin/python, and use MacPython for my cgi testing. Richard From jack@oratrix.nl Wed May 2 16:07:46 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 02 May 2001 17:07:46 +0200 Subject: [Pythonmac-SIG] MacPython 2.1 released In-Reply-To: Message by Richard Blumberg , Wed, 2 May 2001 10:32:09 -0400 , <20010502143340.SJOB3250.mta01.fuse.net@localhost> Message-ID: <20010502150746.4990C312BD3@snelboot.oratrix.nl> > I just installed 2.1 final release, ran ConfigurePythonCarbon, started > PythonInterpreter, and imported test.autotest. > > I got two failurs, test_asynchat and test_socket. The latter, I assume > from previous posts, is because reverse lookup is not configured. The > error message for test_asynchat is: > [...] I think the asynchat failure is essentially the same as the socket failure. There's a report that it goes away if you set up reverse mapping. > Also, if I open Terminal and try to run Python from the command line, with > '/Applications/Python\ 2.1/PythonInterpreter', I get the following error: > > > /Applications/Python 2.1/PythonInterpreter: unmatched ` [1] > > Is it possible to run MacPython from the command line? Sorry, this won't work. MacPython lives ain a fully mac-centric universe, with \r as line ending, mac:path:names in stead of /unix/path/names, no command line arguments, etc etc etc. There's a lot of work to be done for a unified distribution, and we're still looking for people willing to help.... -- 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 pecora@anvil.nrl.navy.mil Wed May 2 22:03:36 2001 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Wed, 2 May 2001 17:03:36 -0400 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #703 - 2 msgs In-Reply-To: Message-ID: FYI. Just downloaded Python vers. 2.1. Installed the PPC Classic version on my G4 running system 9.1. Ran test and got this as a summary: test test_zlib crashed -- exceptions.MemoryError: Can't allocate memory to compress data 105 tests OK. 3 tests failed: test_longexp test_sha test_zlib 29 tests skipped: test_al test_bsddb test_cd test_cl test_crypt test_dbm test_dl test_fcntl test_fork1 test_gc test_gl test_grp test_imgfile test_largefile test_linuxaudiodev test_locale test_mmap test_nis test_openpty test_poll test_popen2 test_pty test_pwd test_signal test_sunaudiodev test_sundry test_timing test_winreg test_winsound Haven't tried my stuff, yet. Will do so soon. Cheers, Lou Pecora From jack@oratrix.nl Thu May 3 22:10:00 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 03 May 2001 23:10:00 +0200 Subject: [Pythonmac-SIG] Re: Python 2.1 ConfigurePythonCarbon hanging on OSX In-Reply-To: Message by Merle Reinhart , Thu, 3 May 2001 07:16:50 -0400 , <20010503111706.KFXH12893.femail14.sdc1.sfba.home.com@localhost> Message-ID: <20010503211005.AD9C3E938F@oratrix.oratrix.nl> I've had a report from Merle Reinhart that ConfigurePythonCarbon is hanging on OSX. We've been looking into this together over the last few days, and it seems that what happens is that somewhere while it is copying PythonCore and PythonCoreCarbon it will "give up" and hang. Is anyone else seeing hangs during file I/O on MacOSX? One of the things that is special about his machine (i.e. what mine doesn't have:-) is that it's a multiprocessor, so I would be very interested in hearing of people who have installed MacPython 2.1 on OSX on a multiprocessor machine. Actually: my suspicions in this direction are rather serious (a multiprocessor could more easily wreak havoc with the underlying GUSI I/O system sleep/wakeup code), so if you have access to such a machine but haven't installed MacPython on it yet I'd really like it if you gave it a try. You'll get either a free beer (to be collected here in Amsterdam) or free CD by the brilliant dutch punkrockband Uit de Sloot for your efforts:-) -- 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 lmeyn@mail.arc.nasa.gov Thu May 3 19:49:47 2001 From: lmeyn@mail.arc.nasa.gov (Larry Meyn) Date: Thu, 3 May 2001 11:49:47 -0700 Subject: [Pythonmac-SIG] MacPython 2.1 released Message-ID: Just a minor note. The path for PIL is incorrect in the python preferences. The line: $(PYTHON):Extensions:Imaging:PIL should be changed to: $(PYTHON):Extensions:Imaging since PIL is installed as a package. -- ------------------------------------------------------------------ Larry Meyn Aerospace Operations Modeling Office M/S 210-10 Phone: (650) 604-5038 NASA Ames Research Center FAX: (650) 604-0222 Moffett Field, CA 94035-1000 email: lmeyn@mail.arc.nasa.gov ------------------------------------------------------------------ From lmeyn@mail.arc.nasa.gov Thu May 3 19:51:32 2001 From: lmeyn@mail.arc.nasa.gov (Larry Meyn) Date: Thu, 3 May 2001 11:51:32 -0700 Subject: [Pythonmac-SIG] MacPython 2.1 released Message-ID: FYI All auto tests passed using PPC Classic version on my G4 running system 9.1 once enough memory was allocated. test_zlib passed when 48 Mb were allocated and test_longexp passed when 400 Mb were allocated. These are probably not the minimum required values since I just tried arbitrarily larger values until the failing tests passed. >FYI. > >Just downloaded Python vers. 2.1. Installed the PPC Classic version on my G4 running system 9.1. Ran test and got this as a summary: > >test test_zlib crashed -- exceptions.MemoryError: Can't allocate memory to compress data > >105 tests OK. > >3 tests failed: test_longexp test_sha test_zlib > >29 tests skipped: test_al test_bsddb test_cd test_cl test_crypt test_dbm test_dl test_fcntl test_fork1 test_gc test_gl test_grp test_imgfile test_largefile test_linuxaudiodev test_locale test_mmap test_nis test_openpty test_poll test_popen2 test_pty test_pwd test_signal test_sunaudiodev test_sundry test_timing test_winreg test_winsound > >Haven't tried my stuff, yet. Will do so soon. > > > >Cheers, > >Lou Pecora > > > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig -- ------------------------------------------------------------------ Larry Meyn Aerospace Operations Modeling Office M/S 210-10 Phone: (650) 604-5038 NASA Ames Research Center FAX: (650) 604-0222 Moffett Field, CA 94035-1000 email: lmeyn@mail.arc.nasa.gov ------------------------------------------------------------------ From richard@richardgordon.net Fri May 4 17:09:00 2001 From: richard@richardgordon.net (Richard Gordon) Date: Fri, 4 May 2001 12:09:00 -0400 Subject: [Pythonmac-SIG] [OT] Today's gadfly triumph Message-ID: It's not a Mac-centric issue and maybe some of you have already figured this out, but the client and server modules in gadfly broke somewhere around Python 2 due to a change in some socket stuff. As is, each gets upset because the number of arguments being passed should be 1 when it is 2. Anyway, I figured out that what will work is to modify the modules to pass a tuple with 2 elements and have outlined the changes below (my tuple's name refers to the wisdom that even a blind hog finds an acorn now and then, you can call it whatever you like). So this works now under Python 2.1 and my Mac is running the server while my win2k box accesses it with the client. Pretty groovey. gfserve.py line 335: #change from #sock.bind(self.HOST, self.port) #to blindhog = self.HOST, self.port sock.bind(blindhog) gfclient.py line 141: #change from #sock.connect(self.machine, self.port) #to blindhog = self.machine, self.port sock.connect(blindhog) Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From jackjansen@mac.com Fri May 4 23:58:35 2001 From: jackjansen@mac.com (Jack Jansen) Date: Sat, 5 May 2001 00:58:35 +0200 Subject: [Pythonmac-SIG] Editing files from OSX console Message-ID: <200105042258.PAA27259@smtpout.mac.com> --Apple-Mail-487974949-1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; format=flowed; charset=us-ascii Here's a script I've been using in my OSX terminal window a lot to open a file with BBEdit. There's probably a better way to do this (please let me know!). Oh yes: you have to change the disk name to what your disk is called. There's probably a unix utility that will tell you this, but I couldn't find it. I also couldn't find a pathname conversion command, it's also probably available, please let me know if you know of something. --Apple-Mail-487974949-1 Content-Type: multipart/mixed; boundary=Apple-Mail-11357690-2 --Apple-Mail-11357690-2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed Here's a script I've been using in my OSX terminal window a lot to open a file with BBEdit. There's probably a better way to do this (please let me know!). Oh yes: you have to change the disk name to what your disk is called. There's probably a unix utility that will tell you this, but I couldn't find it. I also couldn't find a pathname conversion command, it's also probably available, please let me know if you know of something. --Apple-Mail-11357690-2 Content-Disposition: attachment Content-Type: multipart/appledouble; boundary=Apple-Mail-1625853867-3 --Apple-Mail-1625853867-3 Content-Disposition: attachment; filename="bbedit" Content-Type: application/applefile; name="bbedit" Content-Transfer-Encoding: base64 AAUWBwACAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAJAAAAMgAAAAoAAAADAAAAPAAAAAZURVhUAAAA AAAAYmJlZGl0 --Apple-Mail-1625853867-3 Content-Disposition: attachment; filename="bbedit" Content-Type: application/octet-stream; name="bbedit"; x-mac-type=54455854; x-mac-creator=0; x-unix-mode=0755 Content-Transfer-Encoding: quoted-printable #!/usr/local/bin/python=0A#=0A#=20Open=20files=20with=20BBEdit=0A#=0A= import=20sys=0Aimport=20os=0Aimport=20urllib=0Aimport=20macurl2path=0A= import=20string=0A=0ASCRIPT=3D"""=0Atell=20application=20"BBEdit=206.1=20= for=20OS=20X"=0A=09activate=0A%s=0Aend=20tell=0A"""=0ADISK=3D"/Worm"=0A=0A= def=20main():=0A=09files=3D[]=0A=09for=20file=20in=20sys.argv[1:]:=0A=09=09= files.append(convert2mac(file))=0A=09opencommands=20=3D=20= string.join(map(lambda=20x:=20'\topen=20"%s"'=20%=20x,=20files),=20'\n')=0A= =09fp=20=3D=20=20os.popen("/usr/bin/osascript",=20"w")=0A=09= fp.write(SCRIPT=20%=20opencommands)=0A=09sys.exit(fp.close())=0A=09=0A= def=20convert2mac(filename):=0A=09if=20not=20os.path.isabs(filename):=0A=09= =09filename=20=3D=20os.path.join(os.getcwd(),=20filename)=0A=09filename=20= =3D=20DISK=20+=20filename=0A=09url=20=3D=20urllib.pathname2url(filename)=0A= =09macfilename=20=3D=20macurl2path.url2pathname(url)=0A=09return=20= macfilename=0A=09=0Amain()= --Apple-Mail-1625853867-3-- --Apple-Mail-11357690-2-- --Apple-Mail-487974949-1-- From jack@oratrix.nl Mon May 7 14:22:48 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 07 May 2001 15:22:48 +0200 Subject: [Pythonmac-SIG] MacPython CVS moving to the main repository Message-ID: <20010507132248.EDE00312BA1@snelboot.oratrix.nl> Folks, sometime this week I'll be moving the MacPython CVS repository to the main Python repository on python.sourceforge.net. If I remember correctly Just is the only person with write access, but let me know if I'm forgetting someone. Anyway, everyone with write access (including myself:-) should check in any unsaved changes. -- 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/ ++++ From h3o@veda.is Mon May 7 17:14:27 2001 From: h3o@veda.is (h3o) Date: Mon, 7 May 2001 18:14:27 +0200 Subject: [Pythonmac-SIG] Remote Access Connection file password In-Reply-To: References: Message-ID: hello. I need to be able to set the password used by ARA/PPP in the Remote Access Connection file, in the Remote Access folder, in the preferences folder of the System Folder. this is stored in the 'pass' resource of the file, but the actual password data is is encoded using DES in ECB mode. there are modules and scripts to handle the management of the connection, but none, that I can find that deal with the *writing* of this info to the file. the routine that does the encryption is provided by the ARA API, and is called PassWordMunger. I am conversant with making toolbox calls; however, as this function is not part of the Universal Headers, I am unclear as to how to call this. does anyone have any pointers to how to do this? TIA /andrew mckenzie From adv.files@robbstucky.com Mon May 7 20:14:06 2001 From: adv.files@robbstucky.com (Advertising) Date: Mon, 7 May 2001 15:14:06 -0400 Subject: [Pythonmac-SIG] Zope on a Mac? Message-ID: <200105071913.MAA17115@swan.mail.pas.earthlink.net> Hi to all I just got a G4 with MacOS X. Wahoo! I'm interested in running Zope on this machine. Does the Mac-Centric line ending problem mean I can't/shouldn't use macPython for Zope? [Yes, you're correct / No, you're off base] Thanks to All ------------------------------------ ps, Tony Lownds' package of UNIX python http://tony.lownds.com/macosx/ Python 2.0 final in Mac OS X Package format installs fine on my MacG4 with the latest update from Apple = OSX-10.0.2updated. Now if somebody can point me to where I can find Zope 2.3.0 I think it's all ready to go. (Zope.org only has 2.3.2 on it's download page.) (not a surprise, it won't build on MacOSX - errors) (according to jShell http://www.zope.org/Members/jshell/ZopeOnOSX) (python 2.0 + Zope 2.3.0 will work) For those of you with older mac's I just installed Debian 2.2r3 onto my powerMac7100, yes a 7100 with no openfirmware then issued apt-get -u install python apt-get -u install zope Viola! Zope on a Mac (not a Mac anymore, but running Zope!) From dante@oz.net Mon May 7 21:49:31 2001 From: dante@oz.net (Michael Esveldt) Date: Mon, 7 May 2001 13:49:31 -0700 Subject: [Pythonmac-SIG] [OT] Capturing Apple Events in OS X Message-ID: Has anyone found, or is there a utility floating around for OS X that's comparable to Lasso CaptureAE? Michael -- The Chao says Mu. Michael Esveldt, #FightThePower on irc.openprojects.net From fernstrom@geocities.com Mon May 7 23:13:25 2001 From: fernstrom@geocities.com (christer fernstrom) Date: Mon, 07 May 2001 23:13:25 +0100 Subject: [Pythonmac-SIG] Can't get IDE to work for Python 2.1 Message-ID: <3af70f483b18e1c0@mahonia.wanadoo.fr> (added by mahonia.wanadoo.fr) I have recently installed Python 2.1 on my Mac running OS 8.5.1 (French), full installation, and, yes, I did put copies of the PythonCores in the extension folder instead of aliases (since I installed on a non-system disk). I also configured using ConfigurePythonClassic. The interpreter works, and test.autotest works rather fine (some minor failures :-/). However when I try to run Python IDE I get the following: Traceback (most recent call last): File "Lucas:Python 2.1: Mac:Tools:IDE:PythonIDE.py", line 41, in ? import PythonIDEMain File "Lucas:Python 2.1: Mac:Tools:IDE:PythonIDEMain.py", line 41, in ? import Splash File "Lucas:Python 2.1: Mac:Tools:IDE:Splash.py", line 7, in ? import Qd, TE, Fm, sys ImportError: InterfaceLib--IsAntiAliasedTextEnabled: A fragment had "hard" unresolved imports. Any hints? christer From bobsavage@mac.com Tue May 8 02:35:53 2001 From: bobsavage@mac.com (Bob Savage) Date: Mon, 07 May 2001 18:35:53 -0700 Subject: [Pythonmac-SIG] Zope on a Mac? In-Reply-To: <200105071913.MAA17115@swan.mail.pas.earthlink.net> Message-ID: > Tony Lownds' package of UNIX python > http://tony.lownds.com/macosx/ > Python 2.0 final in Mac OS X Package format > installs fine on my MacG4 with the latest update from Apple = > OSX-10.0.2updated. > > > Now if somebody can point me to where I can find Zope 2.3.0 > I think it's all ready to go. > (Zope.org only has 2.3.2 on it's download page.) > (not a surprise, it won't build on MacOSX - errors) > (according to jShell > http://www.zope.org/Members/jshell/ZopeOnOSX) > (python 2.0 + Zope 2.3.0 will work) > If I understand the situation properly, you can download the current version (2.1) of Python from the main website (python.org) and it should build with no problems. That way you could use the newer version of Zope. best, Bob From Jon.H.Kaspersen@unimed.sintef.no Tue May 8 07:47:03 2001 From: Jon.H.Kaspersen@unimed.sintef.no (Jon Harald Kaspersen) Date: Tue, 8 May 2001 08:47:03 +0200 Subject: [Pythonmac-SIG] Is it possible to load *.dylib files into MacPython ? Message-ID: I have been working with python from the unix side of OSX, and I wonder if it is possible to load shared libs compiled under OSX (unix) into MacPython and use them from MacPython ? In case of yes, how is this done ? Regards Jon Harald Kaspersen -- ____________________________________________________________ Dr. Jon Harald Kaspersen Tel: +47 73 59 75 89 SINTEF Unimed - Ultralyd Pager +47 96 84 29 94 N-7034 Trondheim Fax: +47 73 59 78 73 NORWAY e-mail: Jon.H.Kaspersen@unimed.sintef.no ____________________________________________________________ From jack@oratrix.nl Tue May 8 10:16:38 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 08 May 2001 11:16:38 +0200 Subject: [Pythonmac-SIG] Remote Access Connection file password In-Reply-To: Message by h3o , Mon, 7 May 2001 18:14:27 +0200 , Message-ID: <20010508091639.82E13312BA1@snelboot.oratrix.nl> > the routine that does the encryption is provided by the ARA API, and > is called PassWordMunger. I am conversant with making toolbox calls; > however, as this function is not part of the Universal Headers, I am > unclear as to how to call this. You could try using the calldll module to make an interface to this function. -- 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 pecora@anvil.nrl.navy.mil Tue May 8 21:15:10 2001 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Tue, 8 May 2001 16:15:10 -0400 Subject: [Pythonmac-SIG] Problem with Piddle plotting with Python 2.1 Message-ID: I have installed Python 2.1 and its own self tests are fine (running MacO= S 9.1 on a G4). I am now testing the drawing routines in the package Pid= dle by running piddletest.py . This worked under Python 1.52, but I now = get the error message: Traceback (most recent call last): File "Drive:Applications =9F:Python 2.1 =9F:*piddle:piddletest.py", lin= e 395, in ? mainLoop() File "Drive:Applications =9F:Python 2.1 =9F:*piddle:piddletest.py", lin= e 372, in mainLoop docstr =3D __import__(backends[backend]).__doc__ File "Drive:Applications =9F:Python 2.1 =9F:*piddle:piddleQD.py", line = 45, in ? import W File "drive:applications =9F:python 2.1 =9F:mac:tools:ide:W.py", line 5= , in ? from Wbase import * File "drive:applications =9F:python 2.1 =9F:mac:tools:ide:Wbase.py", li= ne 706, in ? _cursors =3D { Mac OS Error: (-192, 'Resource not found') The offending code is in Wbase.py : _cursors =3D { "watch" : Qd.GetCursor(QuickDraw.watchCursor).data, "arrow" : Qd.qd.arrow, "iBeam" : Qd.GetCursor(QuickDraw.iBeamCursor).data, "cross" : Qd.GetCursor(QuickDraw.crossCursor).data, "plus" : Qd.GetCursor(QuickDraw.plusCursor).data, "hand" : Qd.GetCursor(468).data, "fist" : Qd.GetCursor(469).data, "hmover" : Qd.GetCursor(470).data, "vmover" : Qd.GetCursor(471).data, "zoomin" : Qd.GetCursor(472).data, "zoomout" : Qd.GetCursor(473).data, "zoom" : Qd.GetCursor(474).data, } I'm guessing one of the Qd. calls is the problem, but I have no idea whic= h one. Does anyone know what the trouble is? Is there a fix? Thanks fo= r any help. Cheers, Lou Pecora From deirdre@deirdre.net Tue May 8 21:19:40 2001 From: deirdre@deirdre.net (Deirdre Saoirse Moen) Date: Tue, 8 May 2001 13:19:40 -0700 Subject: [Pythonmac-SIG] Problem with Piddle plotting with Python 2.1 In-Reply-To: References: Message-ID: >Mac OS Error: (-192, 'Resource not found') > > >The offending code is in Wbase.py : > >_cursors = { > "watch" : Qd.GetCursor(QuickDraw.watchCursor).data, > "arrow" : Qd.qd.arrow, > "iBeam" : Qd.GetCursor(QuickDraw.iBeamCursor).data, > "cross" : Qd.GetCursor(QuickDraw.crossCursor).data, > "plus" : Qd.GetCursor(QuickDraw.plusCursor).data, > "hand" : Qd.GetCursor(468).data, > "fist" : Qd.GetCursor(469).data, > "hmover" : Qd.GetCursor(470).data, > "vmover" : Qd.GetCursor(471).data, > "zoomin" : Qd.GetCursor(472).data, > "zoomout" : Qd.GetCursor(473).data, > "zoom" : Qd.GetCursor(474).data, >} > >I'm guessing one of the Qd. calls is the problem, but I have no idea >which one. Does anyone know what the trouble is? Is there a fix? >Thanks for any help. One of the cursors listed doesn't exist in the resource fork of the file it's opening. It should, with a tool like ResEdit, be fairly easy to determine which is the offender. Alternately, you can comment out each line one by one and see which one(s) are the problem. The named cursors are part of the MacOS proper, so they shouldn't be the problem. I'd start with "hand" myself. -- _Deirdre Stash-o-Matic: http://weirdre.com http://deirdre.net "I love deadlines. I like the whooshing sound they make as they fly by." - Douglas Adams From just@letterror.com Tue May 8 21:55:17 2001 From: just@letterror.com (Just van Rossum) Date: Tue, 8 May 2001 22:55:17 +0200 Subject: [Pythonmac-SIG] Problem with Piddle plotting with Python 2.1 In-Reply-To: Message-ID: <20010508225536-r01010600-88384048@213.84.27.177> Louis M. Pecora wrote: > I'm guessing one of the Qd. calls is the problem, but I have no idea which > one. Does anyone know what the trouble is? Is there a fix? Thanks for any > help. It's crashing in W code, so I assume you're not running this in the IDE. Look for a file called Windgets.rsrc, and either add it to your project or open it yourself with Res.OpenResFile() or Res.PSpOpenResFile(). Just From just@letterror.com Tue May 8 22:00:58 2001 From: just@letterror.com (Just van Rossum) Date: Tue, 8 May 2001 23:00:58 +0200 Subject: [Pythonmac-SIG] Problem with Piddle plotting with Python 2.1 In-Reply-To: <20010508225536-r01010600-88384048@213.84.27.177> Message-ID: <20010508230102-r01010600-d669ec37@213.84.27.177> Just van Rossum wrote: > Look > for a file called Windgets.rsrc Er, "Widgets.rsrc" it should be... Just From hauser@namecraft.com Wed May 9 06:53:53 2001 From: hauser@namecraft.com (Michael Hauser) Date: Tue, 8 May 2001 22:53:53 -0700 Subject: [Pythonmac-SIG] MacPython and MidiShare? Message-ID: Has anyone used MidiShare from MacPython? Thanks. Michael Hauser From jack@oratrix.nl Fri May 11 15:29:24 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 11 May 2001 16:29:24 +0200 Subject: [Pythonmac-SIG] Mac CVS repository moved to sourceforge Message-ID: <20010511142924.C8037303181@snelboot.oratrix.nl> Folks, the Python/Mac repository has been moved to sourceforge, and is integrated with the general Python repository, so from now on a single CVS tree suficces to build MacPython. I'm setting the old pythoncvs.oratrix.nl repository to readonly for a few more weeks and then it'll disappear. Note that the pythoncvs.oratrix.nl repository is still the source for some of the optional libraries you need to build MacPython, but that's only if you want to build it completely from CVS. -- 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/ ++++ From bobsavage@mac.com Thu May 17 06:19:13 2001 From: bobsavage@mac.com (Bob Savage) Date: Wed, 16 May 2001 22:19:13 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X Message-ID: Guide to installing Unix-Python on MacOS X It took me a while to figure out precisely how to install the Unix Python distribution under MacOSX. I screwed up just about everything there was to screw up, so I know what a pain it is trying to do this when you don't know how. I figured there must be at least one person who knows as little as I did before starting on this journey and they might search the archives of this group with the hope that they can find a step-by-step no assumptions made about knowing how to work with a CLI guide to doing such an install, so I typed up what worked for me. If anyone sees something that is wrong, please write in to the list so that people will see your correction, and not just the bone-headed thing I wrote. Here is what I did step by step: [1] get the most recent release from http://www.python.org at the time of this writing that was Python 2.1 [2] if it isn't already uncompressed, uncompress it now, you can do this by dropping it on Stuffit Expander even though it has a ".tgz" or ".tar.gzip" ending. [3] open the Terminal application (you should find it in the Utilities subfolder of the Applications folder). In case you don't know, in Unix-speak that would be described as Applications/Utilities. You'll see a lot of stuff like that n just a minute. [4] start typing stuff. When I show you stuff to type into the Terminal application, I will show it as being typed like this: %ls That means type 'ls' and enter. I don't know what precisely your command prompt (the thing I am representing as '%' is going to look like. Mine looks like this: "[localhost:~] bsavage% ". [5] type this: %setenv OPT '-g -traditional-cpp' [6] now you need to change directories to the one that was created by uncompressing the Python distribution. An easy way to do this is to type 'cd ' at the prompt **WITHOUT hitting enter** and then dragging the folder into the Terminal window. Then hit enter. On my system it looked like this: [localhost:~] bsavage% cd /Users/bsavage/Desktop/Python-2.1 [7] type this into the Terminal and watch as lots of stuff that you don't understand goes by %./configure --with-suffix=.exe --with-dyld [8] when you get a command prompt again enter this, and watch some more mystifying messages for a while %make ** NOTE: for me, this resulted in about six errors similar to this (if this is a problem, hopefully someone will speak up): In file included from /usr/include/unistd.h:72, from Objects/fileobject.c:12: /usr/include/sys/unistd.h:87: warning: `_POSIX_THREADS' redefined config.h:159: warning: this is the location of the previous definition [9] now we use the newly built copy of Python to help us :) -- to do this we are going to ask for root permission, so you will be asked for a password. This is the "root" password, which is probably the password that was first supplied when the computer was installed, meaning the password for the first user created, but it stayed the same if that first user changed their password since that time. %sudo ./python.exe setup.py install [10] copy the executable into the right place (and lose the unfashionable ".exe"): %sudo mv python.exe /usr/local/bin/ [11] copy the standard modules into place: %sudo mv Lib /usr/local/lib/python2.1 [12] now we change the owner to root, and the group to wheel: %sudo chown -R root /usr/local/lib/python2.1 %sudo chgrp -R wheel /usr/local/lib/python2.1/Lib/ [13] now we have to setup a couple of things in your environment. You need a folder called tcsh inside another folder called init. You can do this on the command line like this (note: this should warn you before overwriting the directory, but don't blame me if your system is configured to let you trash things and you do it by typing in something on the command line that someone who admits willingly to being fairly ignorant in these matters said to type): %mkdir ~/Library/init/tcsh [14] No you are going to create a file so Python can find what it needs to run. AGAIN I am assuming here that you do not have a file called rc.mine already. If you do, you can just edit it and save yourself some grief by not overwriting this VERY IMPORTANT file. If you want to create the file via the command line anyways, type: cat > ~/Library/init/tcsh/rc.mine [15] you should have a blank line staring back at you, either in Terminal, or in TextEdit or something similar. Type the following lines, they should probably be typed as two continuous lines, each starting with "setenv", but maybe it is okay if it splits, I honestly don't know. setenv PYTHONPATH /usr/local/lib/python2.1/Lib/:/usr/local/lib/python2.1/site-packages/ setenv PYTHONHOME /usr/local/lib/python2.1/Lib/:/usr/local/lib/python2.1/site-packages/ [16] if you are typing this into the terminal, you need to type "control-D" at an empty line. [17] quit out of the Terminal application and start it again (this forces the file you just created to get loaded). Now you should be able to type the following and get the Python interactive interpreter to run! %python >From here on out it should be just like in the Unix-centric documentation that you see all over the place. Happy python-ing! Bob Savage From bobsavage@mac.com Thu May 17 06:34:03 2001 From: bobsavage@mac.com (Bob Savage) Date: Wed, 16 May 2001 22:34:03 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message-ID: Shoot! I noticed a problem already! > [10] copy the executable into the right place (and lose the unfashionable > ".exe"): > > %sudo mv python.exe /usr/local/bin/ > this should say: %sudo mv python.exe /usr/local/bin/python and I forgot to change the owner/group on the executable %sudo chown root /usr/local/bin/python %sudo chgrp wheel /usr/local/bin/python sorry for the confusion! Bob From richard@richardgordon.net Thu May 17 13:17:07 2001 From: richard@richardgordon.net (Richard Gordon) Date: Thu, 17 May 2001 08:17:07 -0400 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: References: Message-ID: At 10:19 PM -0700 5/16/01, Bob Savage wrote: >%sudo ./python.exe setup.py install > >[10] copy the executable into the right place (and lose the unfashionable >".exe"): > >%sudo mv python.exe /usr/local/bin/ > >[11] copy the standard modules into place: > >%sudo mv Lib /usr/local/lib/python2.1 > hi Bob Out of curiosity, why not just use 'make install' (or 'make altinstall if you want to keep an older version intact)? I just built 2.1 on mkLinux and it went fine. You wouldn't have to move anything around then. Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From tom@othermedia.com Thu May 17 17:54:39 2001 From: tom@othermedia.com (tom smith) Date: Thu, 17 May 2001 17:54:39 +0100 Subject: [Pythonmac-SIG] Installing Carbon MacPython problems In-Reply-To: Message-ID: Hi I just tried installing 2.1 (not on the root volume) and the ConfigureCarbonThingy booted up and crashed. I tried to run it again and it crashed again. So I then trashed any prefs in ~Library/Prefs/Python and /Library/Prefs/Python and installed again... But this time the IDE didn't get installed. Only two thirds of the bits I need got installed. Anyone know how to solve this Thanks tom From jack@oratrix.nl Thu May 17 20:44:56 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 17 May 2001 21:44:56 +0200 Subject: [Pythonmac-SIG] Installing Carbon MacPython problems In-Reply-To: Message by tom smith , Thu, 17 May 2001 17:54:39 +0100 , Message-ID: <20010517194502.219F4E9391@oratrix.oratrix.nl> Recently, tom smith said: > Hi > > I just tried installing 2.1 (not on the root volume) and the > ConfigureCarbonThingy booted up and crashed. I tried to run it again and it > crashed again. > > So I then trashed any prefs in ~Library/Prefs/Python and > /Library/Prefs/Python and installed again... > > But this time the IDE didn't get installed. Only two thirds of the bits I > need got installed. The IDE doesn't get installed until you run ConfigurePythonCarbon. So, after the second install (where the automatic execution of ConfigurePythonCarbon again failed, I assume) you should again run ConfigurePythonCarbon. If this fails again I would be very interested in seeing your Apple System Profiler output. The other thing I would like to know is whether you have a multiprocessor. There's one other person who has the problem that ConfigurePythonCarbon always fails, and my current guess is that the Python I/O library somehow breaks on an OSX multiprocessor. Oh yes, I would also like an "ls -l /Library/CFMSupport" output from a terminal window. -- 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 bobsavage@mac.com Thu May 17 21:00:15 2001 From: bobsavage@mac.com (Bob Savage) Date: Thu, 17 May 2001 13:00:15 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message-ID: Ah! that would be because I didn't know what I was doing. Thanks for the advice, Richard! Actually you wouldn't believe the horrible mess of things I made the first few times I tried to install. Now I have learned how to properly set environment variables under tcsh and that you can "chown" recursively (the first two times I did each level of the hierarchy separately!) So for people as clueless as I am (there has to be at least one out there), I did everything the same up through step [9], but I noticed that "make" (step [8]) was complaining about a folder not being present that didn't get created until step [9] so I did this: make clean make sudo make install sudo .python.exe setup.py install You could have just make the directories yourself, and not have to go through that whole process twice, but hey, this is my 6th time installing in just three days, so consider yourself lucky! At this point you should be able to skip all of the steps, except the python executable still has the ".exe" ending, not a showstopper, but if you want to get rid of it you can type sudo mv /usr/local/bin/python.exe /usr/local/bin/python cheers, Bob Savage -----Original Message----- From: Richard Gordon [mailto:richard@richardgordon.net] Sent: Thursday, May 17, 2001 5:17 AM At 10:19 PM -0700 5/16/01, Bob Savage wrote: >[10] copy the executable into the right place (and lose the unfashionable >".exe"): > >%sudo mv python.exe /usr/local/bin/ > >[11] copy the standard modules into place: > >%sudo mv Lib /usr/local/lib/python2.1 hi Bob Out of curiosity, why not just use 'make install' (or 'make altinstall if you want to keep an older version intact)? I just built 2.1 on mkLinux and it went fine. You wouldn't have to move anything around then. Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From jack@oratrix.nl Thu May 17 22:43:48 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 17 May 2001 23:43:48 +0200 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message by "Bob Savage" , Thu, 17 May 2001 13:00:15 -0700 , Message-ID: <20010517214353.6EC02E9391@oratrix.oratrix.nl> Bob, two minor issues: - Why do you do the chown in the first place? There's no reason Python can't be owned by you (the installer). Making things root-owned without good reason to do so is a bit of a nono in unix-circles. - In stead of the sudo mv /usr/local/bin/python.exe /usr/local/bin/python it might be better to do ln -s /usr/local/bin/python /usr/local/bin/python.exe That way, if you install a newer build later the "python" executable will refer to the new one automatically. Oh yes, and I think there's no reason for the sudo: if you're an administrator you should be able to write in /usr/local/bin yourself. All in all I'm very happy with the work you're putting in this document! I hope you'll be putting it up on the web, or else pass it to me so I can put it up on the macpython site. It should be helpful to a lot of people who come to OSX from a Mac background. -- 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 sburr@home.com Fri May 18 04:34:10 2001 From: sburr@home.com (Steven Burr) Date: Thu, 17 May 2001 20:34:10 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: <20010517214353.6EC02E9391@oratrix.oratrix.nl> Message-ID: <20010518033315.IOAH18489.femail17.sdc1.sfba.home.com@localhost> On Thursday, May 17, 2001, at 02:43 PM, Jack Jansen wrote: > Oh yes, and I think there's > no reason for the sudo: if you're an administrator you should be able > to write in /usr/local/bin yourself. Apparently not (unless I'm misinterpreting the following, which is entirely possible): > $ ls -lF /usr/local > total 0 > drwxr-xr-x 18 root wheel 568 May 8 21:04 bin/ > [snip] > > $ touch /usr/local/bin/test.txt > touch: /usr/local/bin/test.txt: Permission denied Root appears to own /usr/local/bin and to have exclusive write permission. From bobsavage@mac.com Fri May 18 07:36:55 2001 From: bobsavage@mac.com (Bob Savage) Date: Thu, 17 May 2001 23:36:55 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: <20010517214353.6EC02E9391@oratrix.oratrix.nl> Message-ID: Great feedback folks, keep pointing out those errors. I don't want to post another version to the list if there are still things to fix, so I'll wait a couple days, but I'll make the updated version available on my Stanford website as soon as I can (there's some problem with the server, so I'll have to do it tomorrow): http://www.stanford.edu/~bsavage/ I'm leaving here in a couple of months however (I'm leaving Silicon Valley for Nashville in July, "Hello, culture shock!"), so a more permanent home for it might be appropriate. on 5/17/01 2:43 PM, Jack Jansen wrote: > - Why do you do the chown in the first place? There's no reason Python > can't be owned by you (the installer). Making things root-owned > without good reason to do so is a bit of a nono in unix-circles. Hmmm... that may be true, but I changed the guide to use the "make install" command so I don't have to do the move (or the chown) anymore, besides I don't think the way I did it copied everything. However to use "make install" I need to sudo. > - Instead of the > sudo mv /usr/local/bin/python.exe /usr/local/bin/python > it might be better to do > ln -s /usr/local/bin/python /usr/local/bin/python.exe > That way, if you install a newer build later the "python" executable > will refer to the new one automatically. That is an excellent idea! I added it to the file. > Oh yes, and I think there's > no reason for the sudo: if you're an administrator you should be able > to write in /usr/local/bin yourself. No, I think you need to be root: [localhost:/usr/local] bsavage% mkdir ./test mkdir: ./test: Permission denied on 5/17/01 10:42 AM, Chris Barker wrote: > Also the "make install" option is certainly one worth considering. Yeah, I fixed that :blush: > If you need to do some stuff as root, "sudo" works, but then you have to > typw it for each command. OS-X should have the "su" command. No, it doesn't work: [localhost:/usr/local] bsavage% su Password: Sorry The command is there, but root doesn't have login privileges by default. This is part of the security precautions. I figure people who know what su is and enable it themselves know to use that, but I'm not going to tell people to enable root login (too much trouble and I don't want to be the one to encourage people to disable a security measure, especially when there is a reasonable alternative -- it works, just a little extra typing). >> %sudo chown -R root /usr/local/lib/python2.1 >> %sudo chgrp -R wheel /usr/local/lib/python2.1/Lib/ > > hmm. this is interesting. If this files were created as root, then they > should already be owned bu root, and no one else is allowed to write to > /usr/local anyway. Actually the way I did it was to create them as bsavage and then move them as root (via sudo). This was the wrong way to do it. I fixed the guide to use "make install". >> >> cat > ~/Library/init/tcsh/rc.mine >> Actually I don't seem to need to do this anymore since I used the "make install" command. I guess it does something I don't understand. >> %python >> >>> From here on out it should be just like in the Unix-centric documentation > > Question: does readline work here, i.e. can you hit the up arrow to get > you previous command(s), and then edit them and run them again? That > really makes using the interpreter a practical thing to do, unlike the > MacPython interpreter. I love readline, but it doesn't work. If anyone knows how to enable it (or anything else I didn't do right -- that thread error is troublesome -- just speak up. I'll fix the guide and then no one will be without again :) Another use to having the interpreter (well, actually I think it is damned cool regardless) is that when people first start out they can learn with it and use all those goofy unix scripts they start you out on in the books. At least they did in my day (the Lutz tome), I see a new book every day on learning Python in the bookstore. > execfile("pythonfile.py") this lets you run a python script and get the > command prompt back when it is done. Cool. There used to be this great feature in Terminal which let you create a shell command as a "service" which was then accessible from any Cocoa app. I used this a lot in Public Beta to insert dates and change the case of text. Unfortunately not only was there no support in the Finder (a Carbon app), but they also shut the feature off because of some problems in the final release. I hope they bring it back, because then python scripts can be available **inside other programs**! Anyway, keep those suggestions coming! Bob From jack@oratrix.nl Fri May 18 09:44:04 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 18 May 2001 10:44:04 +0200 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message by Bob Savage , Thu, 17 May 2001 23:36:55 -0700 , Message-ID: <20010518084404.B6401303181@snelboot.oratrix.nl> Oops, you're both (Steven and Bob) right: by default /usr/local/bin is mode 755. So I think that what I did is change it to 775 myself before doing the install ("I've been a unix-head for 24 years. I know better than Apple":-). Same for /usr/local itself. (and, rereading that and seeing the blatant unixisms: for 775 read rwxrwxr-x, for 755 read rwxr-xr-x). -- 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 tony@adam12.metanet.com Fri May 18 17:34:32 2001 From: tony@adam12.metanet.com (Tony Lownds) Date: Fri, 18 May 2001 09:34:32 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: References: Message-ID: > >> - Instead of the >> sudo mv /usr/local/bin/python.exe /usr/local/bin/python >> it might be better to do >> ln -s /usr/local/bin/python /usr/local/bin/python.exe >> That way, if you install a newer build later the "python" executable >> will refer to the new one automatically. > >That is an excellent idea! I added it to the file. Wouldn't it be nice if the python makefile removed the .exe for you? ./configure --with-build-suffix=.exe anyone? Actually I think the configure script could be trained to add both --with-dyld and --with-suffix for you. > >> %python > >> > >>> From here on out it should be just like in the Unix-centric documentation > > > > Question: does readline work here, i.e. can you hit the up arrow to get > > you previous command(s), and then edit them and run them again? That > > really makes using the interpreter a practical thing to do, unlike the > > MacPython interpreter. > >I love readline, but it doesn't work. If anyone knows how to enable it (or >anything else I didn't do right -- that thread error is troublesome -- just >speak up. I'll fix the guide and then no one will be without again :) > I got readline + 2.1 working last night (the binary is on http://tony.lownds.com/macosx/). Here are the steps, roughly: 1. download readline 4.2 2. configure; make 3. ranlib lib*.a 4. make install Meanwhile, in Python-2.1 ./configure --with-dyld --with-suffix=.x make joe Modules/Setup uncomment the readline line, and remove -ltermcap: #BEFORE: #readline readline.c -lreadline -ltermcap #AFTER: readline readline.c -lreadline make -Tony From owen@astro.washington.edu Fri May 18 17:41:53 2001 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 18 May 2001 09:41:53 -0700 Subject: [Pythonmac-SIG] Question about updating Tkinter Message-ID: Tk 8.3.3 has recently come out, and I wonder if anybody knows how/if it's possible to upgrade Tkinter to use it (MacPython 2.1, Mac OS 9.1)? Not that I have to have it "right now", but I'm curious. -- Russell From ryanr@ezlink.com Sat May 19 05:57:27 2001 From: ryanr@ezlink.com (ryanr@ezlink.com) Date: Fri, 18 May 2001 22:57:27 -0600 Subject: [Pythonmac-SIG] test_re Message-ID: <20010519045729.CENH17912.femail22.sdc1.sfba.home.com@localhost> Hi, After configuring with env OPT='-O3 -traditional-cpp' ./configure --with-dyld --with- suffix=.exe when I do a ``make test'' after compiling, the last line of output is: test_re make: *** [test] Segmentation fault So when I do a ./python.exe ./Lib/test/test_re.py I get Running tests on re.search and re.match Running tests on re.sub Running tests on symbolic references Running tests on re.subn Running tests on re.split Running tests on re.findall Running tests on re.match Running tests on re.escape Pickling a RegexObject instance Test engine limitations Segmentation fault Does anyone know what I might be doing that's wrong? Thank you, Richard Ryan From bobsavage@mac.com Sat May 19 07:41:03 2001 From: bobsavage@mac.com (Bob Savage) Date: Fri, 18 May 2001 23:41:03 -0700 Subject: [Pythonmac-SIG] test_re In-Reply-To: <20010519045729.CENH17912.femail22.sdc1.sfba.home.com@localhost> Message-ID: on 5/18/01 9:57 PM, ryanr@ezlink.com wrote: > > test_re > make: *** [test] Segmentation fault > Yes, that's mentioned in the readme as the default allocation is too small or something. I have no idea how to fix that, but the impression I got was that it had something to do with the testing circumstances only. Perhaps you should try doing something with the re module and see if it works, and respond to the list with the results. Bob From bobsavage@mac.com Sat May 19 08:13:55 2001 From: bobsavage@mac.com (Bob Savage) Date: Sat, 19 May 2001 00:13:55 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message-ID: > I got readline + 2.1 working last night Tony, that is very cool. Thanks for both the pointers on the process and the binary! I have some questions though. First, after you edit the readline bit in Modules/Setup, do you type "make" again? I did it that way and it seemed to work, but I was wondering if the first make (see below) was mistakenly added, or if the final make was supposed to be "make install" (which I did as well). Unfortunately I don't know how to use "make" so I'm reduced to blindly typing in the commands I'm told to type like some kind of trained monkey. :| (For question two jump down to the end)... > > Meanwhile, in Python-2.1 > > ./configure --with-dyld --with-suffix=.x > make > joe Modules/Setup > uncomment the readline line, and remove -ltermcap: > > #BEFORE: > #readline readline.c -lreadline -ltermcap > > #AFTER: > readline readline.c -lreadline > > make > > > -Tony Okay, question two: you don't mention running "setup.py install". I did a little experiment to see what the difference was between different ways of doing it. I removed my install, and then installed your binaries and did an "ls -R" and saved it to "lownds.txt". Then I removed your install, and followed your instructions and did "ls -R" and saved it to "readline1.txt". Then I did the extra step of running the "setup.py" and "ls -R" to "readline2.txt". Here are my results. The difference between your binary and my install following your directions is the presence of PIL as you mentioned in your email, but there seems to be some additional things that "setup.py" gives you: [localhost:~/install ls] bsavage% diff readline1.txt readline2.txt 1030a1031,1074 > _codecs.so > _locale.so > _socket.so > _symtable.so > _testcapi.so > _weakref.so > array.so > audioop.so > binascii.so > bsddb.so > cPickle.so > cStringIO.so > cmath.so > crypt.so > dbm.so > errno.so > fcntl.so > fpectl.so > grp.so > imageop.so > math.so > md5.so > mmap.so > new.so > nis.so > operator.so > parser.so > pcre.so > pwd.so > readline.so > regex.so > resource.so > rgbimg.so > rotor.so > select.so > sha.so > strop.so > struct.so > syslog.so > termios.so > time.so > timing.so > unicodedata.so > xreadlines.so Because this includes cPickle and cStringIO I think these are the compiled C versions of certain modules that get swapped in for speed when available. So you might want to install those. Unfortunately I don't think I can install your binary (to get PIL) and then "setup.py" to get the compiled modules -- I'm spacing the error message at the moment, but I got one. thanks, again for readline! Bob From jack@oratrix.nl Sat May 19 13:03:01 2001 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 19 May 2001 14:03:01 +0200 Subject: [Pythonmac-SIG] test_re In-Reply-To: Message by ryanr@ezlink.com , Fri, 18 May 2001 22:57:27 -0600 , <20010519045729.CENH17912.femail22.sdc1.sfba.home.com@localhost> Message-ID: <20010519120306.96512E267B@oratrix.oratrix.nl> File a bug report at python.sourceforge.org. I think this is the stack problem again: one of the tests checks to see whether re gracefully recovers from running out of stack. On OSX it doesn't:-) I had the same problem with 2.0 in MacPython and /F added some code to make things behave better. Something similar should probably be done for MacOSX, apparently its stack model is a bit different from run-of-the-mill unix. -- 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 richard@richardgordon.net Sat May 19 19:50:25 2001 From: richard@richardgordon.net (Richard Gordon) Date: Sat, 19 May 2001 14:50:25 -0400 Subject: [Pythonmac-SIG] Question about updating Tkinter In-Reply-To: References: Message-ID: At 9:41 AM -0700 5/18/01, Russell E Owen wrote: >Tk 8.3.3 has recently come out, and I wonder if anybody knows how/if >it's possible to upgrade Tkinter to use it (MacPython 2.1, Mac OS >9.1)? Not that I have to have it "right now", but I'm curious. I don't know for sure, but it seems to me that you'd need to have the development libraries for both python and tcl/tk and link to them in order to recompile python with a new version. Once you had that sorted out, it might be that _tkinter.c would take care of things on its own. I think that I could manage this on my own under *nix, but I have yet to figure out MPW and do not care to dabble in C to begin with, so Code Warrior isn't a compelling purchase item. Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From craig@osa.att.ne.jp Sun May 20 01:25:55 2001 From: craig@osa.att.ne.jp (Craig Hagerman) Date: Sun, 20 May 2001 09:25:55 +0900 Subject: [Pythonmac-SIG] Cut & paste in Tkinter? Message-ID: Hi, Is it possible to cut and paste from some other application into a Tkinter-Python program? (ie Is it possible to use the Macintosh clipboard?) Craig Hagerman From sdm7g@Virginia.EDU Sun May 20 01:41:14 2001 From: sdm7g@Virginia.EDU (Steven D. Majewski) Date: Sat, 19 May 2001 20:41:14 -0400 (EDT) Subject: [Pythonmac-SIG] test_re In-Reply-To: Message-ID: On Fri, 18 May 2001, Bob Savage wrote: > on 5/18/01 9:57 PM, ryanr@ezlink.com wrote: > > > > test_re > > make: *** [test] Segmentation fault > > > > Yes, that's mentioned in the readme as the default allocation is too small > or something. I have no idea how to fix that, but the impression I got was > that it had something to do with the testing circumstances only. Perhaps you > should try doing something with the re module and see if it works, and > respond to the list with the results. You can type, in tcsh: "limit stack 4096" or in sh/bash : "ulimit -s 4096" To increase the stack resource limit. But Jack is probably right that it's a bug that it segfaults rather than dieing more gracefully. -- Steve Majewski From delza@alliances.org Sun May 20 04:13:14 2001 From: delza@alliances.org (Dethe Elza) Date: Sat, 19 May 2001 20:13:14 -0700 Subject: [Pythonmac-SIG] Pygame Message-ID: Has anyone compiled pygame for the Mac? The SDL library that it builds on comes packaged for the Mac, but I don't see a Mac-ready distribution of Pygame itself. TIA -- Dethe Elza Chief Mad Scientist Burning Tiger Technologies From tony.mcdonald@ncl.ac.uk Sun May 20 10:14:05 2001 From: tony.mcdonald@ncl.ac.uk (Tony McDonald) Date: Sun, 20 May 2001 10:14:05 +0100 Subject: [Pythonmac-SIG] Problems with 'multiple definitions' Message-ID: Hi, I'm working with python2.1 and MacOS X and compiling up packages such as PyXML and 4Suite (although this happens with packages such as MySQLdb too). I use the standard procedure to build and install these packages, ie % python2.1 setup.py install But, for example, when I test out 4Suite; % cd /usr/local/doc/4Suite-0.11/test_suite/4XSLT % python2.1 basic_test.py I get this; dyld: python2.1 multiple definitions of symbol _XML_DefaultCurrent python2.1 definition of _XML_DefaultCurrent /usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition of _XML_DefaultCurrent I've managed to install MySQLdb by stripping out an offending symbol from libmysqlclient.a, but surely there's a cleaner way of doing this? Is there some compiler flag I can set that gets around this? The python is a pre-compiled version from http://tony.lownds.com/macosx/ any help would be appreciated, this effectively stops me using any compiled modules under MacOS X (which is, in almost all other respects, excellent!). I guess this must be a python thing, because I don't get any problems with dyld from other unix programs I've compiled up. TIA tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope From dano@brightfire.com Sun May 20 18:22:21 2001 From: dano@brightfire.com (Daniel Lord) Date: Sun, 20 May 2001 10:22:21 -0700 Subject: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... In-Reply-To: Message-ID: <200105201722.NAA04648@warspite.cnchost.com> --Apple-Mail-1239993967-1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; format=flowed; charset=us-ascii The fact that you used the pre-compiled version is the tip off. that means you never learned about the compile flag adjustments you need to make. I assume the same problem is occurring for you. Per the recommendation in the README file distributed with the Python-2.1 source straight from python.org, I did this: ./configure OPT='-g -traditional-cpp' --with-dyld Afterwards the make, make install cycle worked fine although I got some warnings about improper prototypes. Python 2.1 runs perfectly; although I hear some tests fail due to stack size limitation but that appears to be a shell default problem, not a python problem. so the compiler command line options might need to be: '-g -traditional-cpp' --with-dyld Haven't tried it myself on anything but the Python 2,.1 source though. On Sunday, May 20, 2001, at 09:01 AM, pythonmac-sig-request@python.org wrote: > I get this; > > dyld: python2.1 multiple definitions of symbol _XML_DefaultCurrent > python2.1 definition of _XML_DefaultCurrent > /usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition > of _XML_DefaultCurrent > Is there some compiler flag I can set that gets around this? > > The python is a pre-compiled version from http://tony.lownds.com/macosx/ --Apple-Mail-1239993967-1 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=us-ascii The fact that you used the pre-compiled version is the tip off. that means you never learned about the compile flag adjustments you need to make. I assume the same problem is occurring for you. Per the recommendation in the README file distributed with the Python-2.1 source straight from python.org, I did this: ./configure OPT='-g -traditional-cpp' --with-dyld Afterwards the make, make install cycle worked fine although I got some warnings about improper prototypes. Python 2.1 runs perfectly; although I hear some tests fail due to stack size limitation but that appears to be a shell default problem, not a python problem. so the compiler command line options might need to be: '-g -traditional-cpp' --with-dyld Haven't tried it myself on anything but the Python 2,.1 source though. On Sunday, May 20, 2001, at 09:01 AM, pythonmac-sig-request@python.org wrote: I get this; dyld: python2.1 multiple definitions of symbol _XML_DefaultCurrent python2.1 definition of _XML_DefaultCurrent /usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition of _XML_DefaultCurrent0000,0000,DEB7 Is there some compiler flag I can set that gets around this? The python is a pre-compiled version from http://tony.lownds.com/macosx/ --Apple-Mail-1239993967-1-- From jwblist@olympus.net Sun May 20 21:53:46 2001 From: jwblist@olympus.net (John W Baxter) Date: Sun, 20 May 2001 13:53:46 -0700 Subject: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... In-Reply-To: <200105201722.NAA04648@warspite.cnchost.com> References: <200105201722.NAA04648@warspite.cnchost.com> Message-ID: At 10:22 -0700 5/20/2001, Daniel Lord wrote: >Per the recommendation in the README file distributed with the Python-2.1 >source straight from python.org, I did this: > >./configure OPT='-g -traditional-cpp' --with-dyld That README is somewhat dated (actually, now that the Mac OS X Public Beta has "expired," the README is quite dated). Here's the way the Mac OS X comment starts out: Mac OS X: You need to add the "-traditional-cpp" option to the compiler command line for the Mac OS X Public Beta. This is appearantly[sic] a bug in the default pre-processor, and is expected not to be a problem with future versions. I elected to believe that the expectation at the end of the second quoted sentence was realized, and I found Python built just fine without the "traditional-cpp" stuff. Once I increased the stack space with limit stack 4096, the tests ran as expected, with what I think were the right few failed tests. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From tony.mcdonald@ncl.ac.uk Mon May 21 08:17:25 2001 From: tony.mcdonald@ncl.ac.uk (Tony McDonald) Date: Mon, 21 May 2001 08:17:25 +0100 Subject: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... In-Reply-To: <200105201722.NAA04648@warspite.cnchost.com> Message-ID: On 20/5/01 6:22 pm, "Daniel Lord" wrote: > The fact that you used the pre-compiled version is the tip off. that > means you never learned about the compile flag adjustments you need to > make. > I assume the same problem is occurring for you. > Unfortunately :( I did know about the compile flags and tried them out a while back. I had no joy then ... > Per the recommendation in the README file distributed with the > Python-2.1 source straight from python.org, I did this: > > ./configure OPT='-g -traditional-cpp' --with-dyld > > Afterwards the make, make install cycle worked fine although I got some > warnings about improper prototypes. > Python 2.1 runs perfectly; although I hear some tests fail due to stack > size limitation but that appears to be a shell default problem, not a > python problem. > Heard about the stack problems and fixing them through the tchs 'ulimit' ? command - but thanks for the info. My setup was actually ./configure --with-dyld --with-suffix=.exe 'OPT=-g -traditional-cpp' Otherwise I'd get a problem at the end with python trying to overwrite a directory (the case-sensitivity of the file structure problem). > so the compiler command line options might need to be: '-g > -traditional-cpp' --with-dyld > > Haven't tried it myself on anything but the Python 2,.1 source though. > > ...and this is where the fun begins :( I've built up the python2.1 distribution with the above configure line and installed it. I thought that distutils would use the compiler flags from the python Makefile. After the python setup.py install Incantation for PyXML-0.6.5 everything compiles and installs ok. Then I 'cd' to the ...lib/_xmlplus/parsers directory. Python 2.1 (#6, 05/20/01, 22:45:35) [GCC Apple DevKit-based CPP 6.0alpha] on darwin1 Type "copyright", "credits" or "license" for more information. import readline # builtin >>> import sgmlop import sgmlop # dynamically loaded from sgmlop.so >>> import pyexpat dyld: python multiple definitions of symbol _main python definition of _main pyexpat.so definition of _main ...sigh. (I use the pyexpat example 'cos it's easier to do than the 4Suite one). Thanks for the advice Daniel, but I'm really at a loss here :( Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope From jack@oratrix.nl Mon May 21 09:23:49 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 21 May 2001 10:23:49 +0200 Subject: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... In-Reply-To: Message by Tony McDonald , Mon, 21 May 2001 08:17:25 +0100 , Message-ID: <20010521082350.98231303181@snelboot.oratrix.nl> The MacOSX dynamic loader is extremely picky about symbols, and indeed it doesn't want a multiply defined symbol anywhere. So, in your first problem (the _XML_DefaultCurrent one) my guess is that you have a dynamic module that is already linked statically. The easiest way to find the culprit is to use nm to find who's defining it during the normal Python build. The build creates a couple of .a libraries and the proceeds to link these together, if you run nm | grep _XML_DefaultCurrent on the libraries you should find the object file defining it. The second problem is a bit strange pyexpat.so seems to have a main program. It shouldn't, Python already has a main program. But: on most platforms this wouldn't be a problem at all, so it may well be that the way pyexpat is built always does this. Is this the pyexpat that's included with Python 2.1, or does it come from a different place? -- 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 tony@adam12.metanet.com Sun May 20 21:12:55 2001 From: tony@adam12.metanet.com (Tony Lownds) Date: Sun, 20 May 2001 13:12:55 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: References: Message-ID: At 12:13 AM -0700 5/19/01, Bob Savage wrote: >First, after you edit the readline bit in Modules/Setup, do you type "make" >again? I did it that way and it seemed to work, but I was wondering if the >first make (see below) was mistakenly added, or if the final make was >supposed to be "make install" (which I did as well). Unfortunately I don't >know how to use "make" so I'm reduced to blindly typing in the commands I'm >told to type like some kind of trained monkey. :| Yep, I typed "make" twice, on purpose. Actually (as someone pointed out in pvt. email) if you install readline before compiling python the readline module will be made automatically. Typing make the first time will make python and all the modules it can automatically. If you need to specify library locations before a module will build then the README says to edit Modules/Setup and run make again. >Okay, question two: you don't mention running "setup.py install". I did a >little experiment to see what the difference was between different ways of >doing it. > FYI I actually did "sudo make install" to install. >The difference between your binary and my install following your directions >is the presence of PIL as you mentioned in your email, but there seems to be >some additional things that "setup.py" gives you: > Interesting, I do have all of those files on my computer in the /usr/local/lib/python2.1/lib-dynload folder. Where are those additional files? If you did ls -R /the duplicates may come from the build process, in the Python2.1/build/lib./ directory. -Tony From tony@adam12.metanet.com Sun May 20 21:12:55 2001 From: tony@adam12.metanet.com (Tony Lownds) Date: Sun, 20 May 2001 13:12:55 -0700 Subject: [Pythonmac-SIG] Problems with 'multiple definitions' In-Reply-To: References: Message-ID: Hi, The pre-compiled python on my page has the pyexpat module built-in - that may explain why this '_XML_DefaultCurrent' symbol is clashing. Maybe it's just me but it seems that the dynamic linking on Mac OS X is much stricter about multiple definitions symbols than other UNIXes. As for compiler flags, man ld shows an "-m" flag: -m Don't treat multiply defined symbols as a hard error; instead, simply print a warning. The first such symbol is used for linking; its value is used for the symbol in the symbol table. The other sym- bols by the same name may be used in the resulting output file through local references. This can still produce a resulting output file that is in error. This flag's use is strongly discouraged! but I have no idea if that would help. -Tony At 10:14 AM +0100 5/20/01, Tony McDonald wrote: >Hi, >I'm working with python2.1 and MacOS X and compiling up packages such as >PyXML and 4Suite (although this happens with packages such as MySQLdb >too). > >I use the standard procedure to build and install these packages, ie > >% python2.1 setup.py install > >But, for example, when I test out 4Suite; > >% cd /usr/local/doc/4Suite-0.11/test_suite/4XSLT >% python2.1 basic_test.py > >I get this; > >dyld: python2.1 multiple definitions of symbol _XML_DefaultCurrent >python2.1 definition of _XML_DefaultCurrent >/usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition >of _XML_DefaultCurrent > > >I've managed to install MySQLdb by stripping out an offending symbol >from libmysqlclient.a, but surely there's a cleaner way of doing this? >Is there some compiler flag I can set that gets around this? > >The python is a pre-compiled version from http://tony.lownds.com/macosx/ > >any help would be appreciated, this effectively stops me using any >compiled modules under MacOS X (which is, in almost all other respects, >excellent!). > >I guess this must be a python thing, because I don't get any problems with >dyld from other unix programs I've compiled up. > >TIA >tone >-- >Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ >The Medical School, Newcastle University Tel: +44 191 243 6140 >A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From bobsavage@mac.com Tue May 22 01:37:42 2001 From: bobsavage@mac.com (Bob Savage) Date: Mon, 21 May 2001 17:37:42 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message-ID: on 5/20/01 1:12 PM, Tony Lownds wrote: > Yep, I typed "make" twice, on purpose. Actually (as someone pointed > out in pvt. email) if you install readline before compiling python > the readline module will be made automatically. Okay so I'll tell people to build/install readline first, and use one make, unless something else comes up. > > FYI I actually did "sudo make install" to install. > Okay, so I'll keep that for sure. > > Interesting, I do have all of those files on my computer in the > /usr/local/lib/python2.1/lib-dynload folder. Where are those > additional files? If you did ls -R /the duplicates may come from the > build process, in the Python2.1/build/lib./ directory. > I'm going to reinstall everything all over again, and see if I can figure this out. In the mean time I carefully examined the difference between my first install, and the binaries you supplied. Notes follow: [1] You have this directory, I don't seem to have anything comparable: /usr/local/lib/python2.1/Lib/plat-darwin1: FCNTL.py FCNTL.pyc FCNTL.pyo IN.py IN.pyc IN.pyo SOCKET.py SOCKET.pyc SOCKET.pyo TERMIOS.py TERMIOS.pyc TERMIOS.pyo regen [2] You have many files ending in ".so" in the directory /usr/local/lib/python2.1/Lib/lib-dynload In my install, they ".so" files were in a directory called /usr/local/lib/python2.1/site-packages and I noticed that you have one extra one: zlib.so Do you know what enabled that? [3] I think it is a minor thing, but your method ended up with lots of ".pyc" and ".pyo" files. I know the reason I don't have the ".pyc" files is because I didn't run all of the tests (I blew it offer after the regex test failed -- I'll include the workaround that was mentioned earlier on the list next time I revise the guide). But I am unclear on what creates a ".pyo" file. The Beazley book says they are only used if the interpreter is run with the "-o" option. I'm also going to put the URL to your website at the top, because aside from the ease of simply installing the work you already did, you also have PIL and you mention XML (there doesn't seem to be any difference in the XML directories, so I assume this means it is literally "built-in" to the executable?) Let me know if you would prefer not to be linked before I do it and you have scores of Python / Mac fans overwhelming your server! all the best, Bob Savage From tony@adam12.metanet.com Tue May 22 03:44:19 2001 From: tony@adam12.metanet.com (Tony Lownds) Date: Mon, 21 May 2001 19:44:19 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: References: Message-ID: At 5:37 PM -0700 5/21/01, Bob Savage wrote: > >zlib.so > >Do you know what enabled that? Hmm, that was included automatically by configure. The current file on my server was the second make-from-scratch; at that point zlib was installed, as PIL needed it. >[3] I think it is a minor thing, but your method ended up with lots of >".pyc" and ".pyo" files. I know the reason I don't have the ".pyc" files is >because I didn't run all of the tests (I blew it offer after the regex test >failed -- I'll include the workaround that was mentioned earlier on the list >next time I revise the guide). Part of make install actually goes out to the Lib directory and systematically compiles each .py file into .pyc and .pyo files. >But I am unclear on what creates a ".pyo" >file. The Beazley book says they are only used if the interpreter is run >with the "-o" option. They are made whenever python is in -O mode just like .pyc files. >I'm also going to put the URL to your website at the top, because aside from >the ease of simply installing the work you already did, you also have PIL >and you mention XML (there doesn't seem to be any difference in the XML >directories, so I assume this means it is literally "built-in" to the >executable?) Yep, it is truly built-in. >Let me know if you would prefer not to be linked before I do it >and you have scores of Python / Mac fans overwhelming your server! Go ahead.... if the bandwidth requirements ever jump beyond what I can handle I can move the binary to sourceforge. -Tony From richard@richardgordon.net Tue May 22 03:54:03 2001 From: richard@richardgordon.net (Richard Gordon) Date: Mon, 21 May 2001 22:54:03 -0400 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: References: Message-ID: At 5:37 PM -0700 5/21/01, Bob Savage wrote: >[3] I think it is a minor thing, but your method ended up with lots of >".pyc" and ".pyo" files. I know the reason I don't have the ".pyc" files is >because I didn't run all of the tests (I blew it offer after the regex test >failed -- I'll include the workaround that was mentioned earlier on the list >next time I revise the guide). But I am unclear on what creates a ".pyo" >file. The Beazley book says they are only used if the interpreter is run >with the "-o" option. hi Bob A small point, but it's actually "-O" rather than "-o" and you generally wind up with all of the assorted .pyo files by running python -O compileall.py [defaults to path, but you can specify otherwise] You can emulate this in normal Mac Python by using the option key while launching compileall.py and checking the option to optimize bytecode. But I frankly haven't seen much difference using this vs. plain old .pyc on any of several platforms- I wonder if it becomes significant after you cross some threshold for program length or something? Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From bobsavage@mac.com Tue May 22 04:07:14 2001 From: bobsavage@mac.com (Bob Savage) Date: Mon, 21 May 2001 20:07:14 -0700 Subject: [Pythonmac-SIG] Guide to installing Unix-Python on MacOS X In-Reply-To: Message-ID: on 5/21/01 7:54 PM, Richard Gordon wrote: > But I frankly haven't seen much difference using this vs. plain old > .pyc on any of several platforms- I wonder if it becomes significant > after you cross some threshold for program length or something? Well, Beazley says "These files contain bytecode stripped of line numbers, assertions and other debugging information." So I can imagine that many modules will not see much of a speed up anyway. If someone wrote a module with a lot of assertions, etc. that would be one thing, but if all it is doing is stripping line numbers, it seems like it would hardly affect the average file (file reads can happen quite fast). Thanks for the tip on "-o" versus "-O" BTW. I'm going to guess there is no real reason to worry about it -- unless someone says otherwise. Bob From jack@oratrix.nl Tue May 22 15:45:43 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 22 May 2001 16:45:43 +0200 Subject: [Pythonmac-SIG] Nasty bug in frozen applications Message-ID: <20010522144548.E57E6DDDE7@oratrix.oratrix.nl> I just found a nasty bug in the PYC resource import code, which is used by applications generated with BuildApplication. The symptom is that imports are a lot slower than they should be. For smallish applications this shoulnd't be too much of a problem, but if you have a big application generated with BuildApplication the startup time of your app has probably drastically increased somewhere around MacPython 2.0. If anyone is experiencing this slowdown: let me know. I wasn't sure whether I'd do a 2.1.1 release for MacPython, but this is the sort of thing that may convice me to do put some work in it... -- 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/ ++++ From dpennell@guardnet.com Tue May 22 19:35:13 2001 From: dpennell@guardnet.com (David Pennell) Date: Tue, 22 May 2001 11:35:13 -0700 Subject: [Pythonmac-SIG] I have X, Tk8.3.3 on OS X - how do I get _tkinter working? Message-ID: Hi: I noted the instructions for static compile of Python 2.0 and 2.1 on OS X. I have the packaged 2.0 installed and have built the 2.1. I also have XFree86 working with either a demo of XTools (Aqua X) or with the free XDarwin (Motif X grabbing the window manager from Aqua). I can run all the widget, rolodex, etc. demos using wish8.3.3 and tclsh8.3.3 just fine with XFree86. My question is, how do I get a _tkinter module into all this for Tkinter.py to load? On a regular Sun box this was easy, but it seems very hard on OS X. I can't see anything in configure that helps. Any ideas? From jack@oratrix.nl Tue May 22 21:08:02 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 22 May 2001 22:08:02 +0200 Subject: [Pythonmac-SIG] I have X, Tk8.3.3 on OS X - how do I get _tkinter working? In-Reply-To: Message by "David Pennell" , Tue, 22 May 2001 11:35:13 -0700 , Message-ID: <20010522200807.4420BDDDE7@oratrix.oratrix.nl> Recently, "David Pennell" said: > Hi: > > I noted the instructions for static compile of Python 2.0 and 2.1 on OS > X. I have the packaged 2.0 installed and have built the 2.1. I also have > XFree86 working with either a demo of XTools (Aqua X) or with the free > XDarwin (Motif X grabbing the window manager from Aqua). > > I can run all the widget, rolodex, etc. demos using wish8.3.3 and > tclsh8.3.3 just fine with XFree86. > > My question is, how do I get a _tkinter module into all this for > Tkinter.py to load? Look at setup.py, especially the detect_tkinter() method. Probably adding the right include/lib directories to lib_dirs and inc_dirs in the detect_modules() method is good enough. (This is setup.py in the main Python directory). -- 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 tony.mcdonald@ncl.ac.uk Tue May 22 22:13:15 2001 From: tony.mcdonald@ncl.ac.uk (Tony McDonald) Date: Tue, 22 May 2001 22:13:15 +0100 Subject: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... In-Reply-To: <20010521082350.98231303181@snelboot.oratrix.nl> Message-ID: On 21/5/01 9:23 am, "Jack Jansen" wrote: > The MacOSX dynamic loader is extremely picky about symbols, and indeed it > doesn't want a multiply defined symbol anywhere. > Tell me about it - it's driving me up the wall! > So, in your first problem (the _XML_DefaultCurrent one) my guess is that you > have a dynamic module that is already linked statically. The easiest way to > find the culprit is to use nm to find who's defining it during the normal > Python build. The build creates a couple of .a libraries and the proceeds to > link these together, if you run nm | grep _XML_DefaultCurrent on the libraries > you should find the object file defining it. > After installing a fresh copy of Python (from source) and reinstalling 4Suite-0.11, I get this; [8:29am tonymcd 4Suite-0.11/test_suite/4XSLT]% python2.1 test_message.py dyld: python2.1 multiple definitions of symbol _main python2.1 definition of _main /usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition of _main I then nuked the entire python directory and installed Tonys' MacOS-X precompiled python2.1 (with pyexpat built in). I rebuilt PyXML-0.6.5 (which recognises that a pyexpat exists and doesn't try to build one) and 4Suite-0.11. Then; [9:10am tonymcd 4Suite-0.11/test_suite/4XSLT]% python test_message.py dyld: python multiple definitions of symbol _XML_DefaultCurrent python definition of _XML_DefaultCurrent /usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition of _XML_DefaultCurrent Worse still, I can't find any mention of XML_DefaultCurrent in the 4Suite-0.11 source tree. :( And looking around a bit.. [9:15am tonymcd python2.1/site-packages/Ft]% nm Lib/cDomlettec.so | grep _XML_DefaultCurrent 00018ef4 T _XML_DefaultCurrent with [9:19am tonymcd /usr/local/bin]% nm python | grep _XML_DefaultCurrent 000725dc T _XML_DefaultCurrent Now I'm stuck. I *presume* the _XML_DefaultCurrent symbol is from the pyexpat that Tony compiled in, but I don't know for sure. There is an environment variable that 4Thought mention (BETA_DOMLETTE) that is supposed to activate cDomlettec, but it doesn't work in the test_suite directory. > The second problem is a bit strange pyexpat.so seems to have a main program. > It shouldn't, Python already has a main program. But: on most platforms this > wouldn't be a problem at all, so it may well be that the way pyexpat is built > always does this. Is this the pyexpat that's included with Python 2.1, or does > it come from a different place? It's the pyexpat from PyXML-0.6.5. I suppose I could be misusing distutils in some way (environment variables etc) but I don't know for sure. Thanks for the thoughts Jack, I guess this is something I'm going to have to keep on (and on) at. I'd encourage people to have a look at MacOS X - it's very nice indeed! Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope From chrishbarker@home.net Wed May 23 00:21:01 2001 From: chrishbarker@home.net (Chris Barker) Date: Tue, 22 May 2001 16:21:01 -0700 Subject: [Pythonmac-SIG] Re: [Python-Dev] Import hook to do end-of-line conversion? References: <20010414192445-r01010600-f8273ce6@213.84.27.177> Message-ID: <3B0AF45D.732126E6@home.net> This is a multi-part message in MIME format. --------------B9643430766B782E71A5BE98 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Just van Rossum wrote: > Agreed. I'll try to write one, once I'm feeling better: having the flu doesn't > seem to help focussing on actual content... > > Just Just (or anyone else) Have you made any progress on this PEP? I'd like to see it happen, so if you havn't done it, I'll try to find the time to make a start on it myself. I have written a simple class that impliments a line-ending-neutral text file class. I wrote it because I have a need for it, and I thought it would be a reasonable prototype for any syntax and methods we might want to use in an actual implimentation. I doubt anyone would find the methods I used particularly clean or elegant (or fast) but it's the first thing I've come up with, and it seems to work. I've enclosed the module with this email. If that doesn't work, let me know and I'll put it on a website. -Chris -- Christopher Barker, Ph.D. ChrisHBarker@home.net --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ --------------B9643430766B782E71A5BE98 Content-Type: text/plain; charset=us-ascii; name="TextFile.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="TextFile.py" #!/usr/bin/env python """ TextFile.py : a module that provides a UniversalTextFile class, and a replacement for the native python "open" command that provides an interface to that class. It would usually be used as: from TextFile import open then you can use the new open just like the old one (with some added flags and arguments) or import TextFile file = TextFile.open(filename,flags,[bufsize], [LineEndingType], [LineBufferSize]) """ import os ## Re-map the open function _OrigOpen = open def open(filename,flags = "",bufsize = -1, LineEndingType = "", LineBufferSize = ""): """ A new open function, that returns a regular python file object for the old calls, and returns a new nifty universal text file when required. This works just like the regular open command, except that a new flag and a new parameter has been added. Call: file = open(filename,flags = "",bufsize = -1, LineEndingType = ""): - filename is the name of the file to be opened - flags is a string of one letter flags, the same as the standard open command, plus a "t" for universal text file. - - "b" means binary file, this returns the standard binary file object - - "t" means universal text file - - "r" for read only - - "w" for write. If there is both "w" and "t" than the user can specify a line ending type to be used with the LineEndingType parameter. - - "a" means append to existing file - bufsize specifies the buffer size to be used by the system. Same as the regular open function - LineEndingType is used only for writing (and appending) files, to specify a non-native line ending to be written. - - The options are: "native", "DOS", "Posix", "Unix", "Mac", or the characters themselves( "\r\n", etc. ). "native" will result in using the standard file object, which uses whatever is native for the system that python is running on. - LineBufferSize is the size of the buffer used to read data in a readline() operation. The default is currently set to 200 characters. If you will be reading files with many lines over 200 characters long, you should set this number to the largest expected line length. """ if "t" in flags: # this is a universal text file if ("w" in flags or "a" in flags) and LineEndingType == "native": return _OrigOpen(filename,flags.replace("t",""), bufsize) return UniversalTextFile(filename,flags,LineEndingType,LineBufferSize) else: # this is a regular old file return _OrigOpen(filename,flags,bufsize) class UniversalTextFile: """ A class that acts just like a python file object, but has a mode that allows the reading of arbitrary formated text files, i.e. with either Unix, DOS or Mac line endings. [\n , \r\n, or \r] To keep it truly universal, it checks for each of these line ending possibilities at every line, so it should work on a file with mixed endings as well. """ def __init__(self,filename,flags = "",LineEndingType = "native",LineBufferSize = ""): self._file = _OrigOpen(filename,flags.replace("t","")+"b") LineEndingType = LineEndingType.lower() if LineEndingType == "native": self.LineSep = os.linesep() elif LineEndingType == "dos": self.LineSep = "\r\n" elif LineEndingType == "posix" or LineEndingType == "unix" : self.LineSep = "\n" elif LineEndingType == "mac": self.LineSep = "\r" else: self.LineSep = LineEndingType ## some attributes self.closed = 0 self.mode = flags self.softspace = 0 if LineBufferSize: self._BufferSize = LineBufferSize else: self._BufferSize = 100 def readline(self): start_pos = self._file.tell() ##print "Current file posistion is:", start_pos line = "" TotalBytes = 0 Buffer = self._file.read(self._BufferSize) while Buffer: ##print "Buffer = ",repr(Buffer) newline_pos = Buffer.find("\n") return_pos = Buffer.find("\r") if return_pos == newline_pos-1 and return_pos >= 0: # we have a DOS line line = Buffer[:return_pos]+ "\n" TotalBytes = newline_pos+1 break elif ((return_pos < newline_pos) or newline_pos < 0 ) and return_pos >=0: # we have a Mac line line = Buffer[:return_pos]+ "\n" TotalBytes = return_pos+1 break elif newline_pos >= 0: # we have a Posix line line = Buffer[:newline_pos]+ "\n" TotalBytes = newline_pos+1 break else: # we need a larger buffer NewBuffer = self._file.read(self._BufferSize) if NewBuffer: Buffer = Buffer + NewBuffer else: # we are at the end of the file, without a line ending. self._file.seek(start_pos + len(Buffer)) return Buffer self._file.seek(start_pos + TotalBytes) return line def readlines(self,sizehint = None): """ readlines acts like the regular readlines, except that it understands any of the standard text file line endings ("\r\n", "\n", "\r"). If sizehint is used, it will read a a mximum of that many bytes. It will not round up, as the regular readline does. This means that if your buffer size is less thatn the length of the next line, you won't get anything. """ if sizehint: Data = self._file.read(sizehint) else: Data = self._file.read() if len(Data) == sizehint: #print "The buffer is full" FullBuffer = 1 else: FullBuffer = 0 Data = Data.replace("\r\n","\n").replace("\r","\n") Lines = [line + "\n" for line in Data.split('\n')] #print Lines ## If the last line is only a linefeed it is an extra line if Lines[-1] == "\n": del Lines[-1] ## if it isn't then the last line didn't have a linefeed, so we need to remove the one we put on. else: ## or it's the end of the buffer if FullBuffer: #print "the file is at:",self._file.tell() #print "the last line has length:",len(Lines[-1]) self._file.seek(-(len(Lines[-1])-1),1) # reset the file position del(Lines[-1]) else: Lines[-1] = Lines[-1][:-1] return Lines def readnumlines(self,NumLines = 1): """ readnumlines is an extension to the standard file object. It returns a list containing the number of lines that are requested. I have found this to be very usefull, and allows me to avoid the many loops like: lines = [] for i in range(N): lines.append(file.readline()) Also, If I ever get around to writing this in C, it will provide a speed improvement. """ Lines = [] while len(Lines) < NumLines: Lines.append(self.readline()) return Lines def read(self,size = None): """ read acts like the regular read, except that it tranlates any of the standard text file line endings ("\r\n", "\n", "\r") into a "\n" If size is used, it will read a maximum of that many bytes, before translation. This means that if the line endings have more than one character, the size returned will be smaller. This could gbe patched, but it didn't seem worth it. If you want that much control, use a binary file. """ if size: Data = self._file.read(size) else: Data = self._file.read() return Data.replace("\r\n","\n").replace("\r","\n") def write(self,string): """ write is just like the regular one, except that it uses the line separator specified when the file was opened for writing or appending. """ self._file.write(string.replace("\n",self.LineSep)) def writelines(self,list): for line in list: self.write(line) # The rest of the standard file methods mapped def close(self): self._file.close() self.closed = 1 def flush(self): self._file.flush() def fileno(self): return self._file.fileno() def seek(self,offset,whence = 0): self._file.seek(offset,whence) def tell(self): return self._file.tell() --------------B9643430766B782E71A5BE98-- From hansv@net4all.be Wed May 23 02:35:46 2001 From: hansv@net4all.be (Hans verschooten) Date: Wed, 23 May 2001 03:35:46 +0200 Subject: [Pythonmac-SIG] HTML DOM parsing Message-ID: Hi, can anybody point me in the right direction where I can find the right files to parse HTML files on the mac using DOM level 1. If been trying to get the PyXML files installed on my Python 2.1, but I keep running into wrong line-endings. Is there anyway out of the box or with a detailed installation how to install PyXML on MacPython 2.1. Many thanks for anybody's help. Hans From Laurent.Pierron@loria.fr Wed May 23 08:15:30 2001 From: Laurent.Pierron@loria.fr (Laurent Pierron) Date: Wed, 23 May 2001 09:15:30 +0200 Subject: [Pythonmac-SIG] HTML DOM parsing References: Message-ID: <3B0B6392.D3ADC2CE@loria.fr> Hi, You must use htmlib : http://www.python.org/doc/current/lib/module-htmllib.html Because HTML is not XML so you cannot parse HTML files with an XML Parser. Greetings -- Laurent Pierron Hans verschooten a écrit : > > can anybody point me in the right direction where I can find the right files > to parse HTML files on the mac using DOM level 1. > > If been trying to get the PyXML files installed on my Python 2.1, but I keep > running into wrong line-endings. > > Is there anyway out of the box or with a detailed installation how to > install PyXML on MacPython 2.1. > > From tony.mcdonald@ncl.ac.uk Wed May 23 14:10:42 2001 From: tony.mcdonald@ncl.ac.uk (Tony McDonald) Date: Wed, 23 May 2001 14:10:42 +0100 Subject: FW: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... In-Reply-To: <200105222300.QAA01503@scv1.apple.com> Message-ID: This was sent to me be Doug Landauer in Apple. Does this help me (us :) out at all? -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope ------ Forwarded Message From: Doug Landauer Date: Tue, 22 May 2001 16:02:56 -0700 To: Tony McDonald Cc: Jack Jansen Subject: Re: [Pythonmac-SIG] Re: Compiler flags question for OSX compilation... On Tuesday, May 22, 2001, at 02:13 PM, Tony McDonald wrote: > On 21/5/01 9:23 am, "Jack Jansen" wrote: > >> The MacOSX dynamic loader is extremely picky about symbols, and indeed >> it >> doesn't want a multiply defined symbol anywhere. [Ignore if this is all old hat to you.] I can't help with the details of the problem, but have a couple of tidbits of general Mac OS X stuff that might conceivably help. Many of the projects here within Apple have run into these sorts of problems stemming mainly from the collision between the CFM (OS 9 & earlier) world vs the mach-o (NeXT, OS X) world. By default, in CFM, symbols in a shared library are private unless explicitly exported. In mach-o, it's the opposite. There is an attribute, "private extern", that can be applied to symbols in order to make them behave a little more like the CFM ones do. When using nm, you'll often want to use "nm -m", which is more verbose than plain "nm" about what symbols are and what they used to be. In particular, after a link, "nm -m" will tell you whether a symbol was a private extern. With the numerous projects we've been moving from the OS 9 world, the usual workaround that we've been using is the "nmedit" command. This can limit the visibility of symbols such that the sequence link -o foo.dylib bunch-of-objects nmedit -s export-list foo.dylib behaves similar to an OS 9 link, with the given export list. Given this, you might try running nmedit on your cDomlettec.so just to hide its _main symbol, and run nmedit on your python executable to hide its _XML_DefaultCurrent symbol. (I don't think nmedit has a "just hide *this* symbol" flag, but I'll go suggest it.) > (I don't think nmedit has a "just hide *this* symbol" flag, but I'll > go suggest it.) Aha, it does already. nmedit -R filename foo.dylib where "filename" contains the symbol(s) you wish to hide. -- Doug (This will be made better and easier in a future release of Mac OS X. Don't know which or when, though.) Hope it helps a bit... -- Doug Landauer ------ End of Forwarded Message From dpennell@guardnet.com Wed May 23 18:00:43 2001 From: dpennell@guardnet.com (David Pennell) Date: Wed, 23 May 2001 10:00:43 -0700 Subject: [Pythonmac-SIG] Re: my python 2.1 build Message-ID: >> >> My question is, how do I get a _tkinter module into all this for >> Tkinter.py to load? > >Look at setup.py, especially the detect_tkinter() method. Probably >adding the right include/lib directories to lib_dirs and inc_dirs in >the detect_modules() method is good enough. > >(This is setup.py in the main Python directory). >-- >Jack Jansen Yes, that is the heart of what my problem was, it can be a confusing build, and it looks like setup.py runs in the middle of the make as well as later. But among other things, i had it look for 8.3.3 files where it should have been 8.3. Anyway, now I have a happy Tkinter. It runs well with either XDarwin or Xtools. The latter costs $200, unfortunately, which my company would not buy, although it gives nifty Aqua windows and XDarwin is old-school Motif, at least to start, and takes over your video. Anyone who was wondering, though, Tkinter stuff (hanoi, PySol, the IDLE) runs fine on XDarwin and on XTools (both with the XFree86 framework). Thanks for the help dp p.s. everything else i put in worked just as suggested, like readline and crypt, *BUT* I had mysterious problems for a while building the _sre component of the (C-code) re module. From adv.files@robbstucky.com Wed May 23 19:09:10 2001 From: adv.files@robbstucky.com (Advertising) Date: Wed, 23 May 2001 14:09:10 -0400 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) Message-ID: <200105231802.LAA02356@gull.mail.pas.earthlink.net> I'm looking for a simple way for a novice programmer to pass data from AppleScripts. In AppleScript create a {list} tell a macPythonApp to: launch and take the {list} as the argv parameters. I want my AppleScript to send tell application "myPythonScriptApp" run/launch/activate/open with {list} and have myPythonScriptApp launch and retrieve the {list} from argv I've scanned the list archives and am wholly confused. (CGI, HTTP, miniApplication, OSAmodules, macPython vs unixPython, AppleEvents) Do I have to become an expert with all this stuff before I can do something that seems so simple? Thanks, Lane --------------------------------------------------------------------------- ------------ I figured out a "dumb" workaround, which for me creates too much ancilliary tracking. Applescript writes {list} to a file macPythonApp reads {list} from file But since, I can't pass {list} to macPython, I can't pass "file to use" either. From jack@oratrix.nl Wed May 23 20:40:46 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 23 May 2001 21:40:46 +0200 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) In-Reply-To: Message by Advertising , Wed, 23 May 2001 14:09:10 -0400 , <200105231802.LAA02356@gull.mail.pas.earthlink.net> Message-ID: <20010523194051.594F4DDDE3@oratrix.oratrix.nl> There's currently no way to do this. Python accepts two appleevents, open document and open app. And with open document it expects documents (which are then added to sys.argv). But the functionality sounds pretty useful, especially for simple tasks. You can already more-or-less do what you want, by creating an applet based on MiniAEFrame, but an argv-based scheme would definitely be easier for some things. Idea: if you design the AEUT resource (and possibly do an example implementation based on MiniAEFrame) I'll add it to the main interpreter for the next release. Oh yes: you'll probably want the script to run to be the direct object. (BTW: You should watch out with a name like "advertising": you're message was already half-way to the bitbucket when the "Applescript" and "argv" in the subject struck me as funny keywords for a spam message:-) -- 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 dgoodger@bigfoot.com Thu May 24 02:04:46 2001 From: dgoodger@bigfoot.com (David Goodger) Date: Wed, 23 May 2001 21:04:46 -0400 Subject: [Pythonmac-SIG] Re: Import hook to do end-of-line conversion? In-Reply-To: <3B0AF45D.732126E6@home.net> Message-ID: Yesterday I found I had need for an end-of-line conversion import hook. I looked sround but found none (did I miss some code on this thread?), so I whipped one up (below). It seems to do the job. If you see any goofs, gaffes or gotchas, or if you know of a better way to do this, please let me know. I will post this code to c.l.py in a few days for the enjoyment of all. -- David Goodger dgoodger@bigfoot.com Open-source projects: - The Go Tools Project: http://gotools.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net (soon!) -----%<----------cut----------%<----------%<----------cut----------%<----- # Import hook for end-of-line conversion, # by David Goodger (dgoodger@bigfoot.com). # Put in your sitecustomize.py, anywhere on sys.path, and you'll be able to # import Python modules with any of Unix, Mac, or Windows line endings. import ihooks, imp, py_compile class MyHooks(ihooks.Hooks): def load_source(self, name, filename, file=None): """Compile source files with any line ending.""" if file: file.close() py_compile.compile(filename) # line ending conversion is in here cfile = open(filename + (__debug__ and 'c' or 'o'), 'rb') try: return self.load_compiled(name, filename, cfile) finally: cfile.close() class MyModuleLoader(ihooks.ModuleLoader): def load_module(self, name, stuff): """Special-case package directory imports.""" file, filename, (suff, mode, type) = stuff path = None if type == imp.PKG_DIRECTORY: stuff = self.find_module_in_dir("__init__", filename, 0) file = stuff[0] # package/__init__.py path = [filename] try: # let superclass handle the rest module = ihooks.ModuleLoader.load_module(self, name, stuff) finally: if file: file.close() if path: module.__path__ = path # necessary for pkg.module imports return module ihooks.ModuleImporter(MyModuleLoader(MyHooks())).install() From raji@csy24.india.hp.com Thu May 24 13:55:42 2001 From: raji@csy24.india.hp.com (B RAJESHWARI RAO) Date: Thu, 24 May 2001 12:55:42 IST Subject: [Pythonmac-SIG] Not getting the header files Message-ID: <200105240725.MAA14150@csy24.india.hp.com> Hi While doing Python interface to Sybase relational database system we are not getting the header files 'ctpublic.h' and 'bkpublic.h'.Can u pls tell me where we can find these header files.Hope u will do the need. Thanks. Rgds, Raji. From adv.files@robbstucky.com Thu May 24 17:59:16 2001 From: adv.files@robbstucky.com (Advertising) Date: Thu, 24 May 2001 12:59:16 -0400 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) Message-ID: <200105241652.JAA21771@hawk.mail.pas.earthlink.net> >There's currently no way to do this. Python accepts two appleevents, >open document and open app. And with open document it expects >documents (which are then added to sys.argv). Which python is preconfigured to accept 2 AppleEvents (open document / open app)? Interpreter, IDE, or SimpleScripts saved as Applets. When you say "open document" do you mean opening the *.py file, or can I....... tell application "pythonUnspecified" open document FSSpec end tell Thanks, Lane ps Stop the discrimination against and stereotyping of Advertisers! Many of us decry the inappropriate and intrusive methods of the new "internet economy." We dislike unsolicited eMail/Spam as much as you do. ------------------------------------------------------------------- You can litter your internet presence with as many flashing, bouncing, colorful cruft items as your bandwith will carry. But if you never really had anything to say, and spent all your time working on those gee-whiz items; you still have nothing to say, and your audience will know it. "Spend your time on the Message; not the media." Encourage clear, concise communication in plain and simple language. "Use as little as you need to get your point across." Any idiot can fill the space with cruft, and they usually do so. From jack@oratrix.nl Thu May 24 22:46:54 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 24 May 2001 23:46:54 +0200 Subject: [Pythonmac-SIG] Not getting the header files In-Reply-To: Message by B RAJESHWARI RAO , Thu, 24 May 2001 12:55:42 IST , <200105240725.MAA14150@csy24.india.hp.com> Message-ID: <20010524214659.9A93BE267B@oratrix.oratrix.nl> Recently, B RAJESHWARI RAO said: > Hi > > While doing Python interface to Sybase relational database system we are not > getting the header files 'ctpublic.h' and 'bkpublic.h'.Can u pls tell me wher > e > we can find these header files.Hope u will do the need. > Thanks. These are not header files used by MacPython or provided by it, so I can't help you here. Maybe they should be part of the Sybase interface and you should ask on a Sybase mailing list? -- 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 jack@oratrix.nl Thu May 24 22:51:09 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 24 May 2001 23:51:09 +0200 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) In-Reply-To: Message by Advertising , Thu, 24 May 2001 12:59:16 -0400 , <200105241652.JAA21771@hawk.mail.pas.earthlink.net> Message-ID: <20010524215114.C475BF8C63@oratrix.oratrix.nl> Recently, Advertising said: > >There's currently no way to do this. Python accepts two appleevents, > >open document and open app. And with open document it expects > >documents (which are then added to sys.argv). > > Which python is preconfigured to accept 2 AppleEvents (open document / > open app)? > Interpreter, > IDE, > or SimpleScripts saved as Applets. Interpreter does, and the first FSSpec will be used as the script to execute, subsequent ones as argv[1], etc. IDE does, and opens an edit window with the script. scripts saved as Applets will also accept them and stuff them into argv[1] etc. > When you say "open document" do you mean opening the *.py file, > or can I....... > > tell application "pythonUnspecified" > open document FSSpec > end tell Yes, that's right. That's basically what the finder does when you doubleclick a .py script. > ps > Stop the discrimination against and stereotyping of Advertisers! Hehe, okay, I'll try to refrain from it. It's just my subconscious kicking in now and again:-) -- 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 bgg@object-craft.com.au Fri May 25 02:07:39 2001 From: bgg@object-craft.com.au (Ben Golding) Date: Fri, 25 May 2001 11:07:39 +1000 Subject: [Pythonmac-SIG] Not getting the header files In-Reply-To: <200105240725.MAA14150@csy24.india.hp.com> Message-ID: <200105250107.f4P17ZU21807@vole.object-craft.com.au> On Thursday, May 24, 2001, at 12:55 , B RAJESHWARI RAO wrote: > While doing Python interface to Sybase relational database system we > are not > getting the header files 'ctpublic.h' and 'bkpublic.h'.Can u pls tell > me where > we can find these header files. These files are from the Sybase client library distribution so it sounds like they haven't been installed on your system. Which Python Sybase module are you trying to use? My company, Object Craft, distributes one so you might like to try contacting its author Dave Cole directly at djc@object-craft.com.au if you're using that. If you don't have the Sybase client library, it may be worth investigating http://www.freetds.org who have reverse-engineered a good part of the Sybase client library and have made their efforts freely available. Ben. From just@letterror.com Fri May 25 08:07:31 2001 From: just@letterror.com (Just van Rossum) Date: Fri, 25 May 2001 09:07:31 +0200 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) In-Reply-To: <200105241652.JAA21771@hawk.mail.pas.earthlink.net> Message-ID: <20010525090738-r01010600-2532edbf@213.84.27.177> Lane, > ps > Stop the discrimination against and stereotyping of Advertisers! > Many of us decry the inappropriate and intrusive methods of > the new "internet economy." We dislike unsolicited eMail/Spam as much as > you do. It's not that there's anything against advertizing per se, or anyone working in advertizing, but if you receive a lot of email, you also receive a lot of spam, and you train yourself (possibly unconsciously) to recognize spam. I absolutely agree with Jack that your sender name "Advertizing" triggers the "delete-spam-reflex". So this is not against you or advertizing, but a mild advise to change your "Sender's name" (or whatever it's called in your email program) to something more descriptive, eg. your name. Just From richard@richardgordon.net Fri May 25 16:04:12 2001 From: richard@richardgordon.net (Richard Gordon) Date: Fri, 25 May 2001 11:04:12 -0400 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) In-Reply-To: <20010525090738-r01010600-2532edbf@213.84.27.177> References: <20010525090738-r01010600-2532edbf@213.84.27.177> Message-ID: At 9:07 AM +0200 5/25/01, Just van Rossum wrote: >It's not that there's anything against advertizing per se, or anyone >working in >advertizing, but if you receive a lot of email, you also receive a >lot of spam, >and you train yourself (possibly unconsciously) to recognize spam. I >absolutely >agree with Jack that your sender name "Advertizing" triggers the >"delete-spam-reflex". So this is not against you or advertizing, but a mild >advise to change your "Sender's name" (or whatever it's called in your email >program) to something more descriptive, eg. your name. Well, I sympathize with the guy to some extent, but agree that using a name that is associated with spam will probably trigger the human reflex and, more to the point, may trigger a filter that sends the message /dev/null before anyone even sees it. I'm thinking about AOL in particular and about a lot of corporate mail systems in general that appear to be applying some pretty draconian rule sets to inbound mail. Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From delza@alliances.org Fri May 25 18:04:31 2001 From: delza@alliances.org (Dethe Elza) Date: Fri, 25 May 2001 10:04:31 -0700 Subject: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters) In-Reply-To: <20010525090738-r01010600-2532edbf@213.84.27.177> Message-ID: Oh, come on now. We're all inundated with advertising every waking moment of the day -- I'm told it's even worse if you turn on a television. There is something wrong with advertising, it's too pervasive, too powerful a force in our society, and has too few restrictions (thus letting cola, cigarette and other drug manufacturers peddle their wares to children for instance). A lot of people have a lot of hostility towards advertising and advertisers -- that's just reality. You can work to change the reality by reforming your industry, and more power to you, but denying that the industry's execesses doesn't cut it. I do blame the advertisers, for quite a lot of things, because I've done my research. Of course, that's an overgeneralization and not all advertisers are guilty of overstepping the various bounds (ethical, legal, aesthetic, etc.). Of course not, but we humans make generalizations, it's how our brains work. An advertiser should know that, since the advertising industry hires more psychologists than any other industry to try to figure out how human brains work to make advertising "work" better (when a cult does it it's called "brainwashing"). Personally, I thought you had a good question and a thoughtful response. But you're going to end up in a lot of spam buckets with that address. And, in my humble opinion, quite rightly so. -- Dethe Elza Chief Mad Scientist Burning Tiger Technologies > From: Just van Rossum > Date: Fri, 25 May 2001 09:07:31 +0200 > To: Advertising > Cc: pythonMac > Subject: Re: [Pythonmac-SIG] Passing Data: from AppleScript to argv(command > line parameters) > > Lane, > >> ps >> Stop the discrimination against and stereotyping of Advertisers! >> Many of us decry the inappropriate and intrusive methods of >> the new "internet economy." We dislike unsolicited eMail/Spam as much as >> you do. > > It's not that there's anything against advertizing per se, or anyone working > in > advertizing, but if you receive a lot of email, you also receive a lot of > spam, > and you train yourself (possibly unconsciously) to recognize spam. I > absolutely > agree with Jack that your sender name "Advertizing" triggers the > "delete-spam-reflex". So this is not against you or advertizing, but a mild > advise to change your "Sender's name" (or whatever it's called in your email > program) to something more descriptive, eg. your name. > > Just > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From jaredu@its.caltech.edu Sat May 26 02:58:49 2001 From: jaredu@its.caltech.edu (Jared Updike) Date: Fri, 25 May 2001 18:58:49 -0700 (PDT) Subject: [Pythonmac-SIG] Embedding, SIOUX, and a double-apple menu Message-ID: I have embedded python in a shared library (C, Codewarrior) that is loaded by a numerical analysis/data acquistion program called Igor. But I think the normal way of doing this creates a (SIOUX?) window called Igor PPC 3.16B01.out (where Igor PPC 3.16B01 is the name of the program) and AN EXTRA APPLE MENU (and File Edit, etc)! when Igor loads its shared library extensions. This is bad, as it causes the system to hang when I include my shared library in the extensions that get loaded, and I need the functionally of my SL-extenstion in Igor. Is there a better way to do this: - Embed Python in a shared library without creating an output SIOUX window? (I guess the assumption is that if anything in Python goes wrong, I redirect the tracebacks myself). If it is possible/recommendable then how do I change my project to do so? (assuming the project is similar to demo "embed" project). What files does Python.h actually need to work? And is SIOUX an explanation for this behavior (the extra apple menu/output window...) or is something else messed up...? Thanks --Jared Web: http://waffles.caltech.edu Phone: (626)395-1155 Campus Address: Blacker #39 Address: MSC 935 Caltech Pasadena, CA 91126-0935 From dgoodger@bigfoot.com Sat May 26 14:39:42 2001 From: dgoodger@bigfoot.com (David Goodger) Date: Sat, 26 May 2001 09:39:42 -0400 Subject: [Pythonmac-SIG] good CVS/ssh client for Mac? Message-ID: Jack, When you were about to move MacPython's CVS over to the Python's SourceForge project, you mentioned (on python-dev, I believe) that there is now a good CVS client for the Mac, that supports ssh and SourceForge access. Could you give me a link please? Thanks. -- David Goodger dgoodger@bigfoot.com Open-source projects: - The Go Tools Project: http://gotools.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net (soon!) From csmith@barebones.com Sat May 26 15:59:58 2001 From: csmith@barebones.com (Christian Smith) Date: Sat, 26 May 2001 10:59:58 -0400 Subject: [Pythonmac-SIG] good CVS/ssh client for Mac? In-Reply-To: Message-ID: <20010526110027-b01010702-0e45d123-0910-010c@146.115.234.50> On 5/26/01 at 9:39 AM, dgoodger@bigfoot.com (David Goodger) wrote: > When you were about to move MacPython's CVS over to the Python's SourceForge > project, you mentioned (on python-dev, I believe) that there is now a good > CVS client for the Mac, that supports ssh and SourceForge access. Could you > give me a link please? Thanks. MacCVS Pro - -- Christian Smith | csmith@barebones.com | http://web.barebones.com PGP Fingerprint - 60E5 2216 97D2 1D1A B923 F036 00A9 CEC0 D411 FA89 From jack@oratrix.nl Sat May 26 21:43:52 2001 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 26 May 2001 22:43:52 +0200 Subject: [Pythonmac-SIG] Re: good CVS/ssh client for Mac? In-Reply-To: Message by David Goodger , Sat, 26 May 2001 09:39:42 -0400 , Message-ID: <20010526204357.6112BDDDE3@oratrix.oratrix.nl> Recently, David Goodger said: > Jack, > > When you were about to move MacPython's CVS over to the Python's SourceForge > project, you mentioned (on python-dev, I believe) that there is now a good > CVS client for the Mac, that supports ssh and SourceForge access. Could you > give me a link please? Thanks. Well, good... Hmm. There's a Mac CVS client that talks ssh, so if you need checkin privileges on SourceForge it's about your only option (aside from lots of mumbojumbo with tunneling from MacCVS to NitfyTelnet and other magic). This is the "MacCVS Pro" client, from www.maccvs.org. Aside from ssh support (and a more good-looking GUI) it is much worse than MacCVS (from www.cvsgui.org): no support for .cvsignore, no Internet Config support to set the right creator/type for files, a strange and error-prone method for checking file modifications (based on files being check out readonly with the mac-standard "ckid" resource, and if you've edited the file there's really no way to find out whether you've actually changed it short of checking it in), every file is checked in separately (so mass changes result in massive mailings to the cvs-checkins mailinglist) and lots of other little gripes. All in all I'd switch back to MacCVS today rather than tomorrow (even the new version where they've ruined the GUI beyond all recognition:-) if it wasn't for SSH support. -- 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 bobsavage@mac.com Sat May 26 22:11:21 2001 From: bobsavage@mac.com (Bob Savage) Date: Sat, 26 May 2001 14:11:21 -0700 Subject: [Pythonmac-SIG] Re: good CVS/ssh client for Mac? In-Reply-To: <20010526204357.6112BDDDE3@oratrix.oratrix.nl> Message-ID: I'm glad this came up, because I was wondering about something: since CVS was created for the rather "plain" world of unix computing, and Macs use much "richer" components in their applications (binary data, e.g. resource files/forks), are there special steps one needs to take under MacOS when using CVS on a project? If you have a directory of images or sound files, and you swapped a couple of them for newer versions would CVS be able to understand the change, or do you have to track all that stuff by hand? I realize I am pulling this ever more off topic, so people might want to respond to me directly. Bob Savage From garyb@strata.com Sun May 27 18:11:14 2001 From: garyb@strata.com (Gary Bringhurst) Date: Sun, 27 May 2001 11:11:14 -0600 Subject: [Pythonmac-SIG] Re: good CVS/ssh client for Mac? In-Reply-To: Message-ID: We've been using SSH with the latest MacCVS client from the cvsgui project on sourceforge for a while now. It's still in beta, and crashes sometimes, but I've never had any serious problems. Mostly you need to avoid cancelling any activity over the ssh connection via command-'.' We also use the Windows client successfully (and happily). It's very nice. A disclaimer: I'm a friend and co-worker with Alex Parenteau who is the current maintainer. Gary Bringhurst garyb@strata.com > > All in all I'd switch back to MacCVS today rather than tomorrow (even > the new version where they've ruined the GUI beyond all recognition:-) > if it wasn't for SSH support. From jack@oratrix.nl Sun May 27 21:22:34 2001 From: jack@oratrix.nl (Jack Jansen) Date: Sun, 27 May 2001 22:22:34 +0200 Subject: [Pythonmac-SIG] Re: good CVS/ssh client for Mac? In-Reply-To: Message by Bob Savage , Sat, 26 May 2001 14:11:21 -0700 , Message-ID: <20010527202240.3E58FEDD23@oratrix.oratrix.nl> Recently, Bob Savage said: > I'm glad this came up, because I was wondering about something: since CVS > was created for the rather "plain" world of unix computing, and Macs use > much "richer" components in their applications (binary data, e.g. resource > files/forks), are there special steps one needs to take under MacOS when > using CVS on a project? For non-TEXT files all Mac cvs clients will optionally allow the file to be put into the repository as binhex or macsingle format. This has a slight problem because it means that everything appears changed twice a year (when the Mac magically changes file times when switching from/to daylight saving time), but aside from that it works fine. The only problem is that you have to specify which file types have to be checked in as straight binary even though they may have a resource fork (images and soundfiles, mainly) and it's easy to forget to ad new types. Then you'll be checking the first .aiff into the repository and it'll work fine for you, but after a while the windows or unix users of the repository start complaining. One thing that I haven't yet found out how to do, maybe someone can help out here: is there a way I can tell unix-CVS that certain files need pre/postprocessing? In my cvstree on OSX (for which I use unix CVS) all my resource-fork files are unusable. Knowing CVS there's probably a way to do what I want, but I don't know of it yet... -- 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 jwmdck@monmouth.com Mon May 28 13:08:03 2001 From: jwmdck@monmouth.com (Murphy/Kostick) Date: Mon, 28 May 2001 08:08:03 -0400 Subject: [Pythonmac-SIG] Re: Compiling python... References: <200105231630.JAA03109@scv1.apple.com> Message-ID: <3B123FA2.5916057A@monmouth.com> Dan Wolfe wrote: > > Here's a recipe for Python 2.1... > > - gnutar -xvzf Python-2.1.tgz >  cd Python-2.1/ >  ./configure --with-dyld --with-suffix=.x >  change Makefile line > OPT= -g -O2 -Wall -Wstrict-prototypes > to > OPT= -g -O2 -Wall -Wstrict-prototypes -no-cpp-precomp > --> this change gets around BSD header problems that were written up in > RADAR earlier >  make >  Work around small stack size (512k) which causes test_re and test_sre > to seg fault > limit stacksize 2M >  make test >  sudo make install >  cd /usr/local/bin/ >  sudo mv python.x python >  sudo mv python2.1.x python2.1 > > - Dan It's probably worthwhile to add at the end: sudo update_prebinding -root / I found this speeded things up for me. Jim Murphy -- jwmdck@monmouth.com Wall Township, New Jersey USA From me@davidglasser.net Wed May 30 03:37:43 2001 From: me@davidglasser.net (David Glasser) Date: Tue, 29 May 2001 22:37:43 -0400 Subject: [Pythonmac-SIG] Tkinter not multitasking Message-ID: I have a fresh new installation of Python 2.1 with Tkinter (whatever version comes with the online installer) on MacOS 9.0. Whenever I run a Tkinter program (even one as simple as 00-HELLO-WORLD.py in Demo/tkinter/matt), it doesn't seem to yield any time to background applications. No redraws when windows are moved, no processing, no nothing. (Processing does happen when I print to the Tkinter console.) Is this a known problem where the only solution is to live with it until somebody gets around to fixing it? Or is this a problem with my setup? Thanks, David Glasser me@davidglasser.net From dma@andrew.cmu.edu Wed May 30 18:06:13 2001 From: dma@andrew.cmu.edu (David Andersen) Date: Wed, 30 May 2001 13:06:13 -0400 Subject: [Pythonmac-SIG] Tkinter not multitasking In-Reply-To: Message-ID: <3385495000.991227973@DAWSON.PC.CC.CMU.EDU> I've observed the same problem. From english@spiritone.com Thu May 31 05:27:51 2001 From: english@spiritone.com (Josh English) Date: 30 May 2001 21:27:51 -0700 Subject: [Pythonmac-SIG] Question about Tkinter listbox Message-ID: <3B15C846.211F89F@spiritone.com> I am new to python and I am using MacPython 2.1 and Tk 8.9 on Mac OS 9.0. I am having difficulty figuring out how to get the selected item in a listbox into an entry data field. I have tried the following code after lots of failed experiments: from Tkinter import * names = ['Josh','Steph'] class window(Frame): def sendname(self): index = namelist.curselection() # Fails here print index # for testing label = namelist.get(index) # Fails here print label # for testing root=Tk() namelist = Listbox(root) pos = 0 for name in names: namelist.insert(pos,name) pos=pos+1 namelist.pack(side=LEFT,fill=Y) namelist.bind('',sendname) nameentry = Entry(root) nameentry.pack(side=TOP,fil=X) window().mainloop() In Programming Python by Mark Lutz there is a ScrolledList class on page 372 and I've adapted the code for this. I'm ignoring the scroll bar and focusing on just this one issue. I want to get the nameentry field to reflect what is selected in namelist. Any suggestions? Josh English english@spiritone.com From Laurent.Pierron@loria.fr Thu May 31 08:51:58 2001 From: Laurent.Pierron@loria.fr (Laurent Pierron) Date: Thu, 31 May 2001 09:51:58 +0200 Subject: [Pythonmac-SIG] Question about Tkinter listbox References: <3B15C846.211F89F@spiritone.com> Message-ID: <3B15F81E.BA93B@loria.fr> Hi, Debugging Python/Tk programs on Mac is not as cool as on Unix and Windows, because when you are running Tk you cannot use Python Console, and the best thing to debug Tk programs is to have a console. So, if you want a double click on the mouse button, replace the line : namelist.bind('',sendname) by namelist.bind('',sendname) and try again. If you develop this application for the Mac, it's better to use the Mac W widget library. You can use and test the library in Mac Python IDE, see an example below. You can find the documentation at : http://www.nevada.edu/~cwebster/Python/WWidgets/ Good luck -- Laurent Pierron Josh English a écrit : > > I am new to python and I am using MacPython 2.1 and Tk 8.9 on Mac OS > 9.0. I am having difficulty figuring out how to get the selected item in > a listbox into an entry data field. I have tried the following code > after lots of failed experiments: > > etc... -------------------------------------- The same application with Mac W widget You can test it directly in Mac Python IDE, Great !!! -------------------------------------- import W names = ['Josh','Steph'] def sendname(point,mod): "TODO : check value of mod to know if it was a double click" index = root.namelist.getselection() print index label = root.namelist.getselectedobjects() print label return 1 root = W.Window((600, 400), "Hello!", minsize = (240, 200)) root.namelist = W.Listbox((20,20,100,300),names) root.namelist.bind('',sendname) root.nameentry = W.EditText((20,140,100,20)) root.open() From owen@astro.washington.edu Thu May 31 16:37:08 2001 From: owen@astro.washington.edu (Russell E Owen) Date: Thu, 31 May 2001 08:37:08 -0700 Subject: Mac Tk console (was Re: [Pythonmac-SIG] Question about Tkinter listbox) In-Reply-To: <3B15F81E.BA93B@loria.fr> References: <3B15C846.211F89F@spiritone.com> <3B15F81E.BA93B@loria.fr> Message-ID: >Debugging Python/Tk programs on Mac is not as cool as on Unix and >Windows, because when you are running Tk you cannot use Python Console, >and the best thing to debug Tk programs is to have a console. I found the lack of a Mac console a real hassle, so I made a simple window for executing scripts. It is called ROStdTk and you can get it at . It's like the IDE's script windows rather than a console. You enter scripts by typing or opening files, then run them by hitting the Run button. If you make your windows globally available then your ROStdTk scripts can see them. For example, the following common paradigm (which runs test code if your module is directly executed instead of being imported) allows you to see everything: if __name__ == "__main__": import ROStdTk root = ROStdTk.ROStdTk() # opens a script window and returns Tk() newWindow = Toplevel(root) # etc. -- the script window can see Tk and newWindow root.mainloop() From jbmoody@oakland.edu Thu May 31 21:15:38 2001 From: jbmoody@oakland.edu (Jon Moody) Date: Thu, 31 May 2001 16:15:38 -0400 Subject: [Pythonmac-SIG] Question about Tkinter listbox In-Reply-To: <3B15C846.211F89F@spiritone.com>; from english@spiritone.com on Wed, May 30, 2001 at 09:27:51PM -0700 References: <3B15C846.211F89F@spiritone.com> Message-ID: <20010531161538.A18675@oakland.edu> On Wed, May 30, 2001 at 09:27:51PM -0700, Josh English wrote: > class window(Frame): > def sendname(self): > index = namelist.curselection() # Fails here > print index # for testing > label = namelist.get(index) # Fails here > print label # for testing The curselection() method returns a list of indices as strings; if selectmode==SINGLE, it will return a list of 1 index as a string; to use the index you have to convert it to an int: label = namelist.get( map(int, index)[0] ) If that doesn't help, the traceback may provide more clues about what's wrong. -- Jon From jschmitt@vmlabs.com Thu May 31 23:18:17 2001 From: jschmitt@vmlabs.com (John Schmitt) Date: Thu, 31 May 2001 15:18:17 -0700 Subject: [Pythonmac-SIG] cross platform GUI? Message-ID: <4197FA5DD22AD5118ADE00805F6FA62F4515@eden.vmlabs.com> So, in your collective experience, is tk actually useable to create decent Mac applications that are also decent Windows applications? I'd like to be able to use wxpython or tk and also pygame (http://pygame.seul.org/) but I'd like to target both Mac (OS9 and OSX) and Windows at the same time. How do you accomplish that? I know this topic comes up often in comp.lang.python, but I want a real Mac person's perspective rather that people who 'heard good things about GTK/glade/wxwhatever' and think the Mac is just a GUI with a slightly different color. Thanks for your input. John From seanh@unforgettable.com Thu May 31 23:48:13 2001 From: seanh@unforgettable.com (Sean Hummel) Date: Fri, 01 Jun 2001 06:48:13 +0800 Subject: [Pythonmac-SIG] cross platform GUI? Message-ID: <20010531224816.8226.qmail@iname.com> I've written quite a few things in Python which use TK because I needed the apps to run on Windows, Macintosh and UNIX. However I found that the application while useable on all three platforms, it was very hard to make a simple dialog, without writing a new TK dialog/window class that read XML dialog templates. However because of the way TK works it can be quite annoying to write an application for. I find the most annoying thing, that there aren't default filters for edit boxes, and that list boxes act strangely when scrolled to different positions, and doing insertions. So if you don't care exactly how your application's GUI acts or looks, I'd suggest TK for Xplatform stuff. But if you do care, then something else might be called for. -----Original Message----- From: John Schmitt Date: Thu, 31 May 2001 15:18:17 -0700 To: "'pythonmac-sig@python.org'" Subject: [Pythonmac-SIG] cross platform GUI? > > So, in your collective experience, is tk actually useable to create decent > Mac applications that are also decent Windows applications? I'd like to be > able to use wxpython or tk and also pygame ( http://pygame.seul.org/) but I'd > like to target both Mac (OS9 and OSX) and Windows at the same time. How do > you accomplish that? > > I know this topic comes up often in comp.lang.python, but I want a real Mac > person's perspective rather that people who 'heard good things about > GTK/glade/wxwhatever' and think the Mac is just a GUI with a slightly > different color. > > Thanks for your input. > > John > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- _______________________________________________ Get your free email from http://mymail.iname.com