logo       

Re: how to determine Mac OS X version: msg#00147

python.apple

Subject: Re: how to determine Mac OS X version

On May 28, 2004, at 2:32 AM, brad.allen@xxxxxxxxxx wrote:


I tried platform.mac_ver(), but this seems to be broken. Google turns up various bug reports on this function.

I can use the shell command system_profiler on 10.3 but it's too slow on 10.2. We still have lots of machines running 10.2, and it will be several months before they can all be upgraded.

Does /usr/bin/sw_vers exist on 10.2? If so, that would be your best bet.. That's what I use in my PackageManager repository scripts.

sysctl doesn't have a variable for this, only for the Darwin version.

"only for the Darwin version"? What does that mean?

Does anybody know a way to do this using Python or calling an outside shell command? I'd like something that will work for both 10.2 and 10.3 without having to install additional Python modules.

see sw_vers above.

-bob


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



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise