Guest User

Untitled

a guest
Jun 20th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import os
  2. from subprocess import Popen
  3.  
  4.  
  5. def enclose(string):
  6. return '"' + string + '"'
  7.  
  8.  
  9. def open_sticker_template():
  10. program = r'C:\Program Files\Microsoft Office\Office12\EXCEL.EXE'
  11. folder = r'C:\Documents and Settings\GARY\My Documents\work\templates\labels'
  12. file = r'drawing labels - normal 7x2.xls'
  13. command = enclose(program) + ' ' + enclose(os.path.join(folder, file))
  14. Popen(command)
  15.  
  16. if __name__ == '__main__':
  17. open_sticker_template()
Add Comment
Please, Sign In to add comment