SHARE
TWEET

Untitled

a guest Jun 16th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tkinter import filedialog
  2. import os
  3.  
  4. name = filedialog.askopenfilename(initialdir = "/", title = "Select file",
  5. filetypes = (("py files", "*.py"), ("all files", "*.*")))
  6. file_to_import = os.path.basename(os.path.splitext(name)[0])
  7. import file_to_import
  8.      
  9. import file_to_import
  10. ModuleNotFoundError: No module named 'file_to_import'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top