Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- browserExeFullPath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
- browserUrl = "http://localhost:8080/{FILE_PATH}" # {FILE_PATH} will be replaced with relative file path
- rootDir = "wp_content"
- relPath = re.sub(r'.*{}\\(.*)'.format(rootDir), r'\1', notepad.getCurrentFilename())
- relPath = relPath.replace('\\', '/')
- browserUrl = browserUrl.replace("{FILE_PATH}", relPath)
- command = "\"{}\" {}".format(browserExeFullPath, browserUrl)
- console.run(command)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement