Are there any macros to determine if my code is being compiled to Windows? [duplicate]

[Edit: I assume you want to use compile-time macros to determine which environment you’re on. Maybe you want to determine if you’re running on Wine under Linux or something instead of Windows, but in general, your compiler targets a specific environment, and that is either Windows (DOS) or it isn’t, but it’s rarely (never?) both.] …

Read more

What’s the difference between operating system “swap” and “page”? [closed]

In spite of the historical interchanging of these two terms, they indicate different things. They are both methods for managing moving data in memory to another storage device, called a backing store (often a hard drive), but they use different methods of doing so. Swapping involves the moving of a process’s entire collection data in …

Read more

Is there a Python equivalent to the ‘which’ command [duplicate]

Python 3.3 added shutil.which() to provide a cross-platform means of discovering executables: http://docs.python.org/3.3/library/shutil.html#shutil.which Return the path to an executable which would be run if the given cmd was called. If no cmd would be called, return None. Sample calls: >>> shutil.which(“python”) ‘/usr/local/bin/python’ >>> shutil.which(“python”) ‘C:\\Python33\\python.EXE’ Unfortunately, this has not been backported to 2.7.x.