docs: def upload_current_script():
      """upload current python script to EV3"""
      current_editor = get_workbench().get_editor_notebook().get_current_editor()
      code = current_editor.get_text_widget().get("1.0", "end")
      try:
          filename= current_editor.get_filename()
          if (not filename) or (not filename.endswith(".py")):
              return
  
          ast.parse(code)
  
          if not code.startswith('#!'):
              if tkMessageBox.askokcancel("Shebang", "To make a python file on the EV3 executable Thonny prepends the shebang line:\n\n      !#/usr/bin/env python3\n"):
                  current_editor.get_text_widget().direct_insert("1.0", "#!/usr/bin/env python3\n")
              else:
                 return
  
          # automatically save file (without confirm dialog, nor dialog for asking filename )
          # save_file does return None, if script is not saved and user closed file saving window, otherwise return file name.
          py_file = current_editor.save_file(False)
          if py_file is None:
              return
  
          upload(py_file)
      except Exception:
          error_msg = traceback.format_exc(0)+'\n'
          showerror("Error", error_msg)