User:Inge Hoonte/operating system detector
< User:Inge Hoonte
Revision as of 00:46, 4 November 2011 by Inge Hoonte (talk | contribs) (Created page with "<source lang="bash"> #!/usr/bin/python import os print "Content-type: image/jpg" print if "Linux" in os.environ['HTTP_USER_AGENT']: f=open("linux.jpg") print f...")
#!/usr/bin/python
import os
print "Content-type: image/jpg"
print
if "Linux" in os.environ['HTTP_USER_AGENT']:
f=open("linux.jpg")
print f.read()
elif "Mac" in os.environ['HTTP_USER_AGENT']:
f=open("mac.jpg")
print f.read()
elif "Windows" in os.environ['HTTP_USER_AGENT']:
f=open("windows.jpg")
print f.read()