tags:

views:

102

answers:

4

In the python installation on my PC there is a sweet script in c:\python26\tools\scripts called redemo.py. It's a simple tk app for testing regular expressions. I wish I could get it--or something like it--running on my Mac, but I don't know how. The script doesn't appear to be part of the python installation on my mac. Ideas?

A: 

Install python on your mac, then copy the script over? It should work fine on any python installation.

Donnie
Python should already be installed on Mac OS X. At least it is on mine, but then again I installed the developer tools.
Paul Tomblin
Yes, it is a standard component on OS X.
Ned Deily
A: 

Mac OS X comes with Python pre-installed. As of 10.6.2 it has Python 2.6.1 found at /usr/bin/python. Copy redemo.py to your Mac. Make sure you have X11.app running and open a terminal (Terminal.app is available by default) and just run:

% python /path/to/redemo.py

Assuming there aren't any Win32 specific hooks in this script, it should execute.

jathanism
The Tk and Pythons on modern OS X versions don't use X11. The script will run just fine with the standard Aqua Tk.
Ned Deily
Well I'll be damned!
jathanism
A: 

Python is part of OSX, but sometimes it's a bit out of date: http://www.python.org/download/mac/

songdogtech
That script directory is not included in the OS X Python installer installations.
Ned Deily
+3  A: 

You can view the script directly from the python svn repository here and can download it:

curl http://svn.python.org/view/*checkout*/python/trunk/Tools/scripts/redemo.py?content-type=text%2Fplain > redemo.py
/usr/bin/python redemo.py

It seems to work just fine as is on OS X 10.6 with python 2.6.

Ned Deily
Beh, I should have been able to figure this out. Thanks!
twneale