At 06:31 PM 11/23/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.

import os
print os.name
# on my system I get nt
# The following names have currently been registered: 'posix', 'nt', 
'mac', 'os2', 'ce', 'java', 'riscos'. 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to