Iβm new to Python. I seem to have three partially installed Pythons on my Mac Sierra.
One from Apple
One from Homebrew
And one from the Python Mac installer
In particular, for example, I have a python executable in /usr/bin:
$ which python
/usr/bin/python
This is an actual executable not a symkink. There are a whole bunch of python related files in that directory:
python python-config python2.6 python2.6-config python2.7 python2.7-config pythonw pythonw2.6 pythonw2.7
I think they all came from the python.org python installer.
I would like to fully uninstall the Python (and related files) that I got from the Mac Python Installer from the python web site. I canβt find up to date instructions.
Does anyone know how to do this? Thanks!
Pito Salas
Hello,
I've been following along the SBSendEmail example from Apple.
https://developer.apple.com/library/content/samplecode/SBSendEmail/Introducβ¦
The same should be able to be done via pyobjc as well. The alloc init cycle
of the outgoing message object yields me a Python future object. Example
code below:
from ScriptingBridge import SBApplication
apple_mail = SBApplication.applicationWithBundleIdentifier_(
'com.apple.mail')
apple_mail_message_class = apple_mail.classForScriptingClass_(
'outgoing message')
apple_mail_message = apple_mail_message_class.alloc().initWithProperties_({
'subject': 'foo',
'content': 'bar',
})
Only alloc()ing the object yields an ephemeral pseudo-SB object as improper
SB use does.
>>> apple_mail_message = apple_mail_message_class.alloc()
>>> apple_mail_message
<MailOutgoingMessage objective-c instance 0x7fc0586d24c0>
>>> apple_mail_message.subject()
>>> apple_mail_message.subject()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: cannot access attribute 'subject' of NIL
'MailOutgoingMessage' object
>>> apple_mail_message
<MailOutgoingMessage objective-c instance 0x0>
My understanding of what is going here is that interacting with it once
makes it go away as its retain count is 0 in the Obj-C VM.
The future object contains its properties in its repr().
>>> apple_mail_message
<future MailOutgoingMessage with properties {
content = bar;
subject = foo;
}>
>>> type(apple_mail_message)
<objective-c class SBProxyByClass at 0x7fffa69f9fe0>
So, how to work with these future objects? Or am I doing something
fundamentally wrong in how I'm trying to chase the obj-c example?
--
Joni Orponen