Remove temporary files before running script
@@ -14,6 +14,7 @@ if __platform__ is iOS:
import _codecompletion
from pyto import *
from pyto import __isMainApp__
+ import os
if __host__ is not widget:
import builtins
@@ -156,6 +157,14 @@ def run_script(path, replMode=False, debug=False, breakpoints=[]):
if arg != "":
sys.argv.append(str(arg))
+ d=os.path.expanduser("~/tmp")
+ filesToRemove = [os.path.join(d,f) for f in os.listdir(d)]
+ for f in filesToRemove:
+ try:
+ os.remove(f)
+ except PermissionError:
+ pass
+
def run() -> None:
if __platform__ is iOS:
