Re: [Pythonmac-SIG] Python threading.Thread vs PyObjC performOnMainThread

2005-05-16 Thread Jack Nutting
> > Including an entire "custom" version of Python just seems like a
> > bad solution to me.  It may be the only solution, depending on
> > various other circumstances, but it seems kind of sad to say "well,
> > OS X ships with Python.framework, but it can't be used to write a
> > Python IDE".
> 
> Mac OS X 10.3 and 10.4 ship with a Python 2.3 framework.  Mac OS X
> 10.5 (hopefully) will not.  Do you want to have to maintain separate
> versions of your app for 10.3-10.4 and 10.5, so as to use the
> standard Python?


I'd like to heartily second (or third, or fourth) this sentiment.  As
I've discovered just from releasing my simple pygame games (which
don't jump through any of the hoops you need to do with PyOXIDE),
relying on Apple-supplied python is probably innappropriate for all
but the very simplest python applicaions (e.g. simple utility scripts
and the like).  Apple dangles that Python.framework carrot there, but
if you want to make software that runs on more than one version of Mac
OS X, the framework does you no good, and in fact lulls you into a
false sense of security, making you think that you're being a good
citizen by using a built-in resource that will carry you along to
future versions (which it most certainly will NOT).

-- 
// jack
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] On posting long urls

2005-05-19 Thread Jack Nutting
On 5/19/05, Arthur Elsenaar <[EMAIL PROTECTED]> wrote:
> 
> Hi list,
> 
> to prevent clickable urls to be broken by wrapping, surround the url
> by <>.
> 
>  alongurlthatwillnotbebroken.alongurlthatwillnotbebroken.alongurlthatwill
> notbebroken.alongurlthatwillnotbebroken.alongurlthatwillnotbebroken>

(Unfortunately, that doesn't actually seem to help in gmail...)

Better yet, use a URL-shortening service like tinyurl.com.  I've got
the following javascript snippet in a bookmark in Safari's bookmark
bar:

javascript:void(location.href='http://tinyurl.com/create.php?url='+location.href)

For whatever page you're looking at, a click on that will take you to
a page that gives you a tinyurl equivalent of your big-ass URL.

-- 
// jack
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] messed up Tiger python install

2005-09-12 Thread Jack Nutting
On 9/12/05, Robert Kern <[EMAIL PROTECTED]> wrote:
Brendan Simons wrote:> Alternatively, can the path be modified by the 2.4 install script?No. Installers that do that kind of thing garner well-earned derision.

Actually, I think that an installer that *asks* if you want it to do so would be quite acceptable.  Something like:

"Version 2.4.1 of python has now been installed in
/usr/local/bin.  You probably want to use this new version as the
default python, so that other python-using programs will find it
instead of the built-in version.  I can take care of this by
putting /usr/local/bin/ at the front of your shell path.  Should I
do this for you?"

That way, those of us who are accustomed to managing our own path can
do so ourselves, while newbies will get it taken care of for them.
-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] messed up Tiger python install

2005-09-12 Thread Jack Nutting
On 9/12/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
Patches accepted at http://sourceforge.net/projects/python
 :)
I don't know where the packagemaker configuration file is, but here's a step toward something that would work in postflight:

#!/bin/sh

dialogText="Version 2.4.1 of python has now been installed in
/usr/local/bin.  You probably want to use this new version as the
default python, so that other python-using programs will find it
instead of the built-in version.  I can take care of this by
putting /usr/local/bin/ at the front of your shell path.  Should I
do this for you?"
osascriptOutput=`/usr/bin/mktemp /tmp/osascript_X`
osascript >$osascriptOutput <
on display_message_dialog()
    try
    tell application "Finder" to display dialog "$dialogText"
    on error errMsg number errnum
    if errnum is -128 then --If user canceled
    return 0
    else
    error errMsg
    end if
    end try
    return 1
end display_message_dialog

tell application "Finder" to activate
set dialogResult to display_message_dialog()
tell application "Terminal" to activate

return dialogResult
appleScriptEnd

shouldInsertIntoPath=`cat $osascriptOutput`
if [ $shouldInsertIntoPath = 1 ]; then
    # user hit OK, now mangle their startup scripts
    echo got yes!
fi

(obviously I left out the part where we actually modify the user's
.profile, .bash_profile, .cshrc, and/or .tcshrc, but I thought that
this bit of applescript hackery could help someone along the way)
-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] packagemanager for Tiger

2005-10-20 Thread Jack Nutting
On 10/20/05, thor <[EMAIL PROTECTED]> wrote:
> I need to install Pygame and PyOpenGL on Tiger. I used to use the
> PackageManager
> from MacPython to install all the dependencies but when I went to
> check MacPython
> now, there is no installer for Tiger. Can I just use the Panther
> installer safely then?
>
> Or is there a newer/better version of MacPython and packagemanager
> that I could
> use. I saw info on PackMan on the wiki, but the link was dead.

You could probably run the Panther version of packagemanager, but
you'll hit another problem:  AFAIK, no one is updating the package
lists anymore, so at best you'll only get old versions of software,
and at worst you'll get nothing (if the data is pointing at
formerly-correct but now-dead URLs).

Your best bet is to first of all get the packages you can from Bob's
site (http://pythonmac.org/packages/), and get used to using the
command-line to install anything else you need.

--
// jack
// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] trouble with NSXMLDocument

2005-11-10 Thread Jack Nutting
Hi gang,I wanted to play around with NSXMLDocument a bit, and figured PyObjC would be a good way to do it.  Unfortunately, I get strange errors.>>> doc, error = Foundation.NSXMLDocument.alloc
().initWithContentsOfURL_options_error_(u"asdfkjsda.svg", 0)2005-11-10 11:03:20.618 python[1018] *** -[OC_PythonUnicode absoluteURL]: selector not recognized [self = 0x370db0]Traceback (most recent call last):
  File "", line 1, in ?ValueError: NSInvalidArgumentException - *** -[OC_PythonUnicode absoluteURL]: selector not recognized [self = 0x370db0]Note that the "asdfkjsda.svg" file is in the same directory where I started python.  I tried using a file URL instead, but both "
file://asdfkjsda.svg" and "file:///Users/jnutting/Documents/svg/shapes/asdfkjsda.svg" give me the same result, as does wrapping the string in unicode(string, 'utf-8') instead of just prepending it with 'u'.
Running framework python 2.4.1, mac os 10.4.3, PyObjC 1.3.7 (from the installer package for 2.4.1/10.3; is it odd that there's not a 1.3.7 for 2.4.1/10.4, or should the one I've got work OK?)-- // jack
// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread Jack Nutting
On 11/15/05, Dave Reed <[EMAIL PROTECTED]> wrote:
I've an experienced Python programmer on Linux - I've mainly used gtkand glade for interfaces and now I'm slowly trying to get startedwith Cocoa apps on X-Code.I've got the CurrencyConverter example working in Python and I did
the HelloWorld example in "The Mac XCode 2 Book" by Cohen and Cohenin Objective C. I got the Python version working  by guessing that Ineeded to use:self.helloSayer.setStringValue_("Hello world")
based on the CurrencyConverter example that did: setFloatValue_That was pretty obvious, but I think I need a Cocoa book that allowsme to see what all the methods are for a given object. I've juststarted the above mentioned XCode 2 book, but it doesn't appear to
have the details of all the Cocoa objects.Does anyone have a recommendation for another book I should get - Iassume I want a Cocoa book of some sort.I don't know if any of the available Cocoa books really cover the entire Foundation and AppKit APIs, but I kind of doubt it since the class libraries are so huge.
However, the API documentation is all installed along with XCode, ready for there to use.  You can browse the docs within XCode, but instead I'd recommend AppKiDo:
http://homepage.mac.com/aglee/downloads/appkido.htmlIt looks through the installed API documentation, and provides a slick, quick interface to search browse the class libraries, more quickly and effectively than a print book could ever provide (IMHO).
-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread Jack Nutting
On 11/15/05, Paul Davis <[EMAIL PROTECTED]> wrote:
Not that my opinion has much weight on this matter, but I also recentlystarted playing with PyObjC and Cocoa.  I really noticed that the APIdocumentation that apple provides is extremely hard to navigate.  Mybuddy told me that there are programs to read the documentation.  Of all
the programing languages and all the API's I have learned, this is thefirst time I've heard of such a thing.  I'm not sure what exactly thissays about the API, but I'm thinking its not good.  I don't really have
a point to make here.  And with that...I think it's a very good point.  It would be really nice if Apple had all the documentation in the header files, so that documentation in different formats (like Apple's current docs, or like Java html docs, or whatever) could be autogenerated, in particular so that people could generate whatever kind of docs they wanted.  If that were the case, it should even be easy to even generate PyObjC-syntax docs for the frameworks.  What the heck, I'll post it as a bug on 
http://bugreport.apple.com just for fun.-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] New Python icons.

2006-03-22 Thread Jack Nutting
On 3/22/06, Brendan Simons <[EMAIL PROTECTED]> wrote:
Chris, And  These look great!  Which one is for what?Without  knowing the original author's intent, I'd guess that the first one with a terminal-style window in the background is for the python executable itself, the second one is for .py documents, and the third one is for .pyc and .pyo files.  So, I'd say that using the second and third ones (or something similar) for .py and .pyc/.pyo files on the Mac would be the way to go.
-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] embed python in cocoa

2008-05-19 Thread Jack Nutting
> Can anyone give me some advice how I wrap my cocoa classes to be able to
> access them from within the python script?
>
> I found the examples on how to wrap c/c++ functions but nothing about
> ObjectC.


You'll want to use PyObjC:

http://pyobjc.sourceforge.net/

Already included in Leopard, so you may not need to even download
anything unless you need a newer version.

-- 
// jack
// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig