def upload(file=None):
if file == None:<EOL><INDENT>return<EOL><DEDENT>list = get_base_ev3dev_cmd() + ['<STR_LIT>','<STR_LIT>', file]<EOL>env = os.environ.copy()<EOL>env["<STR_LIT>"] = THONNY_USER_BASE<EOL>proc = subprocess.Popen(list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,<EOL>universal_newlines=True, env=env)<EOL>dlg = MySubprocessDialog(get_workbench(), proc, "<STR_LIT>", autoclose=True)<EOL>dlg.wait_window()<EOL>
Uploads given .py file to EV3.