Hi Elliott, On Sat, Mar 28, 2009 at 3:59 PM, Elliott <elliottbross...@gmail.com> wrote: > > If the user has Java installed, you could execute a .class file to get > this information; for example: > > public class NumProcessors { > public static void main(String[] args) { > System.out.println(Runtime.getRuntime().availableProcessors()); > } > } > > If you compiled this and put the resulting .class file it in the > directory of your script, you would just have to execute "java > NumProcessors" and then capture its output. This would be better than > trying to handle a different case for each OS, I think.
Thanks, that's indeed nice if the java is installed. I think when python is installed, the ncpus() function (which is also in Sage btw) works fine. I am looking for something that will work even if python and java is not installed, but I think I found it, see my previous email. Ondrej --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---