Re: Calling Mac programs from Python instead of from AppleScript

2008-03-20 Thread Python.Arno


On 19 mrt 2008, at 20:41, [EMAIL PROTECTED] wrote:
>
> When I'm running Script Editor, I can get Maya to draw a sphere by
> typing:
>
> tell application "Maya"
>   execute "sphere"
> end tell
>
> When I try this using Python, I get this error message:
>
> IDLE 1.2.2
 app('Maya').execute('sphere')
>
> Traceback (most recent call last):
>  File "", line 1, in 
>app('Maya').execute('sphere')
> NameError: name 'app' is not defined

>
> Maybe I need to load some libraries first.
>

I never used applescript more than to record some clicks but you might  
try

tell application "/Applications/Autodesk/maya2008/Maya"

(replace maya2008 with you app's foldername)
or even

tell application "/Applications/Autodeks/maya2008/Maya/Contents/MacOS/ 
Maya"


> Please help me to get started.
>
like any other VFX app, maya is also adding python libs
you can access MEL commands from a python library:
http://www.autodesk.com/us/maya/docs/Maya85/wwhelp/wwhimpl/common/html/wwhelp.htm?context=DeveloperResources&file=Introduction_to_Maya_Python_API.html


> Thanks
> Dewey V. Schorre
>
gr
Arno Beekman
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Combining music or video files?

2008-06-16 Thread Python.Arno


On 16 jun 2008, at 05:55, Jason Scheirer wrote:


On Jun 15, 7:53 pm, John Salerno <[EMAIL PROTECTED]> wrote:

Before I try this and destroy my computer :) I just wanted to see if
this would even work at all. Is it possible to read a binary file  
such
as an mp3 or an avi, put its contents into a new file, then read  
another
such file and append its contents to this same new file as well,  
thereby

making, for example, a single long video instead of two smaller ones?

Thanks.


This works with basic mpeg videos, but pretty much nothing else.
You're going to need some video editing software.


you can't just edit mpeg (including mp3)...
mpeg is a stream. it sets a "key" frame for the first frame
followed by motion vectors from the changes from that frame
until the next keyframe.
If you cut in the middle of the vectors the keyframe is lost
and the vector frames don;t make any sense anymore.

avi is not a video codec, it's a container like quicktime.
so it depends...

I come from a Mac background and use quicktime a lot.
there are some basic editing features that quicktime can do.
And Apple has a nice quicktime python module in OSX.
I bet there's something for windows too...

best thing to do is convert the video o a framesequence and
the audio to an uncompressed format like wav or aiff
then combine in quicktime or 

cheers,
Arno




--
http://mail.python.org/mailman/listinfo/python-list


Re: raw_input into Tkinter ?

2008-07-01 Thread Python.Arno


On 30 jun 2008, at 18:55, [EMAIL PROTECTED] wrote:


Is there any way to type into a Tkinter frame window?
I want to use raw_input() within a Tkinter frame.
--
http://mail.python.org/mailman/listinfo/python-list



You could use the Tkinter.Entry option from dialog windows...

http://www.pythonware.com/library/tkinter/introduction/dialog-windows.htm

gr
Arno
--
http://mail.python.org/mailman/listinfo/python-list


Re: Discover Islam - The Fastest Growing Religion in the World !

2008-07-03 Thread Python.Arno


On 2 jul 2008, at 20:21, Dikkie Dik wrote:


If it so fast growing, I'd rather wait for a stable release...

LOL
--


yeah compare to what's happening with iPhone and iPod...


--
http://mail.python.org/mailman/listinfo/python-list


Re: like py2exe, but on a mac

2008-07-12 Thread Python.Arno


On 13 jul 2008, at 00:39, Alexnb wrote:



Hi All

I am wondering what I can do to turn a python app (.py) into a mac OSX
applicaiton (.app). Just like py2exe does.


i use these:
http://undefined.org/python/py2app.html
http://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm


But I am also wondering since in
your applications folder on macs it usually doesn't have an actual  
folder
for each app. Rather an icon. so for firefox, you just see the icon.  
Unlike
windows where you have a folder with everything, and the actual  
program is

in it. where is all the application info stored? just in the .app?


apps on OSX are also folder, yet with the reserved .app extension
the OS then presents this as an app (right click on an app and choose  
'Show package content')


py2app creates all that for you



Finally
whether or not there is an app like py2exe for mac, is there a way  
to skip

the middle man and turn it straight into a .dmg with the app inside?
--


a dmg is a disk image, similar to iso on windows
you can create an empty one with Disk Utility then drop everything in
it's NOT an installer




cheers
Arno
--
http://mail.python.org/mailman/listinfo/python-list


Re: like py2exe, but on a mac

2008-07-31 Thread Python.Arno

oops didn't send it to the list...

On 31 jul 2008, at 23:28, Python.Arno wrote:



On 30 jul 2008, at 20:48, William McBrine wrote:


On Wed, 30 Jul 2008 16:57:35 +, I wrote:

[bundlebuidler] does put in a version-specific #! line, but if I  
change
that to #!/usr/bin/env python, the app still works, and it seems  
to me
that it will work for any version of Python on OS 10.4, 10.5, and  
maybe

10.3.


Then again, I see now that it has more hardwired paths in the  
"Python"

binary. Bah.





Arno wrote:
oh just one i forgot, you can also compile python scripts into  
executables

with apple's Xcode, in the developer's tools


gr
Arno
--
http://mail.python.org/mailman/listinfo/python-list


Re: You advice please

2008-08-14 Thread Python.Arno


On 14 aug 2008, at 09:41, Bruno Desthuilliers wrote:


Fredrik Lundh a écrit :
(snip)
Oh, please.  It's a fact that Python advocacy is a lot more low-key  
than the advocacy of certain potentially competing technologies.   
It's always been that way.   Too many Europeans involved, most  
likely.


I'm afraid I don't get the joke about Europeans ??? (ok, I'm gonna  
get me some coffee and will try again...)


It's a compliment, we don't put McDonalds & Coca cola on just  
anything ;)

--
http://mail.python.org/mailman/listinfo/python-list


Re: get number that is raised to the power of

2008-05-02 Thread Python.Arno


On 2 mei 2008, at 11:19, Astan Chee wrote:


Hi,
Im not sure if this is more of a math question or a python question.  
I have a variable in python:

>>> v = 10.0**n
is there a way to find the value of n if i know only v aside from  
str(v).split('+')[1] ? that seems like too much of a hack and I was  
wondering if there was a faster way of doing it?

Thanks for any pointers
Astan







the "reverse" of a power to is logarithm
so v = 10**n  <=>  math.log(v,10) = n

Arno
--
http://mail.python.org/mailman/listinfo/python-list