Advertisement
aDnCollin

Python Connectivity

Oct 29th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/python
  2. # Test connectivity
  3. # Haunui Collin "aDn"
  4.  
  5. title = '----------------------------------------'
  6.  
  7. print title
  8. print 'Python Connectivity'
  9. print title
  10. print 'You want test if you are connected to internet ?'
  11.  
  12. reponse = raw_input(" Yes or Not (Y/N): ")
  13.  
  14. if reponse == "Y":
  15.     msg = "Please wait, in work..."
  16.     print msg
  17.     print title
  18.    
  19. else:
  20.     exit()
  21.  
  22. try:
  23.     import urllib
  24.     maPage = urllib.urlopen('http://google.fr')
  25.     print 'Your are connected !'
  26.    
  27. except IOError:
  28.     print 'You are not connected !'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement