Advertisement
here2share

# pyw_compile.py (no console)

Oct 6th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # pyw_compile.py (no console)
  2.  
  3. import py_compile
  4. import tkFileDialog
  5. oFiletype =("python files","*.py"),("jpg files","*.jpg")
  6. def openfile():
  7.     """Convert a file (specified by a path) into a data URI."""
  8.     return tkFileDialog.askopenfilename(title = "Select file",filetypes=oFiletype)
  9.  
  10. infilename = openfile()
  11. outfilename = 'pyw_'+infilename+'w'
  12. py_compile.compile(infilename,cfile = outfilename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement