Advertisement
Guest User

superuser1072530

a guest
May 12th, 2016
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import re
  2.  
  3. browserExeFullPath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
  4. browserUrl = "http://localhost:8080/{FILE_PATH}"        # {FILE_PATH} will be replaced with relative file path
  5. rootDir = "wp_content"
  6.  
  7. relPath = re.sub(r'.*{}\\(.*)'.format(rootDir), r'\1', notepad.getCurrentFilename())
  8. relPath = relPath.replace('\\', '/')
  9. browserUrl = browserUrl.replace("{FILE_PATH}", relPath)
  10.  
  11. command = "\"{}\" {}".format(browserExeFullPath, browserUrl)
  12. console.run(command)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement