Ridley5 opened this issue on Jul 26, 2010 · 1724 posts
odf posted Wed, 25 August 2010 at 8:23 AM
Quote -
The last little things I a need to learn is:
- In Python, find out if I'm on Windows, Linux, or Mac. I will use that info to decide what the name of the GUI application actually is. It is LuxPose.exe only on Windows.
- How to launch the application in those other environments. I'm assuming that spawnl will work. I'm using spawnl in Windows just fine. But the Python docs on spawnl say "Availability: Unix, Windows". This worries me, as it implies it is not available on Mac OSX. Is that just a typo? Does spawnl work in Linux and Mac?
I'll start with these and may experiment with the AIR stuff later. I find the installer rather annoying myself.
Anway, Python has the os.name attribute, which does not tell you the name of the operating system itself, but the name of the operating system specific module that was imported. On Linux (and supposedly on MacOS as well, but I haven't tested that) the value is 'posix'. Under Wine, I get 'nt', which I suppose is also the value under Windows. I'll keep investigating. Hopefully, there's some way of distinguishing between Linux and MacOS.
MacOS uses a BSD kernel, which means that basically, the Apple-specific stuff is piled on top of a Unix system. So all the basic Unix functionality will still work. Executable files can be installed and executed normally, as long as they're compiled for MacOS. But there's also a special packaging system, which I am not familiar with. If AIR uses that, we'll have to call in an expert. Otherwise, we might be able to feel our way. I have access to Apple computers at work, so I could do some testing if necessary. But I'm sure there are quite a few genuine Mac people reading this thread as well, so I may still be spared from that.
-- I'm not mad at you, just Westphalian.