Opens a Web page in a system-specific editor : Os : Buildin Module PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Module » Os »

 

Opens a Web page in a system-specific editor


import os
import sys
import urllib

if lensys.argv != 3:
   sys.exit"Incorrect number of arguments." )

if os.name == "nt" or os.name == "dos":
   editor = "notepad.exe"
elif os.name == "posix":
   editor = "vi"
else:
   sys.exit"Unsupported OS" )

urllib.urlretrievesys.argv], sys.argv] )

os.execvpeditor, editor, sys.argv] ) )



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Module
» Os