[Pythonmac-SIG] UpArrow for previous command

2006-01-30 Thread George Wright
On my old imac when working interactively with python in 'Terminal' I  
could get previous commands by hitting up arrow (or down arrow). I  
can't remember how I set that up and I have been unable to get the  
same feature on my newer iMac g5. Have searched message archives  
without success. Hitting uparrow just prints ^[[A which makes a mess  
you have to delete.
Would appreciate some help.

George Wright
http://users.bigpond.net.au/George.Wright/
http://www.labyrinth.net.au/~gwright



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


[Pythonmac-SIG] Help with path settings

2008-01-21 Thread George Wright

I'm having trouble with PYTHONPATH ..

george-g5:~ georgewright$ env
TERM_PROGRAM=Apple_Terminal
...
PYTHONDOCS=/Users/georgewright/Python_stuff/Python-Docs-2.4.2/
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/:/usr/local/mysql/bin:/ 
opt/local/bin/:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin:/ 
opt/local/bin/:/usr/local/include/:/System/Library/Frameworks/ 
Python.framework/Versions/Current/bin/

...
PYTHONPATH =/usr/local/Zope-3.3.0/lib/python

I want to change this to PYTHONPATH=''
I can't find where I set it to the current value. I know I set it  
that way some months ago so I could do zope things in interactive  
python - but I don't recall how!
I have changed .bash_profile to what I want and searched for .pth  
files that might help but to no avail.

I have changed .profile too

Also the PATH=... :/System/Library/Frameworks/Python.framework/ 
Versions/Current/bin/
points to a 2.3 installation and I want to change that to ... / 
Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
and I don't know how to do it. (I actually get python 2.4 when I  
start it in terminal!)


Can anyone help me sort out this mess?

George Wright
http://users.bigpond.net.au/George.Wright/
http://www.labyrinth.net.au/~gwright



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


Re: [Pythonmac-SIG] Help with path settings

2008-01-29 Thread George Wright

Piet van Oostrum <[EMAIL PROTECTED]> wrote:



George Wright <[EMAIL PROTECTED]> (GW) wrote:



GW> I'm having trouble with PYTHONPATH ..

GW> ...
GW> PYTHONPATH =/usr/local/Zope-3.3.0/lib/python



GW> I want to change this to PYTHONPATH=''
GW> I can't find where I set it to the current value.



I guess you are running Tiger because your system Python is 2.3.


Yes 10.4.11
I guess I should leave the python 2.3 where it is
There are quite a lot of places where environment variables can be  
set.


E.g. ~/.profile ~/.bashrc ~/.login ~/.bash_profile, ~/.bash_login,  
~/.cshrc

~/.tcshrc
/etc/csh.cshrc /etc/csh.login /etc/profile /etc/bashrc
~/.MacOSX/environment.plist

Well this is a very helpful list. First time I've seen them all at  
once. Are there any more?

Turns out that /etc/profile actually listened to my request to:
export PYTHONPATH=''
where the others just ignored it.
In addition I found that it was in:

~/.MacOSX/environment.plist

where I had set  PYTHONPATH to

/usr/local/Zope-3.3.0/lib/python

and then forgot I had done it!
Now I have removed that.
Anyhow it seems to have done the trick. So many thanks.
I will flag your email in case I forget again.

George Wright
http://users.bigpond.net.au/George.Wright/
http://www.labyrinth.net.au/~gwright



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


[Pythonmac-SIG] New Installation of 2.5

2008-08-02 Thread George Wright

Gidday
I have just purchased a new MacBook with OS X 10.5.2 installed.
I want to set up a virtualenv with the latest python.org version of 2.5
There has been heaps of discussion on this list about this kind of  
thing and I doubt If I have

read and understood it all.
Does anyone have a reference to a simple step by step "how to" for  
this installation?


George Wright
[EMAIL PROTECTED]
http://mywebsite.bigpond.net.au/georgewr/
http://labyrinth.net.au/~gwright/



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


Re: [Pythonmac-SIG] New Installation of 2.5

2008-08-03 Thread George Wright


On 03/08/2008, at 9:18 AM, Nehemiah Dacres wrote:

r u talking about sandboxing? thats a little difficult, apple  
didn't provide much documentation on that. there's 3rd party  
documentation here

http://www.318.com/techjournal/?p=107

Well no. Just a simple installation of python.org 2.5.2 behind a  
virtualenv

See for example these threads:
[Pythonmac-SIG] newbie Mac switcher trying to set up django on Intel  
MacBook Pro Tiger

[Pythonmac-SIG] non-framework Python 2.5.2 has empty lib-dynload
Re: [Pythonmac-SIG] problems with sys.path
Re: [Pythonmac-SIG] Leopard easy_install chokes on appscript egg
and maybe others

or are u refering to this http://mail.python.org/pipermail/python- 
dev/2006-July/067046.html
that i referenced from here (do a string search for sandboxing)  
http://old.itconnection.ru/pipermail/zopyrus/2006-August/083936.html



On Sat, Aug 2, 2008 at 7:28 AM, George Wright  
<[EMAIL PROTECTED]> wrote:

Gidday
I have just purchased a new MacBook with OS X 10.5.2 installed.

Actually the preinstalled is 2.5.1 - just a typo sorry.
I want to set up a virtualenv with the latest python.org version of  
2.5
There has been heaps of discussion on this list about this kind of  
thing and I doubt If I have

read and understood it all.
Does anyone have a reference to a simple step by step "how to" for  
this installation?






George Wright
[EMAIL PROTECTED]
http://mywebsite.bigpond.net.au/georgewr/
http://labyrinth.net.au/~gwright/



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


[Pythonmac-SIG] virtualenv problems

2008-08-15 Thread George Wright

Gidday again

I am having trouble getting a virtualenv to use the python version I  
want on my OSX 10.5.4.
• I have installed Python 2.5.2 and used ~/.bash_profile to export  
PATH so that this one comes up when I type python at the shell prompt.  
(I haven't made a ~/.profile entry. I wonder if that would help?)

• I have installed the latest "virtualenv"
• When I create a virtualenv from the command line like this:
$ virtualenv ENV
that works  but the python available after activating is the OSX  
installed global version 2.5.1 and not the 2.5.2 I hoped for. ??

• The virtualenv docs suggest you can call it like this:
$ python virtualenv.py ENV
Which might ensure that 252 came up - But I get this error message:
/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/ 
Contents/MacOS/Python: can't open file 'virtualenv.py': [Errno 2] No  
such file or directory

AND I can't find a virtualenv.py anywhere
• The docs (http://pypi.python.org/pypi/virtualenv#id2) suggest that  
one can 'name a python' but there is no indication as to how that is  
done.

• I have tried the no_site-packages option too.

Any suggestions?
George Wright
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] python help() >modules problem

2008-11-22 Thread George Wright

Gidday
When I start python2.5 (on OSX 2.5.4) in Terminal
then help()
then modules
I don't get the expected list of modules but this error:

help> modules

Please wait a moment while I gather a list of all available modules...

Leopard libedit detected.
Traceback (most recent call last):
  File "", line 1, in 
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site.py", line 348, in __call__

return pydoc.help(*args, **kwds)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1647, in __call__

self.interact()
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1665, in interact

self.help(request)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1681, in help

elif request == 'modules': self.listmodules()
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1802, in listmodules

ModuleScanner().run(callback)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1853, in run

for importer, modname, ispkg in pkgutil.walk_packages():
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pkgutil.py", line 110, in walk_packages

__import__(name)
  File "/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site- 
packages/wxaddons/__init__.py", line 29, in 

config = wx.Config("wxaddons")
  File "//usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site- 
packages/wx-2.8-mac-unicode/wx/_misc.py", line 3298, in __init__

_misc_.Config_swiginit(self,_misc_.new_Config(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!

I don't understand why it is interested in wx.App ??

If I try to run wx demos from the developer examples I get a similar  
response:


python2.5 /Developer/Examples/wxWidgets/wxPython/demo/SizedControls.py
Traceback (most recent call last):
  File "/Developer/Examples/wxWidgets/wxPython/demo/ 
SizedControls.py", line 2, in 

import wxaddons.sized_controls as sc
  File "/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site- 
packages/wxaddons/__init__.py", line 29, in 

config = wx.Config("wxaddons")
  File "//usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site- 
packages/wx-2.8-mac-unicode/wx/_misc.py", line 3298, in __init__

_misc_.Config_swiginit(self,_misc_.new_Config(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!


Furthermore:
If I start python2.6 I do get the asked for list of modules but the  
Python application fires up
and bounces in dock until it eventually stops and reports "Application  
Not Responding"



Anyone help?

George Wright
[EMAIL PROTECTED]
http://mywebsite.bigpond.net.au/georgewr
http://www.labyrinth.net.au/~gwright



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


Re: [Pythonmac-SIG] python help() >modules problem

2008-11-26 Thread George Wright
Well yes Joe - all runs well from demo.py. Some run well called on  
their own.
Slider.py and Sound.py for example. But not the SizedControls.py  
example.
But I don't want to get bogged down on this - it is the python help()  
modules thing I'd like to get going again.

On 23/11/2008, at 10:00 PM, Joe Strout wrote:


Hi George,

I don't have anything helpful to say on all of your questions, but I  
think I can help with this one:


On Nov 22, 2008, at 1:54 PM, George Wright wrote:

If I try to run wx demos from the developer examples I get a  
similar response:


python2.5 /Developer/Examples/wxWidgets/wxPython/demo/ 
SizedControls.py

...

wx._core.PyNoAppError: The wx.App object must be created first!


You aren't intended to run the individual files directly.  Instead,  
run demo.py.


HTH,
- Joe


George Wright
[EMAIL PROTECTED]
http://mywebsite.bigpond.net.au/georgewr
http://www.labyrinth.net.au/~gwright



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


[Pythonmac-SIG] python help() problems

2008-12-19 Thread George Wright

Gidday
I continue to have problems with python 2.5.1 and python2.4 on OSX  
10.5.5
I can't access help() > modules Here is the complete error report for  
2.5


geomacbk:~ georgewr$ python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help()

Welcome to Python 2.5!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given  
word

such as "spam", type "modules spam".

help> modules

Please wait a moment while I gather a list of all available modules...

Leopard libedit detected.
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ 
pkgutil.py:110: DeprecationWarning: twisted.flow is unmaintained.

  __import__(name)
/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5- 
i386.egg/twisted/words/im/__init__.py:8: UserWarning: twisted.im will  
be undergoing a rewrite at some point in the future.
  warnings.warn("twisted.im will be undergoing a rewrite at some  
point in the future.")

Traceback (most recent call last):
  File "", line 1, in 
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site.py", line 348, in __call__

return pydoc.help(*args, **kwds)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1647, in __call__

self.interact()
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1665, in interact

self.help(request)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1681, in help

elif request == 'modules': self.listmodules()
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1802, in listmodules

ModuleScanner().run(callback)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pydoc.py", line 1853, in run

for importer, modname, ispkg in pkgutil.walk_packages():
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/pkgutil.py", line 110, in walk_packages

__import__(name)
  File "/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site- 
packages/wxaddons/__init__.py", line 29, in 

config = wx.Config("wxaddons")
  File "//usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site- 
packages/wx-2.8-mac-unicode/wx/_misc.py", line 3298, in __init__

_misc_.Config_swiginit(self,_misc_.new_Config(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!
>>>
__

I also have an error on python2.4 help()

help> modules
Bus error
geomacbk:~ georgewr$
___

Any assistance appreciated.

George Wright
georg...@bigpond.net.au
http://mywebsite.bigpond.net.au/georgewr/
http://www.labyrinth.net.au/~gwright




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


Re: [Pythonmac-SIG] Shortcut for IDLE on Mac OS X (LEOPARD)

2009-10-07 Thread George Wright

Gregor
Here's one way to do it. My example is for python2.5 not python3.::
Create a shell script that will do the job for you. I've called mine  
"startidle".

Make it executable:  chmod +x startidle
Test from Terminal that it works.
Open AppleScript Editor application and create a new script called  
"startIdle.scpt" with the following text::

--
-- A script to call and run the shell script "startIdle"
-- Both this script and the shell script should be in the  
"AppleScriptsFolder" within

-- the "mypythonstuff" folder in the home folder.
-- George Wright
-- 8th Oct 2009
-- georg...@bigpond.net.au


set myIdle to POSIX path of file ((path to home folder as string) &  
("mypythonstuff:" & "AppleScriptsFolder:" & "startidle"))

set g to (do shell script myIdle)

-- For discussion on calling shell scripts from AppleScript see my  
article

-- http://www.labyrinth.net.au/~gwright/GetAgrepOnAppleScript.html

--

Click the Run button in AppleScript Editor  to test that works. Save  
as "startIdle.scpt"
Lastly after you are satisfied that it all works OK save  "startIdle"  
again as an application
"startIdle.app" and drag that or an alias of it (Command + L ) to the  
desktop.

Double click to start.

Hope that helps

George Wright

On 08/10/2009, at 7:18 AM, Gregor wrote:



Hi,

I'm relatively new to the Mac.
I have a Python 3.1.1. installation on my Macbook
and I'd like to have a shortcut on my desktop starting
IDLE with the -n switch, that is without subprocess

Under Windows I'd rightclick on the desktop, create a
new shortcut and then enter as the target:

C:\Python31\pythonw C:\Python31\Lib\idlelib\idle.pyw -n
Then I have to give it a name and it's ready. (Additionally
I have the option to change the icon)

Is there a similar and similarly simple way to do this
with Mac OS X? (Leopard)

I am able to start IDLE in this mode from a terminal,
but thats rather cumbersome

python3 /Library/Frameworks/Python.framework/Versions/3.1/lib/ 
python3.1/idlelib/idle.py -n


So Id' like to automate it. (I observed, that the IDLE entry in the  
program folder
is not a simple shortcut, so I couldn't find a way to edit an alias  
of it, in order

to add the -n option.)

Thanks in advance for some cool hints

Gregor


George Wright
georg...@bigpond.net.au
http://www.labyrinth.net.au/~gwright





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