python Programming Glossary: sys.platform
Python subprocess.Popen erroring with OSError: [Errno 12] Cannot allocate memory after period of time http://stackoverflow.com/questions/1216794/python-subprocess-popen-erroring-with-oserror-errno-12-cannot-allocate-memory logging case 27152 if self.agentConfig 'debugMode' and sys.platform 'linux2' mem subprocess.Popen 'free' ' m' stdout subprocess.PIPE.. logging case 27152 if self.agentConfig 'debugMode' and sys.platform 'linux2' mem subprocess.Popen 'free' ' m' stdout subprocess.PIPE..
How to open a file with the standard application? http://stackoverflow.com/questions/1679798/how-to-open-a-file-with-the-standard-application open will be available on any unix client running X. if sys.platform 'linux2' subprocess.call xdg open file else os.startfile file..
Why do attribute references act like this with Python inheritance? http://stackoverflow.com/questions/206734/why-do-attribute-references-act-like-this-with-python-inheritance arbritrary code like this import sys class Test object if sys.platform linux2 def hello self print Hello Linux else def hello self..
Python 2.x - Write binary output to stdout? http://stackoverflow.com/questions/2374427/python-2-x-write-binary-output-to-stdout EDIT Solution From ChristopheD's link below import sys if sys.platform win32 import os msvcrt msvcrt.setmode sys.stdout.fileno os.O_BINARY..
Possible values from sys.platform? http://stackoverflow.com/questions/446209/possible-values-from-sys-platform values from sys.platform What are the possible return values from the following command.. return values from the following command import sys print sys.platform I know there is a lot of possibilities so I'm mainly interested.. share improve this question As others have indicated sys.platform is derived from the name that the system vendor gives their..
When to use os.name, sys.platform, or platform.system? http://stackoverflow.com/questions/4553129/when-to-use-os-name-sys-platform-or-platform-system to use os.name sys.platform or platform.system As far as I know Python has 3 ways of finding.. of finding out what operating system is running on os.name sys.platform platform.system Knowing this information is often useful in.. which your program can actually run on It seems like sys.platform is more specific than os.name allowing you to distinguish win32..
How can I return system information in Python? http://stackoverflow.com/questions/466684/how-can-i-return-system-information-in-python code and then import it conditionally. e.g. import sys if sys.platform 'win32' import win32_sysinfo as sysinfo elif sys.platform 'darwin'.. sys.platform 'win32' import win32_sysinfo as sysinfo elif sys.platform 'darwin' import mac_sysinfo as sysinfo elif 'linux' in sys.platform.. 'darwin' import mac_sysinfo as sysinfo elif 'linux' in sys.platform import linux_sysinfo as sysinfo #etc print 'Memory available..
Windows cmd encoding change causes Python crash http://stackoverflow.com/questions/878972/windows-cmd-encoding-change-causes-python-crash to the MS documentation but less so. import sys if sys.platform win32 import codecs from ctypes import WINFUNCTYPE windll POINTER..
How do I use raw_input in Python 3.1 http://stackoverflow.com/questions/954834/how-do-i-use-raw-input-in-python-3-1 do I use raw_input in Python 3.1 import sys print sys.platform print 2 100 raw_input I am using Python 3.1 and can't get the..
|