[Tutor] How to discover which OS my python is running?

Kent Johnson kent37 at tds.net
Wed Nov 23 20:52:05 CET 2005


Diego Galho Prestes wrote:
> Hi! I'm using a program that I want to know if I'm running the program
> in Linux or Windows. How can I do this? I want this because I created
> all my program in Linux but if someone runs it in Windows I have to do
> some things to make it work well, and I want to do this verification
> automatically.

Try sys.platform or os.name.

Kent
-- 
http://www.kentsjohnson.com



More information about the Tutor mailing list