Re: [Pythonmac-SIG] Best way to do full-screen mode?

2006-07-22 Thread Michael Hudson
Robert Stephenson <[EMAIL PROTECTED]> writes:

> An alternative would be to bring up a borderless full-screen window.
> Can that be done easily?

I don't know about easily, but it's doable form PyObjC.  Hacked out
from somewhere else:

class PQFullScreenWindow(NSWindow):

def makeForView_(cls, view):
screen = NSScreen.mainScreen()
self = cls.alloc().initWithContentRect_styleMask_backing_defer_(
screen.frame(), NSBorderlessWindowMask, NSBackingStoreBuffered, 
True)
self.view = view
return self
makeForView_ = classmethod(makeForView_)


def canBecomeKeyWindow(self):
return True


def resignKeyWindow(self):
super(PQFullScreenWindow, self).resignKeyWindow()
if self.view.fullscreen > 0:
self.view.toggleFullScreen_(self)


class PQView:
def awakeFromNib(self):
...
self.fsw = PQFullScreenWindow.makeForView_(self)


def toggleFullScreen_(self, sender):
...
# some mucking about with contentViews, etc
self.fsw.makeKeyAndOrderFront_(self)
self.fsw.makeFirstResponder_(self)
self.fsw.setLevel_(NSPopUpMenuWindowLevel)

HTH,
mwh

-- 
  > Touche! But this confirms you are composed of logic gates.
  Crud, I thought those were neurons in there.
-- Thomas F. Burdick, Kenny Tilton, comp.lang.lisp
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Fwd: more OS X oddities

2006-04-17 Thread Michael Hudson
"Nicholas Cole" <[EMAIL PROTECTED]> writes:

> I realised that on OS X it is almost impossible (or at least I can't
> find a way) to capture F-key or meta-key presses using the python
> curses module.

I think this has to do with your terminal emulator more than anything.
Try it in an xterm (if you have x11 installed...).

Cheers,
mwh

-- 
  What the semicolon's anxious supporters fret about is the tendency
  of contemporary writers to use a dash instead of a semicolon and
  thus precipitate the end of the world.
   -- Lynne Truss, "Eats, Shoots & Leaves"
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Framework build of 2.4.2

2005-10-31 Thread Michael Hudson
Ronald Oussoren <[EMAIL PROTECTED]> writes:

> BTW. Actually building the beast sucks, the script for building the
> documentation index is not very reliable: it crashes while waiting
> for the indexer to finish. Luckily I can compensate for this in the
> build script.

If you have changes you think should be checked in, assign a patch on
SF to me and I'll do it.

Cheers,
mwh

-- 
   I recompiled XFree 4.2 with gcc 3.2-beta-from-cvs with -O42
  and -march-pentium4-800Mhz and I am sure that the MOUSE
  CURSOR is moving 5 % FASTER!
-- from Twisted.Quotes
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] CoreGraphics module for python 2.4.1

2005-09-13 Thread Michael Hudson
"Chris Barker" <[EMAIL PROTECTED]> writes:

> Nicholas Riley wrote:
>
>>>Apple's python seamed to come with the CoreGraphics module. Can I get 
>>>that same module for python2.4.1 (form undefined.org)? If so, how?
>>>
>>>OS-X 10.3, if it matters.
>> 
>> Nope, the module is closed-source (most likely because it uses
>> CoreGraphics/Cocoa SPI to do crazy stuff enabling you to draw without
>> a windowserver connection).
>
> Darn, but thanks for the info.

You might just be able to use the .so with Python 2.4.  You'll get
warnings, but it will *probably* Just Work (I don't think the C API
changed very much 2.3 -> 2.4).

Cheers,
mwh

-- 
6. The code definitely is not portable - it will produce incorrect 
   results if run from the surface of Mars.
   -- James Bonfield, http://www.ioccc.org/2000/rince.hint
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Solid GUI toolkits for Mac?

2005-07-27 Thread Michael Hudson
Jon Rosebaugh <[EMAIL PROTECTED]> writes:

> (And if I've got the wrong impression of PyObjC, I'm happy to be
> enlightened.)

You have the wrong impression of PyObjC.  Nearly everything is much
less of a pain than toolbars :) (AIUI, I haven't actually implemented
a toolbar yet...)

Cheers,
mwh

-- 
  I also fondly recall Paris because that's where I learned to
  debug Zetalisp while drunk.  -- Olin Shivers
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] what's the plural of "Emacs"?

2005-06-16 Thread Michael Hudson
Torsten Sadowski <[EMAIL PROTECTED]> writes:

> It could be that you just have to change the preferred order of languages
> for your system.

No, see this page:

http://www.emacswiki.org/cgi-bin/emacs-en/CarbonEmacsPackage

> I had a problem with Safari rendering some web pages in japanese
> until I added english to my system languages.

With respect, this seems deeply unlikely (it was a complaint about not
finding some binary in $PATH, IIRC).

Cheers,
mwh

-- 
  Ya, ya, ya, except ... if I were built out of KSR chips, I'd
  be running at 25 or 50 MHz, and would be wrong about ALMOST
  EVERYTHING almost ALL THE TIME just due to being a computer!
  -- Tim Peters, 30 Apr 97
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] what's the plural of "Emacs"?

2005-06-16 Thread Michael Hudson
Charles Hartman <[EMAIL PROTECTED]> writes:

> I was wondering about the ones in
> http://www.apple.com/downloads/macosx/
> I see "Carbon Emacs", "Emacs on Aqua 8.0-rc3", "AquaMacs 0.9.1" . . .

I think I use the Carbon Emacs from that selection.  It works well,
but needs tweaking on a non-Japanese system (very easy, just deleting
a couple of files, but a bit scary if you didn't know this).

Cheers,
mwh

-- 
  Need to Know is usually an interesting UK digest of things that
  happened last week or might happen next week. [...] This week,
  nothing happened, and we don't care.
   -- NTK Now, 2000-12-29, http://www.ntk.net/
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] PyObjC

2005-06-15 Thread Michael Hudson
Jan Erik Moström <[EMAIL PROTECTED]> writes:

> Michael Hudson <[EMAIL PROTECTED]> 2005-06-15 10:35:
>
>>Use PyObjC.  This is such an easy question! :)
>
> I kind of expected that answer ;-)
>
>>> This might seem like a really stupid question but since I don't
>>> haven't used Cocoa/Objective-C or PyObCj/Python I would like to ask
>>> a question: if I decide to use Python are there limitations on what
>>> I can do? (for example not being able to use UI widget XXX)
>>
>>Not that you'll notice.
>
> Care to give some details? 

Like what?  AFAICT you can't fully use NSInvocation from PyObjC, but
you don't want to.  Stuff like that.

Cheers,
mwh

-- 
  > so python will fork if activestate starts polluting it?
  I find it more relevant to speculate on whether Python would fork
  if the merpeople start invading our cities riding on the backs of 
  giant king crabs. -- Brian Quinlan, comp.lang.python
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] PyObjC

2005-06-15 Thread Michael Hudson
Jan Erik Moström <[EMAIL PROTECTED]> writes:

> I'm currently looking around for what tools I should use for writing Mac
> applications with GUIs. I've previously done this using either Java (no fun
> and Swing based programs doesn't look good) or REALbasic, but would like to
> use something else.

Use PyObjC.  This is such an easy question! :)

> I've looked at Cocoa and Objective-C (haven't done any programming) but I
> don't really like the syntax of Objective-C. So I've been considering using
> Python instead, my previous experience of Python is "standard" shell scripts
> and CGI scripts.
>
> This might seem like a really stupid question but since I don't
> haven't used Cocoa/Objective-C or PyObCj/Python I would like to ask
> a question: if I decide to use Python are there limitations on what
> I can do? (for example not being able to use UI widget XXX)

Not that you'll notice.

Cheers,
mwh

-- 
  Lisp does badly because we refuse to lie.  When people ask us if 
  we can solve insoluble problems we say that we can't, and because 
  they expect us to lie to them, they find some other language
  where the truth is less respected.   -- Tim Bradshaw, comp.lang.lisp
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] PyObjC vs "old school" embedding

2005-06-01 Thread Michael Hudson
[EMAIL PROTECTED] writes:

> So you're saying that in order for PyObjC to work correctly, there  
> must be an explicit PyEval_InitThreads call during the embedding  
> code's initialization?

Before 2.4.2 (not released yet) you need to call PyEval_InitThreads
before calling PyGILState_Release (because of a silly bug), but I
wouldn't expect this to cause a crash where you're seeing one.

Still, might want to try it, though.

Cheers,
mwh

-- 
  A difference which makes no difference is no difference at all.
-- William James (I think.  Reference anyone?)
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] binary extension portability

2005-05-29 Thread Michael Hudson
has <[EMAIL PROTECTED]> writes:

> Bob wrote:
>
>>>One more question: am I right in thinking that extension binaries
>>>aren't portable between major Python versions, e.g. an .so file
>>>built under Python 2.3 won't work on Python 2.4 and vice-versa?
>>
>>Correct, binary extensions are not portable between major Python
>>versions on ANY platform.
>
> Thought as much, just couldn't seem to find confirmation in the
> Python docs. Thanks,

Well, it's more a matter of practicality; there's no effort to make
sure that extensions are binary compatible accross Python versions,
and so usually they aren't.  That said, you'd probably be able to load
an extension for 2.3 into 2.4 if you ignore the warnings, but it
certainly isn't supported.

Cheers,
mwh

-- 
  The ability to quote is a serviceable substitute for wit.
-- W. Somerset Maugham
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Free Python code and Licenses

2005-05-20 Thread Michael Hudson
Kenneth McDonald <[EMAIL PROTECTED]> writes:

> I have nothing against the GPL (well, yes I do, I think it makes the
> free and commercial software sides enemies, but that's a completely
> different topic), but I do think it would be nice if all free Python
> software was released under the same license as Python itself. Python
> is an elegant language, and having all kinds of different Python
> modules under all sorts of different licenses is, well...inelegant.

As Bob said, you really don't want use the PSF license for your own
code.  If you think you do, use MIT/X11.

Cheers,
mwh
(who actually quite likes the LGPL for some things)

-- 
   I'm not a PSU agent.
-- from Twisted.Quotes
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] MacOS 10.4: getxattr() etc. for Python?

2005-05-04 Thread Michael Hudson
Wolfgang Keller <[EMAIL PROTECTED]> writes:

> Hello,
>
>>> > Dumb  question: How about integrating it "officially" in the Macpython
>>> > distribution, so that all file objects on MacOS X.4 automatically have
>>> > an xattr dict?
>>>
>>> Are  these  functions  in  any  way standard (eg. does FreeBSD have
>>> them?). If so, they should probably be detected at configure time.
>
>> I  don't  believe FreeBSD has them, but the SELinux project has them
>> for  ACLs, though they are poorly documented. They may also exist in
>> other  file  systems,  such as ReiserFS. Also, the concept exists on
>> Solaris as well.
>
> Basically _every_ "modern" file system has extended attributes.

That's not quite the point: does "every" system possessing a driver
for such a file system use the getxattr &c functions to access these
features?

> And,  imho, the API (a dict)

The should be "a mapping".

> should be identical on all platforms that support EAs, not just on
> MacOS X.

Makes sense.

Cheers,
mwh

-- 
  Remember - if all you have is an axe, every problem looks 
  like hours of fun.-- Frossie
   -- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] MacOS 10.4: getxattr() etc. for Python?

2005-05-04 Thread Michael Hudson
Wolfgang Keller <[EMAIL PROTECTED]> writes:

[xattr & co]
> Dumb  question: How about integrating it "officially" in the Macpython
> distribution, so that all file objects on MacOS X.4 automatically have
> an xattr dict?

Are these functions in any way standard (eg. does FreeBSD have them?).
If so, they should probably be detected at configure time.

Another question is if empty xattr dicts should appear on platforms
with no support for them.

Cheers,
mwh

-- 
  MARVIN:  Do you want me to sit in a corner and rust, or just fall
   apart where I'm standing?
-- The Hitch-Hikers Guide to the Galaxy, Episode 2
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] changging inheritance on the fly?

2005-04-17 Thread Michael Hudson
altern <[EMAIL PROTECTED]> writes:

> hi
>
> probably a bit offtopic since it is nothing mac specific but i didnt
> know where to ask.

python-list?

> is it possible to change the superclass a class inherits from on the fly?

You can assign to __bases__.

> for example i have this class inheriting from Top but i want it to
> inherit later on the fly from another class living in another
> module. I am doing this below but it doesnt work, 'm' doesnt
> change. Maybe i have to define the class Test on the fly to achive
> this? but i dont like much to do that. any other suggestions? thanks
>
> #this is what i am doing now:
>
> import mymodule as m
>
> def start():
>   import othermodule as m
>   
> class Test(m.Top):
>   def __init__(self):
>   pass

The way you ask the question suggests you don't know Python especially
well.  As Bob says, there are likely better ways to acheive your goal.

Cheers,
mwh

-- 
  But since I'm not trying to impress  anybody in The Software Big
  Top, I'd rather walk the wire using a big pole, a safety harness,
  a net, and with the wire not more than 3 feet off the ground.
   -- Grant Griffin, comp.lang.python
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] GUI design tools

2005-03-09 Thread Michael Hudson
Mark Phillips <[EMAIL PROTECTED]> writes:

> This may be a perennial subject. If this is an oft-repeated request, I
> sincerely apologize for wasting bandwidth.

It's .. not entirely unfamiliar :)

> MacOS X as my primary machine, but historically I have supported old
> MacOS and Windows machines. This makes it hard for me to abandon the
> "cross-platform" mindset. I like tools that ease the creation and
> deployment of applications.

If you can lose that mindset, you will probably find pyobjc +
Interface Builder to be about as painless as it's going to get.

> The ideal solution for me would be a tool set that is similar to
> popular RAD tools such as 4D, Omnis Studio and the like. Using these
> have spoiled me rotten as a programmer, and I find myself balking at
> the installation requirements of the pythonic stuff I have looked
> at. That is, as I work through the steps I wonder how on earth an end
> user will deal with this.

As Bob said, you really shouldn't make the end user deal with this.
OTOH, PyObjC is hardly traumatising to install -- "double click this
pkg".  Not x-platform of course, unless Gnustep suddenly happens in a
way that it hasn't yet.

Cheers,
mwh

-- 
  ARTHUR:  But which is probably incapable of drinking the coffee.
-- The Hitch-Hikers Guide to the Galaxy, Episode 6
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: Fw: [Pythonmac-SIG] Versions, Frameworks, Linking, PantherPythonFix

2005-02-24 Thread Michael Hudson
"Roger Binns" <[EMAIL PROTECTED]> writes:

>>> Taking a step back, am I the only person who thinks the Python situation
>>> on Mac is absolutely ridiculous, although 10.2 looks better than 10.3.
>> As Bob says, you obviously haven't used 10.2...
>  Correct.  I don't want to disparage the improvements that have been
>  made,
> but the situation as it stands right now on Mac still seems really
> bad to me.

You obviously have a different "really bad" threshold than me.

> Compare to Windows:
>
>  http://www.python.org/2.3.5/
>
> On Windows you just run the installer and all is fine.  You can
> run the installer for as many versions as you want.  Most extensions
> are distributed as installers as well.  You just run them, they
> give you a list of installed compatible versions and where they
> are installed.  You choose and all is fine.  Uninstall can be
> done from the Control Panel Add/Remove Programs menu.

We are getting to this position on the mac.  We ain't there yet.  (Or
more precisely, Bob is getting use there.)

> The instructions on that page also cover all the other UNIXen
> which work fine with the tar/configure/make/make install and
> correctly deal with with having multiple concurrent versions.

Um, it seems to me that barring a small (but oh so annoying) bug in
2.3.0, this isn't different on OS X.  Sadly, we can't go back in time
and sort this out, all we can do is "do better next time", and we
(think we) have.

> Mac isn't even mentioned on that page.  The tar/configure/make/make
> install stuff does work.  (I can't tell if it enables frameworks
> by default or not

It doesn't.

> - wxPython requires a framework build, so I enabled it).
>
> But when installing extensions such as wxPython that come with
> a graphical installer (yay!), they don't list the known Pythons
> on the system.

Hmm.  This is something that hadn't occurred to me.  I guess the
unusuality of OS X is somewhat that you might have two copies of 2.3
installed...

Cheers,
mwh

-- 
  CLiki pages can be edited by anybody at any time. Imagine the most
  fearsomely comprehensive legal disclaimer you have ever seen, and
  double it-- http://ww.telent.net/cliki/index
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Versions, Frameworks, Linking, PantherPythonFix

2005-02-23 Thread Michael Hudson
"Roger Binns" <[EMAIL PROTECTED]> writes:

> Taking a step back, am I the only person who thinks the Python situation
> on Mac is absolutely ridiculous, although 10.2 looks better than 10.3.

As Bob says, you obviously haven't used 10.2...

> All I want is one up to date version of Python on my system, and have
> binary and source extensions just work.  This is what it is like on
> Windows and Linux.

Don't you remember the days where Redhat came with Python 1.5.2 and if
you upgraded that you broke redhat's tools?  Plus ca change, plus
c'est la meme chose.

If you want your Python app to work in perpetuity, you'd better bundle
a version of Python with it because one day OS X will presumably come
with 2.4 or 2.5.  This strikes me as being the same as any other
platform.

Cheers,
mwh

-- 
  Every day I send overnight packages filled with rabid weasels to
  people who use frames for no good reason.
 -- The Usenet Oracle, Oracularity #1017-1
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Why do I need PantherPythonFix?

2005-02-23 Thread Michael Hudson
"Chris Barker" <[EMAIL PROTECTED]> writes:

> Bob Ippolito wrote:
>> I also rarely screw with PATH.  Using /usr/bin/env is saying "let
>> PATH decide". 
>
> right. I am always working across platforms, so I want to specify
> which python to use, but not specify where to find it.

If you use distutils, the script header should be rewritten correctly
on installation.

If it's just a script though, distutils is overkill.

Cheers,
mwh
(who generally is in the situation that typing a bare "python" into a
shell gets you something you don't want)

-- 
  I think if we have the choice, I'd rather we didn't explicitly put
  flaws in the reST syntax for the sole purpose of not insulting the
  almighty.-- /will on the doc-sig
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] cross-platform puzzle

2005-02-22 Thread Michael Hudson
Charles Hartman <[EMAIL PROTECTED]> writes:

> So why did my wx.TextCtrl show different double-click behavior on the
> two platforms? Though I'm using Python 2.3 on both, my wxPython on Mac
> is 2.5.3.1 and on Win it was 2.5.2.8 (dumb!) so I thought that might
> be the problem. But no: I upgraded on Win, and I get the same
> behavior. I'll report this on the wxPython list.

I think it might be the underlying controls behaving differently.
Certainly on Mac double-clicking gets you just the word selected (but
if you then press delete, a preceding space will be deleted).  It's
too long since I used windows to be sure how it behaves, but it
wouldn't surprise me if it was different.

Cheers,
mwh

-- 
  > Emacs is a fashion statement.
  No, Gnus is a fashion statement.  Emacs is clothing.  Everyone 
  else is running around naked.
-- Karl Kleinpaste & Jonadab the Unsightly One, gnu.emacs.gnus
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-15 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes:

> On Feb 15, 2005, at 5:48, Michael Hudson wrote:
> 
>> I don't know.  If I did know, I'd probably have done it.  It would
>> help if Apple shipped Python with readline support enabled, for
>> starters.
>
> I think it's a licensing issue, Apple is probably trying to save
> people (themselves?) from linking against GPL stuff without realizing
> the implications.

Probably yes.  But they ship bash with readline enabled... oh well,
I'm not masochistic enough to flog that particular horse.

> If Python could use BSD libedit instead of GNU readline,

I *think* there was a patch to do this, back in the mists of time.

> of if it just included PyRepl, it would not be a problem.

If PyRepl was fit for inclusion (sigh) that would indeed be nice :)

Cheers,
mwh

-- 
  Just point your web browser at http://www.python.org/search/ and
  look for "program", "doesn't", "work", or "my". Whenever you find
  someone else whose program didn't work, don't do what they
  did. Repeat as needed.-- Tim Peters, on python-help, 16 Jun 1998
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-15 Thread Michael Hudson
"Chris Barker" <[EMAIL PROTECTED]> writes:

> That would be nice, but I have even less of an idea how to get money
> for hat than I do getting venture capital to start a
> business. However, perhaps this is just what one poster proposed: the
> PSF could fund a good cross-platform IDE.

I don't think the PSF has the resources to do this currently.  Also,
it doesn't intuitively strike me as the sort of thing the PSF is
currently looking to fund.  But I could be wrong!  Gather some people
and make a proposal for the next round of grants, if you want to show
me up.

Cheers,
mwh

-- 
   INEFFICIENT CAPITALIST YOUR OPULENT 
TOILET WILL BE YOUR UNDOING -- from Twisted.Quotes
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-15 Thread Michael Hudson
Louis Pecora <[EMAIL PROTECTED]> writes:

> Michael Hudson wrote:
>
>>Well, I think this is a subjective judgement -- a matter of
>>familiarity.  I "play" with Python all the time.  A good start is to
>>enhance your interactive experience somewhat.  Three options spring to
>>mind:
>>
>> 1) Get readline support working.  If you're still using Apple's

[...]

>> 2) Install IPython (http://ipython.scipy.org/).  This is a massive

[...]

>> 3) Install (my) PyRepl package (http://codespeak.net/pyrpl/), which
>>is a different implementation of the same kind of thing.
>>
>>There are less terminal oriented interactive environments too -- I
>>think wxPython includes one and PyObjC has a 'PyInterpreter' example.
>>But to me they don't hold much advantage over the in-Terminal.app
>>solutions.
>>
>
> Well, I can just see Troy sitting at his computer reading the above
> and saying, "I rest my case."  :-)

It's all a bit unixy, yes.  OTOH, it's not exactly hard and you only
have to do it once...

> You did somewhat admit that in (1) above and in the remainder of your
> message so you are honest about the state of affairs.  And I thank you
> for all the information.  Now, where to start?  Where to start?

I don't know.  If I did know, I'd probably have done it.  It would
help if Apple shipped Python with readline support enabled, for
starters.

Cheers,
mwh

-- 
  I think my standards have lowered enough that now I think ``good
  design'' is when the page doesn't irritate the living fuck out of 
  me.-- http://www.jwz.org/gruntle/design.html
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-13 Thread Michael Hudson
Troy Rollins <[EMAIL PROTECTED]> writes:

> On Sun, 13 Feb 2005 16:12:13 +, Michael Hudson <[EMAIL PROTECTED]> wrote:
>> Troy Rollins <[EMAIL PROTECTED]> writes:
>> 
>> > I for one, don't care to think of myself in the context of "begger",
>> > but more so in the context of uninitiated contributor. If developers,
>> > new to python, have a barrier to entry, they may well walk of to Ruby,
>> > or Lua... etc. At some point, I'd like to be contributing to the
>> > effort, but just getting off the ground is a bit daunting.
>> 
>> I may be missing details from earlier posts, but what is currently
>> daunting you?  Have you looked at the Python tutorial or the PyObjC
>> tutorial, to pick two simple examples?
>> 
>
> Well, I've transitioned between tools like Director, REALbasic, and
> Revolution,

Well, I've used exactly none of those, but let's see what I can
do... :-)

> and extremely quickly moved into creating non-trivial
> applications. With Python, it is far less condusive to "playing"

Well, I think this is a subjective judgement -- a matter of
familiarity.  I "play" with Python all the time.  A good start is to
enhance your interactive experience somewhat.  Three options spring to
mind:

 1) Get readline support working.  If you're still using Apple's
Python, get bbum's readline.so from

http://homepage.mac.com/bbum/BumFiles/FileSharing27.html

(is this still the right link?), then add lines like

try:
import rlcompleter, readline
readline.parse_and_bind("tab: complete")
except ImportError:
pass

to a file called something link ~/.pythonrc and point the
PYTHONSTARTUP environment variable to it (yikes, this is a bit
involved...).  Then if you want to see what functions a module
supports you can do:

>>> import urllib2
>>> urllib2.url
urllib2.url2pathname  urllib2.urlopen   urllib2.urlparse

and so on:

   >>> data = urllib2.urlopen('http://www.google.com').read()
>>> data[:10]
'http://ipython.scipy.org/).  This is a massive
extension of the above and requires you have readline working.
I've not used it much, but people like it.  I imagine it has docs
:)

 3) Install (my) PyRepl package (http://codespeak.net/pyrpl/), which
is a different implementation of the same kind of thing.

There are less terminal oriented interactive environments too -- I
think wxPython includes one and PyObjC has a 'PyInterpreter' example.
But to me they don't hold much advantage over the in-Terminal.app
solutions.

> and therefore seems to hold me somewhere around the print "hello
> world" stage.

Well, what would you like to do? :) It's often hard to know what to do
with a funky new toy as flexible as Python...

> Yes, I've look at the cited examples... perhaps they simply didn't
> connect with me on the right level.

Well, for some not-exactly-instant-but-quick gratification, I'd
consider playing with PyObjC -- maybe writing a simple image viewer or
something -- though this would involve more time learning about Coca
that Python in all likelyhood.

> Python stuff always seems to be written from the perspective of "ok,
> you are starting from a lower level language",

This is probably a fair comment.  It's certainly the direction I
arrived at Python from...

> but many of us are probably coming from the other direction â a
> higher level language...  Lingo, REALbasic, etc. It would seem to me
> that the transition to Python should be easy, but perhaps I just
> haven't yet encountered the right materials.

I would also offer the advice to stop worrying about materials,
probably.  Pick a (possibly toy) problem and have at it :)

> I just received 3 books on Python from Amazon. Every one of them
> starts with the line "this book does not teach you to program in
> Python, and assumes you already know how to do that." Perhaps it is
> just my own dumb luck, but that is the angle most web materials take
> as well in my experience. OR, it is print "hello world".

Uh, really?  Certainly a lot of books assume you know how to program.

If you don't know that, there's "How to Think Like a Computer
Scientist", urm, hmm... have you read this page:

   http://www.python.org/moin/BeginnersGuide

I was going to copy and paste various stuff from there but I'm not
sure there's a lot of point -- but this section

   Next, you're going to want to read a tutorial and try some simple
   experiments with your new Python interpreter.

   If you've never programmed before, s

Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-13 Thread Michael Hudson
Andrew Meit <[EMAIL PROTECTED]> writes:

> On Feb 13, 2005, at 10:59 AM, Troy wrote:
>
>> I for one, don't care to think of myself in the context of "begger",
>> but more so in the context of uninitiated contributor. If developers,
>> new to python, have a barrier to entry, they may well walk of to Ruby,
>> or Lua... etc. At some point, I'd like to be contributing to the
>> effort, but just getting off the ground is a bit daunting. Obviously,
>> it is doable, since lots of folks work in it every day, but how many
>> have peaked in and turned and left without saying a word? Out of that
>> number, how many may have evolved into providing some contribution? It
>> isn't up to the members of this list to fix, or at least isn't a
>> "responsibility", but it is an issue which also shouldn't simply be
>> dismissed, I think. I think if there is some governing body for
>> Python, it should very much be paying attention to this issue, and
>> recognizing that it is perhaps one of the most important aspects of
>> maintaining and furthering the language... new developers. Many of
>> which would prefer to get started (at least) within the relative
>> controlled environment of an IDE.
>
> -- Amen. I am tried of being told how great a language is when the IDE
>tools for it is not finished or stable,

My claim would rather be that "the IDE" is not *necessary*...

Cheers,
mwh

-- 
  Gevalia is undrinkable low-octane see-through only slightly
  roasted bilge water. Compared to .us coffee it is quite
  drinkable.  -- Måns Nilsson, asr
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Mac User Python Newbies

2005-02-13 Thread Michael Hudson
Troy Rollins <[EMAIL PROTECTED]> writes:

> I for one, don't care to think of myself in the context of "begger",
> but more so in the context of uninitiated contributor. If developers,
> new to python, have a barrier to entry, they may well walk of to Ruby,
> or Lua... etc. At some point, I'd like to be contributing to the
> effort, but just getting off the ground is a bit daunting.

I may be missing details from earlier posts, but what is currently
daunting you?  Have you looked at the Python tutorial or the PyObjC
tutorial, to pick two simple examples?

> Obviously, it is doable, since lots of folks work in it every day,
> but how many have peaked in and turned and left without saying a
> word? Out of that number, how many may have evolved into providing
> some contribution? It isn't up to the members of this list to fix,
> or at least isn't a "responsibility", but it is an issue which also
> shouldn't simply be dismissed, I think.

I hope you don't get the idea that this is being dismissed.

> I think if there is some governing body for Python, it should very
> much be paying attention to this issue, and recognizing that it is
> perhaps one of the most important aspects of maintaining and
> furthering the language... new developers. Many of which would
> prefer to get started (at least) within the relative controlled
> environment of an IDE.

However, it probably is a good deal less effort to explain to
newcomers how to get going without an IDE thatn to write one.
Especially writing an IDE that would be noticeably more correct than
my current Emacs/Terminal/interactive Python setup.

Cheers,
mwh

-- 
  Lisp nearing the age of 50 is the most modern language out
  there. GC, dynamic, reflective, the best OO model extant including
  GFs, procedural macros, and the only thing old-fashioned about it 
  is that it is compiled and fast.   -- Kenny Tilton, comp.lang.python
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Fink, DarwinPorts vs py2app

2005-02-10 Thread Michael Hudson
Michael Maibaum <[EMAIL PROTECTED]> writes:

> As for Python. As soon as there is a framework version of Python
> that can be installed via a destroot for packaging, I'll add it to
> DarwinPorts. Or if someone can figure out how to hack the current
> version to do it...

Is there a bug report for this?

The python build process on OS X has been pretty stable of late, I'd
been lulled into thinking it was working :)

Cheers,
mwh

-- 
  The meaning of "brunch" is as yet undefined.
 -- Simon Booth, ucam.chat
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Apple installed vs. Manual

2005-02-09 Thread Michael Hudson
Charles Hartman <[EMAIL PROTECTED]> writes:

> On Feb 9, 2005, at 10:15 AM, Troy Rollins wrote:
>
>> (Amazon, hurry that shipment of knowledge please!!)
>
> Speaking of which, I'd really like to hear people's judgment about
> what is currently Essential Reading on Python, I mean in print rather
> than online. (I always feel better if I have something to *study*!)

Of course, "it depends".  Dive into Python looks pretty good.  Python
in a Nutshell contains a vast amount of information.  I've heard OK
reports of Learning Python.

On the other hand, I've managed to avoid owning any books on Python at
all apart from the one I tech reviewed 9which sucked).  YMMV.

Cheers,
mwh

-- 
  Not only does the English Language borrow words from other
  languages, it sometimes chases them down dark alleys, hits
  them over the head, and goes through their pockets.   -- Eddy Peters
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] fink vs DarwinPorts?

2005-02-07 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes:

> On Feb 7, 2005, at 12:03, Michael Hudson wrote:
>
>> Bob Ippolito <[EMAIL PROTECTED]> writes:
>>
>>> Well, even if apt didn't suck, its license does.  Apple stays away
>>> from GPL software.  I'm pretty sure that there is exactly zero GPL
>>> code in Mac OS X (not Server) until you install Developer Tools.
>>
>> I think there's a fair bit actually -- gnutar, bash, gnumake...
>
> I could've sworn there wasn't.. maybe I'm thinking of Mac OS X past :)

I think bash appeared with 10.3.  Or maybe 10.2.  Don't know about
gnutar.

gnumake probably doesn't appear unless you install the developer
tools, my brain switched off thinking about your caveat there :)

> Anyway, they definitely seem to avoid it when possible.

Indeed.

Cheers,
mwh

-- 
  Its unmanageable complexity has spawned more fear-preventing tools
  than any other language, but the solution _should_ have been to 
  create and use a language that does not overload the whole goddamn 
  human brain with irrelevant details.  -- Erik Naggum, comp.lang.lisp
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] fink vs DarwinPorts?

2005-02-07 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes:

> Well, even if apt didn't suck, its license does.  Apple stays away
> from GPL software.  I'm pretty sure that there is exactly zero GPL
> code in Mac OS X (not Server) until you install Developer Tools.

I think there's a fair bit actually -- gnutar, bash, gnumake...

Cheers,
mwh
(who doesn't like fink much either)

-- 
  It's an especially annoying American buzzword for "business use, 
  as opposed to consumer, research, or educational use".
-- Tim Peters defines "enterprise"
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Reading the resource fork with Python?

2005-02-01 Thread Michael Hudson
Bill Janssen <[EMAIL PROTECTED]> writes:

> Given a filename on an HFS volume, what call do I use to see if it has
> a resource fork, and if there's anything in it?  How do I read that
> data?

rpath = os.path.join(yourpath, '..namedfork', 'rsrc')
os.path.getsize(rpath) > 0
data = open(rpath).read()

or, possibly more helpfully, 

from Carbon import Res

try:
rf = Res.FSpOpenResFile(yourpath, 0)
except MacOS.Error, e:
if e.args[0] == -39:
# not a resource file
pass
else:
raise
else:
for i in range(1, Res.Count1Types() + 1):
typ = Res.Get1IndType(i)
for j in range(1, Res.Count1Resources(typ) + 1):
res = Res.Get1IndResource(typ, j)
id_, typ2, name = res.GetResInfo()
print repr(typ), id_, repr(name), len(res.data), 
if len(res.data) < 40:
print repr(res.data)
else:
print
Res.CloseResFile(rf)

> I'm trying to read the URL out of a .webloc file, if that helps.

Running the above on the only webloc file I seem to have lying around
gives:

'drag' 128 '' 48
'TEXT' 256 '' 31 'http://www.ambrosiasw.com/news/'
'url ' 256 '' 31 'http://www.ambrosiasw.com/news/'

Cheers,
mwh

-- 
  I think if we have the choice, I'd rather we didn't explicitly put
  flaws in the reST syntax for the sole purpose of not insulting the
  almighty.-- /will on the doc-sig
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] How badly is _locale broken?

2004-12-29 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes:

> Alternatively, we could just punt on the issue and say "you need to
> use 10.X in order to have a working locale module", where 10.X is the
> version that Apple fixes CF.  X is obviously greater than 3, but I
> don't think it will be much greater.  It's been broken for this long,
> and Brett C. said he doesn't use the locale module, so it may be too
> much effort for too little reward.

It would be nice if the unit tests stop failing, though.

Cheers,
mwh

-- 
  Screaming 14-year-old boys attempting to prove to each other that
  they are more 3133t than j00.
 -- Reason #8 for quitting slashdot today, from
http://www.cs.washington.edu/homes/klee/misc/slashdot.html
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] More testers needed: Fix installer

2004-12-27 Thread Michael Hudson
On 27 Dec 2004, at 16:38, Bob Ippolito wrote:
On Dec 27, 2004, at 11:31 AM, Michael Hudson wrote:
But 10.3 is Panther, not Jaguar, right?
Yes.
That was rhetorical :)
I'm not being completely thick, am I?  The file should surely be called 
PantherPythonFix.dmg.

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


Re: [Pythonmac-SIG] More testers needed: Fix installer

2004-12-27 Thread Michael Hudson
Jack Jansen <[EMAIL PROTECTED]> writes:

> On 27-dec-04, at 15:04, Michael Hudson wrote:
>> Indeed you can, and it seems to work (tm) on Panther here, but I'm
>> *reasonably* sure you have chosen the wrong name for the package :)
>
> Yeah, consider that a working title. I may call it "The Installer that
> makes
> Apple-Installed Python on 10.3 build correct extension modules even
> after installing
> newer framework builds of Python".
>
> But suggestions for shorter names are welcome...

But 10.3 is Panther, not Jaguar, right?

Cheers,
mwh

-- 
  There's an aura of unholy black magic about CLISP.  It works, but
  I have no idea how it does it.  I suspect there's a goat involved
  somewhere. -- Johann Hibschman, comp.lang.scheme
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] More testers needed: Fix installer

2004-12-27 Thread Michael Hudson
Jack Jansen <[EMAIL PROTECTED]> writes:

> Ok, Bob, you win:-)
>
> I've created an installer package that replaces the Makefile after a
> simple test that you're actually running 10.3 and have that Makefile
> in the right place (i.e. didn't mess too much with your installation).
>
> If people could test this that'd be nice. Again, I'm especially
> interested in feedback from people running 10.2 or 10.4 (where the
> installer should refuse to run, with a decent message).
>
> You can find the package at
> .

Indeed you can, and it seems to work (tm) on Panther here, but I'm
*reasonably* sure you have chosen the wrong name for the package :)

Cheers,
mwh

-- 
  ZAPHOD:  Listen three eyes, don't try to outweird me, I get stranger
   things than you free with my breakfast cereal.
-- The Hitch-Hikers Guide to the Galaxy, Episode 7
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Let's discuss MacPython distributions for january

2004-12-24 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes:

> On Dec 23, 2004, at 6:28 PM, Michael Hudson wrote:
>
>> Jack Jansen <[EMAIL PROTECTED]> writes:
>>
>>> Second question: I think the solution to peaceful  coexistence is that
>>> all Pythons adopt the solution sketched in Bob's mail
>>> <http://mail.python.org/pipermail/pythonmac-sig/2004-December/
>>> 012292.html>. That discussion is rather technical, but what it boils
>>> down to is that all Pythons (on 10.3) build their extensions with
>>> "-undefined dynamic_lookup", thereby forestalling that extensions
>>> inadvertently pull in a second, different, Python framework.
>>
>> Side question: do we know yet if the Python shipped with tiger will
>> get this right?  I think this is checkable by people not under NDA,
>> but if not at least those people who have seen Tiger previews can
>> think about it :)
>
> They got it right in the Python 2.3.3 that was posted along with the
> Darwin 8.0b1 (?) sources, I'm pretty sure I pointed this out several
> times.

Quite possibly...

> There is no reason to believe they will screw it up between then
> (WWDC) and now :)

Except that I tried to look for evidence of this in the WWDC source
drop last night before posting and failed to find it... oh, is it in
configure.ed?  That seems a strange place to hang it, but oh well.

Cheers,
mwh

-- 
  It is never worth a first class man's time to express a majority
  opinion.  By definition, there are plenty of others to do that.
-- G. H. Hardy
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Let's discuss MacPython distributions for january

2004-12-23 Thread Michael Hudson
Jack Jansen <[EMAIL PROTECTED]> writes:

> Second question: I think the solution to peaceful  coexistence is that
> all Pythons adopt the solution sketched in Bob's mail
>  012292.html>. That discussion is rather technical, but what it boils
> down to is that all Pythons (on 10.3) build their extensions with
> "-undefined dynamic_lookup", thereby forestalling that extensions
> inadvertently pull in a second, different, Python framework.

Side question: do we know yet if the Python shipped with tiger will
get this right?  I think this is checkable by people not under NDA,
but if not at least those people who have seen Tiger previews can
think about it :)

Cheers,
mwh

-- 
  Sufficiently advanced political correctness is indistinguishable
  from irony.   -- Erik Naggum
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig